diff options
author | Eike Rathke <erack@redhat.com> | 2013-09-04 12:15:33 +0200 |
---|---|---|
committer | Eike Rathke <erack@redhat.com> | 2013-09-04 12:27:10 +0200 |
commit | 8d4cd0751516631bcd5c6fabf1eb07d64bb72f17 (patch) | |
tree | c07355cdd1d659c7830d2ed6d598218553d080ad | |
parent | use Bcp47CountryEntry (diff) | |
download | core-8d4cd0751516631bcd5c6fabf1eb07d64bb72f17.tar.gz core-8d4cd0751516631bcd5c6fabf1eb07d64bb72f17.zip |
renamed ca-XV to ca-valencia and activated ca-ES-valencia, fdo#59867 related
Build Catalan-Valencian as ca-valencia instead of ca-XV private-use.
Introduced LANGUAGE_CATALAN_VALENCIAN 0x0803 mapping to ca-ES-valencia,
preserving old ca-XV and qcv-ES mappings to now
LANGUAGE_CATALAN_VALENCIAN and LANGUAGE_OBSOLETE_USER_CATALAN_VALENCIAN
0x8003 to ca-ES-valencia.
Removed special !bUserInterfaceSelection treatment from
MsLangId::getReplacementForObsoleteLanguage() and added the usual
obsolete replacement instead.
Change-Id: I2fdd8b0bac55d4b4ae2cbf3c3645f09fefec9b6e
-rw-r--r-- | i18nlangtag/qa/cppunit/test_languagetag.cxx | 17 | ||||
-rw-r--r-- | i18nlangtag/source/isolang/isolang.cxx | 20 | ||||
-rw-r--r-- | i18nlangtag/source/isolang/mslangid.cxx | 12 | ||||
-rw-r--r-- | include/i18nlangtag/lang.h | 4 | ||||
-rw-r--r-- | instsetoo_native/util/pack.lst | 6 | ||||
-rw-r--r-- | l10ntools/source/ulfconv/msi-encodinglist.txt | 2 | ||||
-rw-r--r-- | setup_native/source/packinfo/spellchecker_selection.txt | 2 | ||||
-rw-r--r-- | solenv/inc/langlist.mk | 2 | ||||
-rw-r--r-- | svtools/source/misc/langtab.src | 2 |
9 files changed, 26 insertions, 41 deletions
diff --git a/i18nlangtag/qa/cppunit/test_languagetag.cxx b/i18nlangtag/qa/cppunit/test_languagetag.cxx index 915d5cbcc84e..d0145cf7d126 100644 --- a/i18nlangtag/qa/cppunit/test_languagetag.cxx +++ b/i18nlangtag/qa/cppunit/test_languagetag.cxx @@ -153,12 +153,7 @@ void TestLanguageTag::testAllTags() CPPUNIT_ASSERT( aLocale.Language == "qlt" ); CPPUNIT_ASSERT( aLocale.Country == "ES" ); CPPUNIT_ASSERT( aLocale.Variant == s_ca_ES_valencia ); - /* TODO: conversion doesn't know this yet, once it does activate test. */ -#if 0 - CPPUNIT_ASSERT( ca_ES_valencia.getLanguageType() == LANGUAGE_USER_CATALAN_VALENCIAN ); -#else - CPPUNIT_ASSERT( ca_ES_valencia.getLanguageType() == LANGUAGE_SYSTEM ); -#endif + CPPUNIT_ASSERT( ca_ES_valencia.getLanguageType() == LANGUAGE_CATALAN_VALENCIAN ); CPPUNIT_ASSERT( ca_ES_valencia.isValidBcp47() == true ); CPPUNIT_ASSERT( ca_ES_valencia.isIsoLocale() == false ); CPPUNIT_ASSERT( ca_ES_valencia.isIsoODF() == false ); @@ -172,12 +167,7 @@ void TestLanguageTag::testAllTags() CPPUNIT_ASSERT( ca_ES_valencia_Fallbacks[1] == "ca-valencia"); CPPUNIT_ASSERT( ca_ES_valencia_Fallbacks[2] == "ca-ES"); CPPUNIT_ASSERT( ca_ES_valencia_Fallbacks[3] == "ca"); - /* TODO: conversion doesn't know this yet, once it does activate test. */ -#if 0 CPPUNIT_ASSERT( ca_ES_valencia.makeFallback().getBcp47() == "ca-ES-valencia"); -#else - CPPUNIT_ASSERT( ca_ES_valencia.makeFallback().getBcp47() == "ca-ES"); -#endif } { @@ -200,12 +190,7 @@ void TestLanguageTag::testAllTags() CPPUNIT_ASSERT( ca_valencia_Fallbacks.size() == 2); CPPUNIT_ASSERT( ca_valencia_Fallbacks[0] == "ca-valencia"); CPPUNIT_ASSERT( ca_valencia_Fallbacks[1] == "ca"); - /* TODO: conversion doesn't know this yet, once it does activate test. */ -#if 0 CPPUNIT_ASSERT( ca_valencia.makeFallback().getBcp47() == "ca-ES-valencia"); -#else - CPPUNIT_ASSERT( ca_valencia.makeFallback().getBcp47() == "ca-ES"); -#endif } { diff --git a/i18nlangtag/source/isolang/isolang.cxx b/i18nlangtag/source/isolang/isolang.cxx index 1b6e3c4353ff..53e6126704e6 100644 --- a/i18nlangtag/source/isolang/isolang.cxx +++ b/i18nlangtag/source/isolang/isolang.cxx @@ -66,6 +66,7 @@ struct Bcp47CountryEntry LanguageType mnLang; const sal_Char* mpBcp47; sal_Char maCountry[3]; + const sal_Char* mpFallback; /** Obtain a language tag string with '-' separator. */ OUString getTagString() const; @@ -322,9 +323,8 @@ static IsoLanguageCountryEntry const aImplIsoLangEntries[] = { LANGUAGE_BELARUSIAN, "be", "BY" }, { LANGUAGE_CATALAN, "ca", "ES" }, // Spain (default) { LANGUAGE_CATALAN, "ca", "AD" }, // Andorra - { LANGUAGE_USER_CATALAN_VALENCIAN, "ca", "XV" }, // XV: ISO 3166 user-assigned; workaround for UI localization only, do not use in document content! - { LANGUAGE_CATALAN, "qcv", "ES" }, // qcv: ISO 639-3 reserved-for-local-use; UI localization quirk only, do not use in document content! -// { LANGUAGE_USER_CATALAN_VALENCIAN, "ca", "ES" }, // In case MS format files escaped into the wild, map them back. + { LANGUAGE_CATALAN_VALENCIAN, "ca", "XV" }, // XV: ISO 3166 user-assigned; old workaround for UI localization only, in case it escaped to document content + { LANGUAGE_CATALAN_VALENCIAN, "qcv", "ES" }, // qcv: ISO 639-3 reserved-for-local-use; old UI localization quirk only, in case it escaped to document content { LANGUAGE_FRENCH_CAMEROON, "fr", "CM" }, { LANGUAGE_FRENCH_COTE_D_IVOIRE, "fr", "CI" }, { LANGUAGE_FRENCH_MALI, "fr", "ML" }, @@ -579,9 +579,10 @@ static IsoLanguageScriptCountryEntry const aImplIsoLangScriptEntries[] = static Bcp47CountryEntry const aImplBcp47CountryEntries[] = { - // MS-LangID full BCP47, ISO3166 -// { LANGUAGE_USER_CATALAN_VALENCIAN, "ca-ES-valencia", "ES" }, // for example, once we support it in l10n; TODO: add to unit test - { LANGUAGE_DONTKNOW, "", "" } // marks end of table + // 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_DONTKNOW, "", "", "" } // marks end of table }; static IsoLanguageCountryEntry aLastResortFallbackEntry = @@ -822,12 +823,13 @@ void MsLangId::Conversion::convertLanguageToLocaleImpl( LanguageType nLang, if (rLocale.Language == I18NLANGTAG_QLT) { - // Search in BCP47, only full match, only LanguageTag can decide the - // proper fallback. + // Search in BCP47, only full match and one fallback, for other + // fallbacks only LanguageTag can decide. for (const Bcp47CountryEntry* pBcp47Entry = aImplBcp47CountryEntries; pBcp47Entry->mnLang != LANGUAGE_DONTKNOW; ++pBcp47Entry) { - if (rLocale.Variant.equalsIgnoreAsciiCase( pBcp47Entry->getTagString())) + if ( rLocale.Variant.equalsIgnoreAsciiCase( pBcp47Entry->getTagString()) || + rLocale.Variant.equalsIgnoreAsciiCaseAscii( pBcp47Entry->mpFallback)) return pBcp47Entry->getLocale(); } diff --git a/i18nlangtag/source/isolang/mslangid.cxx b/i18nlangtag/source/isolang/mslangid.cxx index 1a0c68e2ea8f..0b0253f943ad 100644 --- a/i18nlangtag/source/isolang/mslangid.cxx +++ b/i18nlangtag/source/isolang/mslangid.cxx @@ -409,7 +409,7 @@ sal_Int16 MsLangId::getScriptType( LanguageType nLang ) // static -LanguageType MsLangId::getReplacementForObsoleteLanguage( LanguageType nLang, bool bUserInterfaceSelection ) +LanguageType MsLangId::getReplacementForObsoleteLanguage( LanguageType nLang, bool /*bUserInterfaceSelection*/ ) { switch (nLang) { @@ -445,6 +445,9 @@ LanguageType MsLangId::getReplacementForObsoleteLanguage( LanguageType nLang, bo case LANGUAGE_OBSOLETE_USER_KABYLE: nLang = LANGUAGE_TAMAZIGHT_LATIN; break; + case LANGUAGE_OBSOLETE_USER_CATALAN_VALENCIAN: + nLang = LANGUAGE_CATALAN_VALENCIAN; + break; // The following are not strictly obsolete but should be mapped to a // replacement locale when encountered. @@ -459,13 +462,6 @@ LanguageType MsLangId::getReplacementForObsoleteLanguage( LanguageType nLang, bo case LANGUAGE_SPANISH_DATED: nLang = LANGUAGE_SPANISH_MODERN; break; - - // Do not use ca-XV for document content. - /* TODO: remove in case we implement BCP47 language tags. */ - case LANGUAGE_USER_CATALAN_VALENCIAN: - if (!bUserInterfaceSelection) - nLang = LANGUAGE_CATALAN; - break; } return nLang; } diff --git a/include/i18nlangtag/lang.h b/include/i18nlangtag/lang.h index 3f80aafe3eca..555e508a657e 100644 --- a/include/i18nlangtag/lang.h +++ b/include/i18nlangtag/lang.h @@ -140,6 +140,7 @@ typedef unsigned short LanguageType; #define LANGUAGE_BULGARIAN 0x0402 #define LANGUAGE_BURMESE 0x0455 #define LANGUAGE_CATALAN 0x0403 +#define LANGUAGE_CATALAN_VALENCIAN 0x0803 #define LANGUAGE_CHEROKEE_UNITED_STATES 0x045C #define LANGUAGE_CHINESE_HONGKONG 0x0C04 #define LANGUAGE_CHINESE_MACAU 0x1404 @@ -440,7 +441,8 @@ typedef unsigned short LanguageType; #define LANGUAGE_USER_CHUVASH 0x0635 #define LANGUAGE_USER_GASCON 0x0636 /* Gascon France */ #define LANGUAGE_USER_GERMAN_BELGIUM 0x8007 /* makeLangID( 0x20, getPrimaryLanguage( LANGUAGE_GERMAN)) */ -#define LANGUAGE_USER_CATALAN_VALENCIAN 0x8003 /* makeLangID( 0x20, getPrimaryLanguage( LANGUAGE_CATALAN)) */ +#define LANGUAGE_OBSOLETE_USER_CATALAN_VALENCIAN 0x8003 /* makeLangID( 0x20, getPrimaryLanguage( LANGUAGE_CATALAN)) */ +#define LANGUAGE_USER_CATALAN_VALENCIAN LANGUAGE_CATALAN_VALENCIAN #define LANGUAGE_USER_HAUSA_GHANA 0x8068 /* makeLangID( 0x20, getPrimaryLanguage( LANGUAGE_HAUSA_NIGERIA)) */ #define LANGUAGE_USER_EWE_GHANA 0x0637 #define LANGUAGE_USER_ENGLISH_GHANA 0x8409 /* makeLangID( 0x21, getPrimaryLanguage( LANGUAGE_ENGLISH_US)) */ diff --git a/instsetoo_native/util/pack.lst b/instsetoo_native/util/pack.lst index 381f306fa023..1de49d104f7b 100644 --- a/instsetoo_native/util/pack.lst +++ b/instsetoo_native/util/pack.lst @@ -7,13 +7,13 @@ # Product List_of_platforms List_of_languages Target -LibreOffice unxlngi6.pro,unxmacxi.pro,unxsoli4.pro,unxsols4.pro,wntmsci12.pro,unxlngx6.pro en-US|ar|bg|bn|ca|ca-XV|cs|da|de|el|en-GB|es|et|eu|fi|fr|ga|gl|he|hu|it|ja|km|ko|lt|mk|nb|nl|om|pl|pt|pt-BR|ru|sh|sl|sr|sv|tr|vi|zh-CN|zh-TW openoffice +LibreOffice unxlngi6.pro,unxmacxi.pro,unxsoli4.pro,unxsols4.pro,wntmsci12.pro,unxlngx6.pro en-US|ar|bg|bn|ca|ca-valencia|cs|da|de|el|en-GB|es|et|eu|fi|fr|ga|gl|he|hu|it|ja|km|ko|lt|mk|nb|nl|om|pl|pt|pt-BR|ru|sh|sl|sr|sv|tr|vi|zh-CN|zh-TW openoffice #LibreOffice unxlngi6,unxmacxi,unxsoli4,unxsols4,wntmsci12 en-US openoffice #LibreOffice_Dev unxlngi6.pro,unxsoli4.pro,unxsols4.pro,wntmsci12.pro,unxmacxi.pro,unxlngx6.pro en-US openofficedev LibreOffice_SDK unxlngi6.pro,unxmacxi.pro,unxsoli4.pro,unxsols4.pro,wntmsci12.pro,unxlngx6.pro en-US sdkoo #LibreOffice_Dev_SDK unxlngi6.pro,unxmacxi.pro,unxsoli4.pro,unxsols4.pro,wntmsci12.pro,unxlngx6.pro en-US sdkoodev LibreOffice_Test unxlngi6.pro,unxmacxi.pro,unxsoli4.pro,unxsols4.pro,wntmsci12.pro,unxlngx6.pro en-US test -LibreOfficeLanguagepack unxlngi6.pro,unxmacxi.pro,unxsoli4.pro,unxsols4.pro,wntmsci12.pro,unxlngx6.pro en-US|ar|as|ast|be|bg|bn|ca|ca-XV|cs|da|de|dz|el|en-GB|eo|es|et|eu|fi|fr|ga|gl|gu|he|hi|hu|id|is|it|ja|ka|km|kn|ko|ku|lt|lv|mk|ml|mr|my|nb|nl|nn|oc|om|or|pa-IN|pl|pt|pt-BR|ro|ru|sh|si|sk|sl|sr|sv|ta|te|th|tr|ug|uk|uz|vi|zh-CN|zh-TW ooolanguagepack +LibreOfficeLanguagepack unxlngi6.pro,unxmacxi.pro,unxsoli4.pro,unxsols4.pro,wntmsci12.pro,unxlngx6.pro en-US|ar|as|ast|be|bg|bn|ca|ca-valencia|cs|da|de|dz|el|en-GB|eo|es|et|eu|fi|fr|ga|gl|gu|he|hi|hu|id|is|it|ja|ka|km|kn|ko|ku|lt|lv|mk|ml|mr|my|nb|nl|nn|oc|om|or|pa-IN|pl|pt|pt-BR|ro|ru|sh|si|sk|sl|sr|sv|ta|te|th|tr|ug|uk|uz|vi|zh-CN|zh-TW ooolanguagepack #LibreOfficeLanguagepack unxlngi6,unxsoli4,unxsols4,wntmsci12,unxmacxi de ooolanguagepack -#LibreOfficeDevLanguagepack unxlngi6.pro,unxsoli4.pro,unxsols4.pro,wntmsci12.pro,unxlngx6.pro,unxmacxi.pro ar|as|ast|bg|bn|ca|ca-XV|cs|da|de|dz|el|en-GB|es|et|eu|fi|fr|ga|gl|gu|he|hi|hu|id|is|it|ja|km|kn|ko|lt|lv|mk|ml|mr|my|nb|nl|nn|oc|om|or|pa-IN|pl|pt|pt-BR|ru|sh|si|sk|sl|sr|sv|ta|te|th|tr|ug|uk|vi|zh-CN|zh-TW ooodevlanguagepack +#LibreOfficeDevLanguagepack unxlngi6.pro,unxsoli4.pro,unxsols4.pro,wntmsci12.pro,unxlngx6.pro,unxmacxi.pro ar|as|ast|bg|bn|ca|ca-valencia|cs|da|de|dz|el|en-GB|es|et|eu|fi|fr|ga|gl|gu|he|hi|hu|id|is|it|ja|km|kn|ko|lt|lv|mk|ml|mr|my|nb|nl|nn|oc|om|or|pa-IN|pl|pt|pt-BR|ru|sh|si|sk|sl|sr|sv|ta|te|th|tr|ug|uk|vi|zh-CN|zh-TW ooodevlanguagepack diff --git a/l10ntools/source/ulfconv/msi-encodinglist.txt b/l10ntools/source/ulfconv/msi-encodinglist.txt index dd512791a83b..529fabda8fc1 100644 --- a/l10ntools/source/ulfconv/msi-encodinglist.txt +++ b/l10ntools/source/ulfconv/msi-encodinglist.txt @@ -38,7 +38,7 @@ br 0 1150 # Breton brx 0 1603 # Bodo (India) bs 0 5146 # bosnian ca 0 1027 # Catalan -ca-XV 0 2051 # Catalan Valencian +ca-valencia 0 2051 # Catalan Valencian cs 0 1029 # Czech cy 0 1106 # Welsh da 0 1030 diff --git a/setup_native/source/packinfo/spellchecker_selection.txt b/setup_native/source/packinfo/spellchecker_selection.txt index 1bfa4a230321..909c166a64cc 100644 --- a/setup_native/source/packinfo/spellchecker_selection.txt +++ b/setup_native/source/packinfo/spellchecker_selection.txt @@ -34,7 +34,7 @@ bn = "bn" br = "br,fr" bs = "bs" ca = "ca,an,es,fr,it,oc" -ca-XV = "ca,an,es,fr,it,oc" +ca-valencia = "ca,an,es,fr,it,oc" cs = "cs" da = "da,de" de = "de,fr,it" diff --git a/solenv/inc/langlist.mk b/solenv/inc/langlist.mk index 541cff5b25bd..56560370b7d7 100644 --- a/solenv/inc/langlist.mk +++ b/solenv/inc/langlist.mk @@ -31,7 +31,7 @@ br \ brx \ bs \ ca \ -ca-XV \ +ca-valencia \ cs \ cy \ da \ diff --git a/svtools/source/misc/langtab.src b/svtools/source/misc/langtab.src index db2ef9490fd2..ec8efe7d73b4 100644 --- a/svtools/source/misc/langtab.src +++ b/svtools/source/misc/langtab.src @@ -71,7 +71,7 @@ StringArray STR_ARR_SVT_LANGUAGE_TABLE < "Bulgarian" ; LANGUAGE_BULGARIAN ; > ; < "Belarusian" ; LANGUAGE_BELARUSIAN ; > ; < "Catalan" ; LANGUAGE_CATALAN ; > ; - < "Catalan (Valencian)" ; LANGUAGE_USER_CATALAN_VALENCIAN ; > ; // UI only! + < "Catalan (Valencian)" ; LANGUAGE_USER_CATALAN_VALENCIAN ; > ; < "Chinese (traditional)" ; LANGUAGE_CHINESE_TRADITIONAL ; > ; < "Chinese (simplified)" ; LANGUAGE_CHINESE_SIMPLIFIED ; > ; < "Chinese (Hong Kong)" ; LANGUAGE_CHINESE_HONGKONG ; > ; |