Пример #1
0
 public void ToLanguageTag_FWIcuLocales_ReturnsLanguageTags()
 {
     // convert older FW language tags
     Assert.AreEqual("slu", IetfLanguageTag.ToLanguageTag("eslu"));
     // other possibilities from FW6.0.6
     Assert.AreEqual("qaa-x-bcd", IetfLanguageTag.ToLanguageTag("x123"));
     Assert.AreEqual("qaa-x-kac", IetfLanguageTag.ToLanguageTag("xka2"));
 }
Пример #2
0
 public void ToLanguageTag_EnglishIcuLocales_ReturnsEnglishLanguageTags()
 {
     // language
     Assert.AreEqual("en", IetfLanguageTag.ToLanguageTag("en"));
     // language, script
     Assert.AreEqual("en", IetfLanguageTag.ToLanguageTag("en_Latn"));
     // language, region
     Assert.AreEqual("en-US", IetfLanguageTag.ToLanguageTag("en_US"));
     // language, script, region, ICU variant
     Assert.AreEqual("en-US-fonipa-x-etic", IetfLanguageTag.ToLanguageTag("en_Latn_US_X_ETIC"));
     // language, ICU variant
     Assert.AreEqual("en-fonipa-x-emic", IetfLanguageTag.ToLanguageTag("en__X_EMIC"));
 }
Пример #3
0
 public void ToLanguageTag_PrivateUseIcuLocales_ReturnsPrivateUseLanguageTags()
 {
     // private use language
     Assert.AreEqual("qaa-x-kal", IetfLanguageTag.ToLanguageTag("xkal"));
     // private use language, custom ICU variant
     Assert.AreEqual("qaa-fonipa-x-kal", IetfLanguageTag.ToLanguageTag("xkal__IPA"));
     // private use language, (standard) private use region
     Assert.AreEqual("qaa-XA-x-kal", IetfLanguageTag.ToLanguageTag("xkal_XA"));
     // private use language, (non-standard) private use script
     Assert.AreEqual("qaa-Qaaa-x-kal-Fake", IetfLanguageTag.ToLanguageTag("xkal_Fake"));
     // language, private use script
     Assert.AreEqual("en-Qaaa-x-Fake", IetfLanguageTag.ToLanguageTag("en_Fake"));
     // language, private use script, private use region
     Assert.AreEqual("en-Qaaa-QM-x-Fake-QD", IetfLanguageTag.ToLanguageTag("en_Fake_QD"));
     // private use language, script
     Assert.AreEqual("qaa-Latn-x-zzz", IetfLanguageTag.ToLanguageTag("zzz_Latn"));
 }
Пример #4
0
 public void ToLanguageTag_AlreadyLanguageTag_NoChange()
 {
     // following are already lang tags
     Assert.AreEqual("en-US", IetfLanguageTag.ToLanguageTag("en-US"));
     Assert.AreEqual("en-Latn-US-fonipa-x-etic", IetfLanguageTag.ToLanguageTag("en-Latn-US-fonipa-x-etic"));
 }
Пример #5
0
 public void ToLanguageTag_ChinesePinyinIcuLocale_ReturnsChineseLanguageTag()
 {
     // language, region, ICU variant
     Assert.AreEqual("zh-CN-pinyin", IetfLanguageTag.ToLanguageTag("zh_CN_X_PY"));
 }