Пример #1
0
 /// ------------------------------------------------------------------------------------
 /// <summary>
 /// Gets the exemplar characters for the given ICU locale.
 /// </summary>
 /// <param name="icuLocale">Code for the ICU locale.</param>
 /// <returns>
 /// A string containing all the exemplar characters (typically only lowercase
 /// word-forming characters), or an empty string if the given locale is unknown to ICU.
 /// </returns>
 /// ------------------------------------------------------------------------------------
 public static string GetExemplarCharacters(string icuLocale)
 {
     using (var rbLangDef = new ResourceBundle(null, icuLocale))
     {
         // If the locale of the resource bundle doesn't match the LocaleAbbr,
         // it loaded something else as a default (e.g. "en").
         // In that case we don't want to use the resource bundle, so ignore it.
         if (rbLangDef.Name != icuLocale)
         {
             return(string.Empty);
         }
         return(rbLangDef.GetStringByKey("ExemplarCharacters"));
     }
 }