summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2013-09-13 21:45:59 +0200
committerEike Rathke <erack@redhat.com>2013-09-13 21:47:12 +0200
commit1ecd1985b1415ed95c472a45c010f8d1a9a99837 (patch)
tree8711dbec8e38affd7fe2cf1236aa55e1db61e1a7
parent4fb405a4f5132ebfd2d72fe4fcd266608307d7de (diff)
added 'en-GB-oed' for "English, OED spelling (UK)"
Change-Id: Ia51a8503213997ea589f2df79552ef765ecfc748
-rw-r--r--i18nlangtag/qa/cppunit/test_languagetag.cxx16
-rw-r--r--i18nlangtag/source/isolang/isolang.cxx1
-rw-r--r--i18nlangtag/source/languagetag/languagetag.cxx14
-rw-r--r--include/i18nlangtag/lang.h1
-rw-r--r--svtools/source/misc/langtab.src1
5 files changed, 33 insertions, 0 deletions
diff --git a/i18nlangtag/qa/cppunit/test_languagetag.cxx b/i18nlangtag/qa/cppunit/test_languagetag.cxx
index 5f5f4b5ace66..9f7c7970881a 100644
--- a/i18nlangtag/qa/cppunit/test_languagetag.cxx
+++ b/i18nlangtag/qa/cppunit/test_languagetag.cxx
@@ -318,6 +318,22 @@ void TestLanguageTag::testAllTags()
CPPUNIT_ASSERT( de_DE.getLanguageType() == LANGUAGE_GERMAN );
}
+ // 'en-GB-oed' is known grandfathered for English, Oxford English
+ // Dictionary spelling
+ {
+ OUString s_en_GB_oed( "en-GB-oed" );
+ LanguageTag en_GB_oed( s_en_GB_oed );
+ lang::Locale aLocale = en_GB_oed.getLocale();
+ CPPUNIT_ASSERT( en_GB_oed.getBcp47() == s_en_GB_oed );
+ CPPUNIT_ASSERT( aLocale.Language == "qlt" );
+ CPPUNIT_ASSERT( aLocale.Country == "GB" ); // only 'GB' because we handle it, liblangtag would not fill this
+ CPPUNIT_ASSERT( aLocale.Variant == "en-GB-oed" );
+ CPPUNIT_ASSERT( en_GB_oed.getLanguageType() == LANGUAGE_USER_ENGLISH_UK_OED );
+ CPPUNIT_ASSERT( en_GB_oed.isValidBcp47() == true );
+ CPPUNIT_ASSERT( en_GB_oed.isIsoLocale() == false );
+ CPPUNIT_ASSERT( en_GB_oed.isIsoODF() == false );
+ }
+
// 'qtz' is a local use known pseudolocale for key ID resource
{
OUString s_qtz( "qtz" );
diff --git a/i18nlangtag/source/isolang/isolang.cxx b/i18nlangtag/source/isolang/isolang.cxx
index fc412e4914b0..6561bccd558c 100644
--- a/i18nlangtag/source/isolang/isolang.cxx
+++ b/i18nlangtag/source/isolang/isolang.cxx
@@ -590,6 +590,7 @@ static Bcp47CountryEntry const aImplBcp47CountryEntries[] =
// MS-LangID full BCP47, ISO3166, ISO639-Variant or other fallback
{ LANGUAGE_CATALAN_VALENCIAN, "ca-ES-valencia", "ES", "ca-valencia" },
{ LANGUAGE_OBSOLETE_USER_CATALAN_VALENCIAN, "ca-ES-valencia", "ES", "" }, // In case MS format files using the old value escaped into the wild, map them back.
+ { LANGUAGE_USER_ENGLISH_UK_OED, "en-GB-oed", "GB", "" }, // grandfathered
{ LANGUAGE_DONTKNOW, "", "", "" } // marks end of table
};
diff --git a/i18nlangtag/source/languagetag/languagetag.cxx b/i18nlangtag/source/languagetag/languagetag.cxx
index 3b94021db1fd..cfbb6ec9c728 100644
--- a/i18nlangtag/source/languagetag/languagetag.cxx
+++ b/i18nlangtag/source/languagetag/languagetag.cxx
@@ -1519,6 +1519,20 @@ LanguageTag::Extraction LanguageTag::simpleExtract( const OUString& rBcp47,
rVariants = rBcp47.copy( nHyph1 + 1);
eRet = EXTRACTED_LV;
}
+ else
+ {
+ // Known and handled grandfathered; ugly but effective ...
+ // Note that nLen must have matched above.
+ // Strictly not a variant, but so far we treat it as such.
+ if (rBcp47.equalsIgnoreAsciiCaseAscii( "en-GB-oed"))
+ {
+ rLanguage = "en";
+ rScript = OUString();
+ rCountry = "GB";
+ rVariants = "oed";
+ eRet = EXTRACTED_LV;
+ }
+ }
}
if (eRet == EXTRACTED_NONE)
rLanguage = rScript = rCountry = rVariants = OUString();
diff --git a/include/i18nlangtag/lang.h b/include/i18nlangtag/lang.h
index 5a968c2380c0..9399850e24c3 100644
--- a/include/i18nlangtag/lang.h
+++ b/include/i18nlangtag/lang.h
@@ -558,6 +558,7 @@ typedef unsigned short LanguageType;
#define LANGUAGE_USER_CORNISH 0x0688
#define LANGUAGE_USER_SAMI_PITE_SWEDEN 0x843B /* makeLangID( 0x21, getPrimaryLanguage( LANGUAGE_SAMI_NORTHERN_NORWAY)) */
#define LANGUAGE_USER_NGAEBERE 0x0689
+#define LANGUAGE_USER_ENGLISH_UK_OED 0x8C09 /* makeLangID( 0x23, getPrimaryLanguage( LANGUAGE_ENGLISH_UK)) */
#define LANGUAGE_USER_PRIV_JOKER 0xFFEB /* privateuse "*" (sic! bad! nasty!), primary 0x3eb, sub 0x3f */
#define LANGUAGE_USER_PRIV_COMMENT 0xFFEC /* privateuse "x-comment", primary 0x3ec, sub 0x3f */
diff --git a/svtools/source/misc/langtab.src b/svtools/source/misc/langtab.src
index b54e3c1caa66..ddc190c77a0c 100644
--- a/svtools/source/misc/langtab.src
+++ b/svtools/source/misc/langtab.src
@@ -84,6 +84,7 @@ StringArray STR_ARR_SVT_LANGUAGE_TABLE
< "Dutch (Belgium)" ; LANGUAGE_DUTCH_BELGIAN ; > ;
< "English (USA)" ; LANGUAGE_ENGLISH_US ; > ;
< "English (UK)" ; LANGUAGE_ENGLISH_UK ; > ;
+ < "English, OED spelling (UK)" ; LANGUAGE_USER_ENGLISH_UK_OED ; > ;
< "English (Australia)" ; LANGUAGE_ENGLISH_AUS ; > ;
< "English (Canada)" ; LANGUAGE_ENGLISH_CAN ; > ;
< "English (New Zealand)" ; LANGUAGE_ENGLISH_NZ ; > ;