summaryrefslogtreecommitdiffstats
path: root/i18nlangtag/qa
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2015-07-10 01:15:50 +0200
committerEike Rathke <erack@redhat.com>2015-07-10 01:25:01 +0200
commit122a15f4a6c09d35db58fe3a7b943b5ea79cbe65 (patch)
tree8efa21c3a6f0a5b30ee77d5a8eae0b48a1ba6df9 /i18nlangtag/qa
parenttdf#91725: Use lighter default colour for minor grid lines (diff)
downloadcore-122a15f4a6c09d35db58fe3a7b943b5ea79cbe65.tar.gz
core-122a15f4a6c09d35db58fe3a7b943b5ea79cbe65.zip
support en-GB-oxendict additionally to now deprecated en-GB-oed
Have them separated so when saving loaded documents the same tag is used to keep the generator happy. When to switch in UI language listbox? Or should we have both entries? Change-Id: If78600229c4b24f6ee598c25d5a8974fef410bb5
Diffstat (limited to 'i18nlangtag/qa')
-rw-r--r--i18nlangtag/qa/cppunit/test_languagetag.cxx34
1 files changed, 30 insertions, 4 deletions
diff --git a/i18nlangtag/qa/cppunit/test_languagetag.cxx b/i18nlangtag/qa/cppunit/test_languagetag.cxx
index b76547c426a6..773465b017d1 100644
--- a/i18nlangtag/qa/cppunit/test_languagetag.cxx
+++ b/i18nlangtag/qa/cppunit/test_languagetag.cxx
@@ -420,7 +420,8 @@ void TestLanguageTag::testAllTags()
}
// 'en-GB-oed' is known grandfathered for English, Oxford English
- // Dictionary spelling
+ // Dictionary spelling.
+ // Deprecated as of 2015-04-17, prefer en-GB-oxendict instead.
{
OUString s_en_GB_oed( "en-GB-oed" );
LanguageTag en_GB_oed( s_en_GB_oed );
@@ -436,13 +437,38 @@ void TestLanguageTag::testAllTags()
CPPUNIT_ASSERT( en_GB_oed.getLanguageAndScript() == "en" );
CPPUNIT_ASSERT( en_GB_oed.getVariants() == "oed" );
::std::vector< OUString > en_GB_oed_Fallbacks( en_GB_oed.getFallbackStrings( true));
- CPPUNIT_ASSERT( en_GB_oed_Fallbacks.size() == 3);
+ CPPUNIT_ASSERT( en_GB_oed_Fallbacks.size() == 4);
CPPUNIT_ASSERT( en_GB_oed_Fallbacks[0] == "en-GB-oed");
- CPPUNIT_ASSERT( en_GB_oed_Fallbacks[1] == "en-GB");
- CPPUNIT_ASSERT( en_GB_oed_Fallbacks[2] == "en");
+ CPPUNIT_ASSERT( en_GB_oed_Fallbacks[1] == "en-GB-oxendict");
+ CPPUNIT_ASSERT( en_GB_oed_Fallbacks[2] == "en-GB");
+ CPPUNIT_ASSERT( en_GB_oed_Fallbacks[3] == "en");
// 'en-oed' is not a valid fallback!
}
+ // 'en-GB-oxendict' as preferred over 'en-GB-oed'.
+ {
+ OUString s_en_GB_oxendict( "en-GB-oxendict" );
+ LanguageTag en_GB_oxendict( s_en_GB_oxendict );
+ lang::Locale aLocale = en_GB_oxendict.getLocale();
+ CPPUNIT_ASSERT( en_GB_oxendict.getBcp47() == s_en_GB_oxendict );
+ CPPUNIT_ASSERT( aLocale.Language == "qlt" );
+ CPPUNIT_ASSERT( aLocale.Country == "GB" );
+ CPPUNIT_ASSERT( aLocale.Variant == s_en_GB_oxendict );
+ CPPUNIT_ASSERT( en_GB_oxendict.getLanguageType() == LANGUAGE_USER_ENGLISH_UK_OXENDICT );
+ CPPUNIT_ASSERT( en_GB_oxendict.isValidBcp47() );
+ CPPUNIT_ASSERT( !en_GB_oxendict.isIsoLocale() );
+ CPPUNIT_ASSERT( !en_GB_oxendict.isIsoODF() );
+ CPPUNIT_ASSERT( en_GB_oxendict.getLanguageAndScript() == "en" );
+ CPPUNIT_ASSERT( en_GB_oxendict.getVariants() == "oxendict" );
+ ::std::vector< OUString > en_GB_oxendict_Fallbacks( en_GB_oxendict.getFallbackStrings( true));
+ CPPUNIT_ASSERT( en_GB_oxendict_Fallbacks.size() == 5);
+ CPPUNIT_ASSERT( en_GB_oxendict_Fallbacks[0] == "en-GB-oxendict");
+ CPPUNIT_ASSERT( en_GB_oxendict_Fallbacks[1] == "en-GB-oed");
+ CPPUNIT_ASSERT( en_GB_oxendict_Fallbacks[2] == "en-oxendict");
+ CPPUNIT_ASSERT( en_GB_oxendict_Fallbacks[3] == "en-GB");
+ CPPUNIT_ASSERT( en_GB_oxendict_Fallbacks[4] == "en");
+ }
+
#if USE_LIBLANGTAG
// 'zh-yue-HK' uses redundant 'zh-yue' and should be preferred 'yue-HK'
#if 0