C# Class SIL.CoreImpl.VariantSubtag

This class represents a variant from the IANA language subtag registry.
Inheritance: Subtag
显示文件 Open project: sillsdev/FieldWorks Class Usage Examples

Public Methods

Method Description
ExtractLanguageCode ( string variant ) : string

When Language is "qaa" we embed the language name as the first private-use element (after any initial x- or embedded -x-) in the variant. Extract this and return it.

IsVariantOf ( string langTag ) : bool

Determines whether this subtag can be used with the specified lang tag.

VariantSubtag ( VariantSubtag subtag, string name ) : System

Initializes a new instance of the T:VariantSubtag class.

VariantSubtag ( string code, string name, bool isPrivateUse, IEnumerable prefixes ) : System

Initializes a new instance of the T:VariantSubtag class.

Private Methods

Method Description
RemovePrivateLanguageName ( string code ) : string

Assuming the input is a variant which is or contains a private language name, remove it and return the rest. Return an empty string if there is nothing else.

Method Details

ExtractLanguageCode() public static method

When Language is "qaa" we embed the language name as the first private-use element (after any initial x- or embedded -x-) in the variant. Extract this and return it.
public static ExtractLanguageCode ( string variant ) : string
variant string
return string

IsVariantOf() public method

Determines whether this subtag can be used with the specified lang tag.
public IsVariantOf ( string langTag ) : bool
langTag string The lang tag.
return bool

VariantSubtag() public method

Initializes a new instance of the T:VariantSubtag class.
public VariantSubtag ( VariantSubtag subtag, string name ) : System
subtag VariantSubtag The subtag.
name string The name.
return System

VariantSubtag() public method

Initializes a new instance of the T:VariantSubtag class.
public VariantSubtag ( string code, string name, bool isPrivateUse, IEnumerable prefixes ) : System
code string The code.
name string The name.
isPrivateUse bool if set to true this is a private use subtag.
prefixes IEnumerable The prefixes.
return System