Class TMXTools
Inheritance
Inherited Members
Namespace: Sdl.LanguagePlatform.IO.TMX
Assembly: Sdl.LanguagePlatform.IO.dll
Syntax
public static class TMXTools
Methods
GetLanguageDirection(String)
Declaration
[Obsolete("Use GetLanguageDirectionAsync")]
public static LanguagePair GetLanguageDirection(string filename)
Parameters
Type | Name | Description |
---|---|---|
System.String | filename |
Returns
Type | Description |
---|---|
LanguagePair |
GetLanguageDirectionAsync(String, ICultureMetadataManager)
Attempts to obtain the language direction from a TMX file which must be bilingual. The method reads the first couple of TUs from the input file and determines the language direction. If not null, the result's languages will be set to the source and target language. If a language in the result is null, it was not present in any TUs in the sample. If a language is the InvariantCulture, it was inconsistent within the sample (as is the case with multi-target-language TUs).
Declaration
public static Task<(LanguagePair result, CultureCode headerSourceLanguage)> GetLanguageDirectionAsync(string fileName, ICultureMetadataManager cultureMetadataManager)
Parameters
Type | Name | Description |
---|---|---|
System.String | fileName | The input file name |
Sdl.Core.Globalization.CultureMetadataManager.ICultureMetadataManager | cultureMetadataManager |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<System.ValueTuple<LanguagePair, Sdl.Core.Globalization.CultureCode>> | The language direction or null on errors or if the language direction cannot be determined or invalid input is encountered. No exceptions are returned. |
GetLanguagesAsync(String, Int32, ICultureMetadataManager)
Gets the languages from the given TMX filename.
Declaration
public static Task<(IList<CultureCode> result, int scannedTUs)> GetLanguagesAsync(string fileName, int limit, ICultureMetadataManager cultureMetadataManager)
Parameters
Type | Name | Description |
---|---|---|
System.String | fileName | file name |
System.Int32 | limit | limit on scanned TUs; if 0 then no limit |
Sdl.Core.Globalization.CultureMetadataManager.ICultureMetadataManager | cultureMetadataManager |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<System.ValueTuple<System.Collections.Generic.IList<Sdl.Core.Globalization.CultureCode>, System.Int32>> | languages |