C# Class Bloom.ToPalaso.LanguageLookupModelExtensions

ファイルを表示 Open project: BloomBooks/BloomDesktop

Public Methods

Method Description
GetBestLanguageName ( this isoModel, string code, string &name ) : bool

A smarter way to get a name for an iso code. Currently StandardSubtags.RegisteredLanguages.TryGet does not find an entry at all using 3-letter codes. This adds a fall-back which still finds a language that has the exact requested language code. If we can't find ANY name, the out param is set to the code itself, and we return false. Possibly obsolete, I don't know whether the recent rework of writing systems in libpalaso fixed the problem.

Method Details

GetBestLanguageName() public static method

A smarter way to get a name for an iso code. Currently StandardSubtags.RegisteredLanguages.TryGet does not find an entry at all using 3-letter codes. This adds a fall-back which still finds a language that has the exact requested language code. If we can't find ANY name, the out param is set to the code itself, and we return false. Possibly obsolete, I don't know whether the recent rework of writing systems in libpalaso fixed the problem.
public static GetBestLanguageName ( this isoModel, string code, string &name ) : bool
isoModel this
code string
name string
return bool