C# Class SIL.FieldWorks.FDO.DomainServices.DataMigration.Version19LangTagUtils

Fragments we need of LangTagUtils, compatible with expectations for version 19.
Mostra file Open project: sillsdev/FieldWorks

Public Methods

Method Description
GetLanguageSubtag ( string code ) : LanguageSubtag

Gets the language subtag with the specified code.

GetRegionSubtag ( string code ) : RegionSubtag

Gets the region subtag with the specified code.

GetScriptSubtag ( string code ) : ScriptSubtag

Gets the script subtag with the specified code.

GetSubtags ( string langTag, LanguageSubtag &languageSubtag, ScriptSubtag &scriptSubtag, RegionSubtag &regionSubtag, VariantSubtag &variantSubtag ) : bool

Gets the subtags of the specified language tag.

GetVariantSubtag ( string code ) : VariantSubtag

Gets the variant subtag with the specified code.

IsPrivateUseRegionCode ( string regionCode ) : bool
ToLangTag ( LanguageSubtag languageSubtag, ScriptSubtag scriptSubtag, RegionSubtag regionSubtag, VariantSubtag variantSubtag ) : string

Generates a language tag from the specified subtags.

ToLangTag ( string icuLocale ) : string

Converts the specified ICU locale to a language tag. If the ICU locale is already a valid language tag, it will return it.

Private Methods

Method Description
NextSubTag ( string subTags, int &subTagIndex, bool &privateUsePrefix ) : string
TranslateVariantCode ( string variantCode, string>.Func defaultFunc ) : string

Translates standard variant codes to their expanded (semi-human-readable) format; all others are translated using the given function.

Version19LangTagUtils ( ) : System

Method Details

GetLanguageSubtag() public static method

Gets the language subtag with the specified code.
public static GetLanguageSubtag ( string code ) : LanguageSubtag
code string The code.
return SIL.CoreImpl.LanguageSubtag

GetRegionSubtag() public static method

Gets the region subtag with the specified code.
public static GetRegionSubtag ( string code ) : RegionSubtag
code string The code.
return SIL.CoreImpl.RegionSubtag

GetScriptSubtag() public static method

Gets the script subtag with the specified code.
public static GetScriptSubtag ( string code ) : ScriptSubtag
code string The code.
return SIL.CoreImpl.ScriptSubtag

GetSubtags() public static method

Gets the subtags of the specified language tag.
public static GetSubtags ( string langTag, LanguageSubtag &languageSubtag, ScriptSubtag &scriptSubtag, RegionSubtag &regionSubtag, VariantSubtag &variantSubtag ) : bool
langTag string The language tag.
languageSubtag SIL.CoreImpl.LanguageSubtag The language subtag.
scriptSubtag SIL.CoreImpl.ScriptSubtag The script subtag.
regionSubtag SIL.CoreImpl.RegionSubtag The region subtag.
variantSubtag SIL.CoreImpl.VariantSubtag The variant subtag.
return bool

GetVariantSubtag() public static method

Gets the variant subtag with the specified code.
public static GetVariantSubtag ( string code ) : VariantSubtag
code string The code.
return SIL.CoreImpl.VariantSubtag

IsPrivateUseRegionCode() public static method

public static IsPrivateUseRegionCode ( string regionCode ) : bool
regionCode string
return bool

ToLangTag() public static method

Generates a language tag from the specified subtags.
public static ToLangTag ( LanguageSubtag languageSubtag, ScriptSubtag scriptSubtag, RegionSubtag regionSubtag, VariantSubtag variantSubtag ) : string
languageSubtag SIL.CoreImpl.LanguageSubtag The language subtag.
scriptSubtag SIL.CoreImpl.ScriptSubtag The script subtag.
regionSubtag SIL.CoreImpl.RegionSubtag The region subtag.
variantSubtag SIL.CoreImpl.VariantSubtag The variant subtag.
return string

ToLangTag() public static method

Converts the specified ICU locale to a language tag. If the ICU locale is already a valid language tag, it will return it.
public static ToLangTag ( string icuLocale ) : string
icuLocale string The ICU locale.
return string