[Libreoffice-commits] core.git: 5 commits - i18nlangtag/qa i18nlangtag/source i18npool/source include/i18nlangtag
Eike Rathke
erack at redhat.com
Tue Sep 10 14:05:03 PDT 2013
i18nlangtag/qa/cppunit/test_languagetag.cxx | 26
i18nlangtag/source/isolang/isolang.cxx | 878 ++++++++++++-------------
i18nlangtag/source/languagetag/languagetag.cxx | 10
i18npool/source/localedata/LocaleNode.cxx | 379 +++++-----
include/i18nlangtag/mslangid.hxx | 10
5 files changed, 689 insertions(+), 614 deletions(-)
New commits:
commit e7cc2f266cd82713f52724126c04f8fba8a1ff3c
Author: Eike Rathke <erack at redhat.com>
Date: Tue Sep 10 21:35:14 2013 +0200
more annoying indentation
Change-Id: I1f0af259614909e6310a521a4db4d6e3caac8772
diff --git a/i18npool/source/localedata/LocaleNode.cxx b/i18npool/source/localedata/LocaleNode.cxx
index a4af95f..905df2e 100644
--- a/i18npool/source/localedata/LocaleNode.cxx
+++ b/i18npool/source/localedata/LocaleNode.cxx
@@ -2030,10 +2030,10 @@ void LCMiscNode::generateCode (const OFileWriter &of) const
OUString useLocale = getAttr().getValueByName("ref");
if (!useLocale.isEmpty()) {
useLocale = useLocale.replace( '-', '_');
- of.writeRefFunction("getForbiddenCharacters_", useLocale);
- of.writeRefFunction("getBreakIteratorRules_", useLocale);
- of.writeRefFunction("getReservedWords_", useLocale);
- return;
+ of.writeRefFunction("getForbiddenCharacters_", useLocale);
+ of.writeRefFunction("getBreakIteratorRules_", useLocale);
+ of.writeRefFunction("getReservedWords_", useLocale);
+ return;
}
const LocaleNode * reserveNode = findNode("ReservedWords");
if (!reserveNode)
@@ -2124,209 +2124,209 @@ void LCMiscNode::generateCode (const OFileWriter &of) const
void LCNumberingLevelNode::generateCode (const OFileWriter &of) const
{
- of.writeAsciiString("// ---> ContinuousNumbering\n");
+ of.writeAsciiString("// ---> ContinuousNumbering\n");
OUString useLocale = getAttr().getValueByName("ref");
if (!useLocale.isEmpty()) {
useLocale = useLocale.replace( '-', '_');
- of.writeRefFunction2("getContinuousNumberingLevels_", useLocale);
- return;
+ of.writeRefFunction2("getContinuousNumberingLevels_", useLocale);
+ return;
}
- // hard code number of attributes per style.
- const int nAttributes = 5;
- const char* attr[ nAttributes ] = { "Prefix", "NumType", "Suffix", "Transliteration", "NatNum" };
+ // hard code number of attributes per style.
+ const int nAttributes = 5;
+ const char* attr[ nAttributes ] = { "Prefix", "NumType", "Suffix", "Transliteration", "NatNum" };
- // record each attribute of each style in a static C++ variable.
- // determine number of styles on the fly.
- sal_Int32 nStyles = getNumberOfChildren();
- sal_Int32 i;
+ // record each attribute of each style in a static C++ variable.
+ // determine number of styles on the fly.
+ sal_Int32 nStyles = getNumberOfChildren();
+ sal_Int32 i;
- for( i = 0; i < nStyles; ++i )
- {
- const Attr &q = getChildAt( i )->getAttr();
- for( sal_Int32 j=0; j<nAttributes; ++j )
- {
- const char* name = attr[j];
- OUString value = q.getValueByName( name );
- of.writeParameter("continuous", name, value, sal::static_int_cast<sal_Int16>(i) );
- }
- }
+ for( i = 0; i < nStyles; ++i )
+ {
+ const Attr &q = getChildAt( i )->getAttr();
+ for( sal_Int32 j=0; j<nAttributes; ++j )
+ {
+ const char* name = attr[j];
+ OUString value = q.getValueByName( name );
+ of.writeParameter("continuous", name, value, sal::static_int_cast<sal_Int16>(i) );
+ }
+ }
- // record number of styles and attributes.
- of.writeAsciiString("static const sal_Int16 continuousNbOfStyles = ");
- of.writeInt( sal::static_int_cast<sal_Int16>( nStyles ) );
- of.writeAsciiString(";\n\n");
- of.writeAsciiString("static const sal_Int16 continuousNbOfAttributesPerStyle = ");
- of.writeInt( nAttributes );
- of.writeAsciiString(";\n\n");
+ // record number of styles and attributes.
+ of.writeAsciiString("static const sal_Int16 continuousNbOfStyles = ");
+ of.writeInt( sal::static_int_cast<sal_Int16>( nStyles ) );
+ of.writeAsciiString(";\n\n");
+ of.writeAsciiString("static const sal_Int16 continuousNbOfAttributesPerStyle = ");
+ of.writeInt( nAttributes );
+ of.writeAsciiString(";\n\n");
- // generate code. (intermediate arrays)
- for( i=0; i<nStyles; i++ )
- {
- of.writeAsciiString("\nstatic const sal_Unicode* continuousStyle" );
- of.writeInt( sal::static_int_cast<sal_Int16>(i) );
- of.writeAsciiString("[] = {\n");
- for( sal_Int32 j=0; j<nAttributes; j++)
- {
- of.writeAsciiString("\t");
- of.writeAsciiString( "continuous" );
- of.writeAsciiString( attr[j] );
- of.writeInt(sal::static_int_cast<sal_Int16>(i));
- of.writeAsciiString(",\n");
- }
- of.writeAsciiString("\t0\n};\n\n");
- }
+ // generate code. (intermediate arrays)
+ for( i=0; i<nStyles; i++ )
+ {
+ of.writeAsciiString("\nstatic const sal_Unicode* continuousStyle" );
+ of.writeInt( sal::static_int_cast<sal_Int16>(i) );
+ of.writeAsciiString("[] = {\n");
+ for( sal_Int32 j=0; j<nAttributes; j++)
+ {
+ of.writeAsciiString("\t");
+ of.writeAsciiString( "continuous" );
+ of.writeAsciiString( attr[j] );
+ of.writeInt(sal::static_int_cast<sal_Int16>(i));
+ of.writeAsciiString(",\n");
+ }
+ of.writeAsciiString("\t0\n};\n\n");
+ }
- // generate code. (top-level array)
- of.writeAsciiString("\n");
- of.writeAsciiString("static const sal_Unicode** LCContinuousNumberingLevelsArray[] = {\n" );
- for( i=0; i<nStyles; i++ )
- {
- of.writeAsciiString( "\t" );
- of.writeAsciiString( "continuousStyle" );
- of.writeInt( sal::static_int_cast<sal_Int16>(i) );
- of.writeAsciiString( ",\n");
- }
- of.writeAsciiString("\t0\n};\n\n");
- of.writeFunction2("getContinuousNumberingLevels_", "continuousNbOfStyles",
+ // generate code. (top-level array)
+ of.writeAsciiString("\n");
+ of.writeAsciiString("static const sal_Unicode** LCContinuousNumberingLevelsArray[] = {\n" );
+ for( i=0; i<nStyles; i++ )
+ {
+ of.writeAsciiString( "\t" );
+ of.writeAsciiString( "continuousStyle" );
+ of.writeInt( sal::static_int_cast<sal_Int16>(i) );
+ of.writeAsciiString( ",\n");
+ }
+ of.writeAsciiString("\t0\n};\n\n");
+ of.writeFunction2("getContinuousNumberingLevels_", "continuousNbOfStyles",
"continuousNbOfAttributesPerStyle", "LCContinuousNumberingLevelsArray");
}
void LCOutlineNumberingLevelNode::generateCode (const OFileWriter &of) const
{
- of.writeAsciiString("// ---> OutlineNumbering\n");
+ of.writeAsciiString("// ---> OutlineNumbering\n");
OUString useLocale = getAttr().getValueByName("ref");
if (!useLocale.isEmpty()) {
useLocale = useLocale.replace( '-', '_');
- of.writeRefFunction3("getOutlineNumberingLevels_", useLocale);
- return;
+ of.writeRefFunction3("getOutlineNumberingLevels_", useLocale);
+ return;
}
- // hardcode number of attributes per level
- const int nAttributes = 11;
- const char* attr[ nAttributes ] =
- {
- "Prefix",
- "NumType",
- "Suffix",
- "BulletChar",
- "BulletFontName",
- "ParentNumbering",
- "LeftMargin",
- "SymbolTextDistance",
- "FirstLineOffset",
- "Transliteration",
- "NatNum",
- };
-
- // record each attribute of each level of each style in a static C++ variable.
- // determine number of styles and number of levels per style on the fly.
- sal_Int32 nStyles = getNumberOfChildren();
- vector<sal_Int32> nLevels; // may be different for each style?
- for( sal_Int32 i = 0; i < nStyles; i++ )
- {
- LocaleNode* p = getChildAt( i );
- nLevels.push_back( p->getNumberOfChildren() );
- for( sal_Int32 j=0; j<nLevels.back(); j++ )
- {
- const Attr& q = p->getChildAt( j )->getAttr();
- for( sal_Int32 k=0; k<nAttributes; ++k )
- {
- const char* name = attr[k];
- OUString value = q.getValueByName( name );
- of.writeParameter("outline", name, value,
- sal::static_int_cast<sal_Int16>(i),
- sal::static_int_cast<sal_Int16>(j) );
- }
- }
- }
+ // hardcode number of attributes per level
+ const int nAttributes = 11;
+ const char* attr[ nAttributes ] =
+ {
+ "Prefix",
+ "NumType",
+ "Suffix",
+ "BulletChar",
+ "BulletFontName",
+ "ParentNumbering",
+ "LeftMargin",
+ "SymbolTextDistance",
+ "FirstLineOffset",
+ "Transliteration",
+ "NatNum",
+ };
- // verify that each style has the same number of levels.
- for( size_t i=0; i<nLevels.size(); i++ )
- {
- if( nLevels[0] != nLevels[i] )
- {
- incError( "Numbering levels don't match.");
- }
- }
+ // record each attribute of each level of each style in a static C++ variable.
+ // determine number of styles and number of levels per style on the fly.
+ sal_Int32 nStyles = getNumberOfChildren();
+ vector<sal_Int32> nLevels; // may be different for each style?
+ for( sal_Int32 i = 0; i < nStyles; i++ )
+ {
+ LocaleNode* p = getChildAt( i );
+ nLevels.push_back( p->getNumberOfChildren() );
+ for( sal_Int32 j=0; j<nLevels.back(); j++ )
+ {
+ const Attr& q = p->getChildAt( j )->getAttr();
+ for( sal_Int32 k=0; k<nAttributes; ++k )
+ {
+ const char* name = attr[k];
+ OUString value = q.getValueByName( name );
+ of.writeParameter("outline", name, value,
+ sal::static_int_cast<sal_Int16>(i),
+ sal::static_int_cast<sal_Int16>(j) );
+ }
+ }
+ }
- // record number of attributes, levels, and styles.
- of.writeAsciiString("static const sal_Int16 outlineNbOfStyles = ");
- of.writeInt( sal::static_int_cast<sal_Int16>( nStyles ) );
- of.writeAsciiString(";\n\n");
- of.writeAsciiString("static const sal_Int16 outlineNbOfLevelsPerStyle = ");
- of.writeInt( sal::static_int_cast<sal_Int16>( nLevels.back() ) );
- of.writeAsciiString(";\n\n");
- of.writeAsciiString("static const sal_Int16 outlineNbOfAttributesPerLevel = ");
- of.writeInt( nAttributes );
- of.writeAsciiString(";\n\n");
-
- // too complicated for now...
-// of.writeAsciiString("static const sal_Int16 nbOfOutlineNumberingLevels[] = { ");
-// for( sal_Int32 j=0; j<nStyles; j++ )
-// {
-// of.writeInt( nLevels[j] );
-// of.writeAsciiString(", ");
-// }
-// of.writeAsciiString("};\n\n");
-
-
- for( sal_Int32 i=0; i<nStyles; i++ )
- {
- for( sal_Int32 j=0; j<nLevels.back(); j++ )
- {
- of.writeAsciiString("static const sal_Unicode* outline");
- of.writeAsciiString("Style");
- of.writeInt( sal::static_int_cast<sal_Int16>(i) );
- of.writeAsciiString("Level");
- of.writeInt( sal::static_int_cast<sal_Int16>(j) );
- of.writeAsciiString("[] = { ");
-
- for( sal_Int32 k=0; k<nAttributes; k++ )
- {
- of.writeAsciiString( "outline" );
- of.writeAsciiString( attr[k] );
- of.writeInt( sal::static_int_cast<sal_Int16>(i) );
- of.writeInt( sal::static_int_cast<sal_Int16>(j) );
- of.writeAsciiString(", ");
- }
- of.writeAsciiString("NULL };\n");
- }
- }
+ // verify that each style has the same number of levels.
+ for( size_t i=0; i<nLevels.size(); i++ )
+ {
+ if( nLevels[0] != nLevels[i] )
+ {
+ incError( "Numbering levels don't match.");
+ }
+ }
- of.writeAsciiString("\n");
+ // record number of attributes, levels, and styles.
+ of.writeAsciiString("static const sal_Int16 outlineNbOfStyles = ");
+ of.writeInt( sal::static_int_cast<sal_Int16>( nStyles ) );
+ of.writeAsciiString(";\n\n");
+ of.writeAsciiString("static const sal_Int16 outlineNbOfLevelsPerStyle = ");
+ of.writeInt( sal::static_int_cast<sal_Int16>( nLevels.back() ) );
+ of.writeAsciiString(";\n\n");
+ of.writeAsciiString("static const sal_Int16 outlineNbOfAttributesPerLevel = ");
+ of.writeInt( nAttributes );
+ of.writeAsciiString(";\n\n");
+ // too complicated for now...
+ // of.writeAsciiString("static const sal_Int16 nbOfOutlineNumberingLevels[] = { ");
+ // for( sal_Int32 j=0; j<nStyles; j++ )
+ // {
+ // of.writeInt( nLevels[j] );
+ // of.writeAsciiString(", ");
+ // }
+ // of.writeAsciiString("};\n\n");
- for( sal_Int32 i=0; i<nStyles; i++ )
- {
- of.writeAsciiString("static const sal_Unicode** outline");
- of.writeAsciiString( "Style" );
- of.writeInt( sal::static_int_cast<sal_Int16>(i) );
- of.writeAsciiString("[] = { ");
-
- for( sal_Int32 j=0; j<nLevels.back(); j++ )
- {
- of.writeAsciiString("outlineStyle");
- of.writeInt( sal::static_int_cast<sal_Int16>(i) );
- of.writeAsciiString("Level");
- of.writeInt( sal::static_int_cast<sal_Int16>(j) );
- of.writeAsciiString(", ");
- }
- of.writeAsciiString("NULL };\n");
- }
- of.writeAsciiString("\n");
- of.writeAsciiString("static const sal_Unicode*** LCOutlineNumberingLevelsArray[] = {\n" );
- for( sal_Int32 i=0; i<nStyles; i++ )
- {
- of.writeAsciiString( "\t" );
- of.writeAsciiString( "outlineStyle" );
- of.writeInt( sal::static_int_cast<sal_Int16>(i) );
- of.writeAsciiString(",\n");
- }
- of.writeAsciiString("\tNULL\n};\n\n");
- of.writeFunction3("getOutlineNumberingLevels_", "outlineNbOfStyles", "outlineNbOfLevelsPerStyle",
+ for( sal_Int32 i=0; i<nStyles; i++ )
+ {
+ for( sal_Int32 j=0; j<nLevels.back(); j++ )
+ {
+ of.writeAsciiString("static const sal_Unicode* outline");
+ of.writeAsciiString("Style");
+ of.writeInt( sal::static_int_cast<sal_Int16>(i) );
+ of.writeAsciiString("Level");
+ of.writeInt( sal::static_int_cast<sal_Int16>(j) );
+ of.writeAsciiString("[] = { ");
+
+ for( sal_Int32 k=0; k<nAttributes; k++ )
+ {
+ of.writeAsciiString( "outline" );
+ of.writeAsciiString( attr[k] );
+ of.writeInt( sal::static_int_cast<sal_Int16>(i) );
+ of.writeInt( sal::static_int_cast<sal_Int16>(j) );
+ of.writeAsciiString(", ");
+ }
+ of.writeAsciiString("NULL };\n");
+ }
+ }
+
+ of.writeAsciiString("\n");
+
+
+ for( sal_Int32 i=0; i<nStyles; i++ )
+ {
+ of.writeAsciiString("static const sal_Unicode** outline");
+ of.writeAsciiString( "Style" );
+ of.writeInt( sal::static_int_cast<sal_Int16>(i) );
+ of.writeAsciiString("[] = { ");
+
+ for( sal_Int32 j=0; j<nLevels.back(); j++ )
+ {
+ of.writeAsciiString("outlineStyle");
+ of.writeInt( sal::static_int_cast<sal_Int16>(i) );
+ of.writeAsciiString("Level");
+ of.writeInt( sal::static_int_cast<sal_Int16>(j) );
+ of.writeAsciiString(", ");
+ }
+ of.writeAsciiString("NULL };\n");
+ }
+ of.writeAsciiString("\n");
+
+ of.writeAsciiString("static const sal_Unicode*** LCOutlineNumberingLevelsArray[] = {\n" );
+ for( sal_Int32 i=0; i<nStyles; i++ )
+ {
+ of.writeAsciiString( "\t" );
+ of.writeAsciiString( "outlineStyle" );
+ of.writeInt( sal::static_int_cast<sal_Int16>(i) );
+ of.writeAsciiString(",\n");
+ }
+ of.writeAsciiString("\tNULL\n};\n\n");
+ of.writeFunction3("getOutlineNumberingLevels_", "outlineNbOfStyles", "outlineNbOfLevelsPerStyle",
"outlineNbOfAttributesPerLevel", "LCOutlineNumberingLevelsArray");
}
commit 8616a33bc2b11cce4d581dc22893995726bcd197
Author: Eike Rathke <erack at redhat.com>
Date: Tue Sep 10 21:29:55 2013 +0200
accept also '-' as '_' in 'ref' attribute
Change-Id: Ibdd59bc92df0318829e7bca098f0e9ce2dfce695
diff --git a/i18npool/source/localedata/LocaleNode.cxx b/i18npool/source/localedata/LocaleNode.cxx
index b89a9ab..a4af95f 100644
--- a/i18npool/source/localedata/LocaleNode.cxx
+++ b/i18npool/source/localedata/LocaleNode.cxx
@@ -393,6 +393,7 @@ void LCCTYPENode::generateCode (const OFileWriter &of) const
const LocaleNode * sepNode = 0;
OUString useLocale = getAttr().getValueByName("ref");
if (!useLocale.isEmpty()) {
+ useLocale = useLocale.replace( '-', '_');
of.writeRefFunction("getLocaleItem_", useLocale);
return;
}
@@ -642,6 +643,7 @@ void LCFormatNode::generateCode (const OFileWriter &of) const
OUString useLocale = getAttr().getValueByName("ref");
if (!useLocale.isEmpty())
{
+ useLocale = useLocale.replace( '-', '_');
switch (mnSection)
{
case 0:
@@ -753,6 +755,7 @@ void LCFormatNode::generateCode (const OFileWriter &of) const
OUString aRef( pCtype->getAttr().getValueByName("ref"));
if (!aRef.isEmpty())
{
+ aRef = aRef.replace( '-', '_');
if (!bCtypeIsRef)
fprintf( stderr,
"Warning: Can't check separators used in FormatCode due to LC_CTYPE ref=\"%s\".\n"
@@ -1279,6 +1282,7 @@ void LCCollationNode::generateCode (const OFileWriter &of) const
{
OUString useLocale = getAttr().getValueByName("ref");
if (!useLocale.isEmpty()) {
+ useLocale = useLocale.replace( '-', '_');
of.writeRefFunction("getCollatorImplementation_", useLocale);
of.writeRefFunction("getCollationOptions_", useLocale);
return;
@@ -1352,6 +1356,7 @@ void LCSearchNode::generateCode (const OFileWriter &of) const
{
OUString useLocale = getAttr().getValueByName("ref");
if (!useLocale.isEmpty()) {
+ useLocale = useLocale.replace( '-', '_');
of.writeRefFunction("getSearchOptions_", useLocale);
return;
}
@@ -1390,6 +1395,7 @@ void LCIndexNode::generateCode (const OFileWriter &of) const
{
OUString useLocale = getAttr().getValueByName("ref");
if (!useLocale.isEmpty()) {
+ useLocale = useLocale.replace( '-', '_');
of.writeRefFunction("getIndexAlgorithm_", useLocale);
of.writeRefFunction("getUnicodeScripts_", useLocale);
of.writeRefFunction("getFollowPageWords_", useLocale);
@@ -1550,6 +1556,7 @@ void LCCalendarNode::generateCode (const OFileWriter &of) const
{
OUString useLocale = getAttr().getValueByName("ref");
if (!useLocale.isEmpty()) {
+ useLocale = useLocale.replace( '-', '_');
of.writeRefFunction("getAllCalendars_", useLocale);
return;
}
@@ -1581,6 +1588,7 @@ void LCCalendarNode::generateCode (const OFileWriter &of) const
const sal_Char *elementTag;
LocaleNode * daysNode = NULL;
OUString ref_name = calNode->getChildAt(nChild)->getAttr().getValueByName("ref");
+ ref_name = ref_name.replace( '-', '_');
if (!ref_name.isEmpty() && i > 0) {
for (j = 0; j < i; j++) {
str = getChildAt(j)->getAttr().getValueByName("unoid");
@@ -1613,6 +1621,7 @@ void LCCalendarNode::generateCode (const OFileWriter &of) const
// Generate Months of Year
LocaleNode * monthsNode = NULL;
ref_name = calNode->getChildAt(nChild)->getAttr().getValueByName("ref");
+ ref_name = ref_name.replace( '-', '_');
if (!ref_name.isEmpty() && i > 0) {
for (j = 0; j < i; j++) {
str = getChildAt(j)->getAttr().getValueByName("unoid");
@@ -1648,6 +1657,7 @@ void LCCalendarNode::generateCode (const OFileWriter &of) const
--nChild;
LocaleNode * genitiveMonthsNode = NULL;
ref_name = calNode->getChildAt(nChild)->getAttr().getValueByName("ref");
+ ref_name = ref_name.replace( '-', '_');
if (!ref_name.isEmpty() && i > 0) {
for (j = 0; j < i; j++) {
str = getChildAt(j)->getAttr().getValueByName("unoid");
@@ -1684,6 +1694,7 @@ void LCCalendarNode::generateCode (const OFileWriter &of) const
--nChild;
LocaleNode * partitiveMonthsNode = NULL;
ref_name = calNode->getChildAt(nChild)->getAttr().getValueByName("ref");
+ ref_name = ref_name.replace( '-', '_');
if (!ref_name.isEmpty() && i > 0) {
for (j = 0; j < i; j++) {
str = getChildAt(j)->getAttr().getValueByName("unoid");
@@ -1716,6 +1727,7 @@ void LCCalendarNode::generateCode (const OFileWriter &of) const
// Generate Era name
LocaleNode * erasNode = NULL;
ref_name = calNode -> getChildAt(nChild) ->getAttr().getValueByName("ref");
+ ref_name = ref_name.replace( '-', '_');
if (!ref_name.isEmpty() && i > 0) {
for (j = 0; j < i; j++) {
str = getChildAt(j)->getAttr().getValueByName("unoid");
@@ -1865,6 +1877,7 @@ void LCCurrencyNode :: generateCode (const OFileWriter &of) const
{
OUString useLocale = getAttr().getValueByName("ref");
if (!useLocale.isEmpty()) {
+ useLocale = useLocale.replace( '-', '_');
of.writeRefFunction("getAllCurrencies_", useLocale);
return;
}
@@ -1966,6 +1979,7 @@ void LCTransliterationNode::generateCode (const OFileWriter &of) const
{
OUString useLocale = getAttr().getValueByName("ref");
if (!useLocale.isEmpty()) {
+ useLocale = useLocale.replace( '-', '_');
of.writeRefFunction("getTransliterations_", useLocale);
return;
}
@@ -2015,6 +2029,7 @@ void LCMiscNode::generateCode (const OFileWriter &of) const
{
OUString useLocale = getAttr().getValueByName("ref");
if (!useLocale.isEmpty()) {
+ useLocale = useLocale.replace( '-', '_');
of.writeRefFunction("getForbiddenCharacters_", useLocale);
of.writeRefFunction("getBreakIteratorRules_", useLocale);
of.writeRefFunction("getReservedWords_", useLocale);
@@ -2112,6 +2127,7 @@ void LCNumberingLevelNode::generateCode (const OFileWriter &of) const
of.writeAsciiString("// ---> ContinuousNumbering\n");
OUString useLocale = getAttr().getValueByName("ref");
if (!useLocale.isEmpty()) {
+ useLocale = useLocale.replace( '-', '_');
of.writeRefFunction2("getContinuousNumberingLevels_", useLocale);
return;
}
@@ -2182,6 +2198,7 @@ void LCOutlineNumberingLevelNode::generateCode (const OFileWriter &of) const
of.writeAsciiString("// ---> OutlineNumbering\n");
OUString useLocale = getAttr().getValueByName("ref");
if (!useLocale.isEmpty()) {
+ useLocale = useLocale.replace( '-', '_');
of.writeRefFunction3("getOutlineNumberingLevels_", useLocale);
return;
}
commit 0517ec8f6bc2da8cac819aab714da30531feeabc
Author: Eike Rathke <erack at redhat.com>
Date: Tue Sep 10 21:03:04 2013 +0200
corrected check of Variant '-'
Change-Id: Ic134fe541e21c905590294ffb1ed4fed34aabd63
diff --git a/i18npool/source/localedata/LocaleNode.cxx b/i18npool/source/localedata/LocaleNode.cxx
index 1c654b0..b89a9ab 100644
--- a/i18npool/source/localedata/LocaleNode.cxx
+++ b/i18npool/source/localedata/LocaleNode.cxx
@@ -366,7 +366,7 @@ void LCInfoNode::generateCode (const OFileWriter &of) const
{
// If given Variant must be at least ll-Ssss and language must be 'qlt'
OUString aVariant( variantNode->getValue());
- if (!(aVariant.isEmpty() || (aVariant.getLength() >= 7 && aVariant.indexOf('-'))))
+ if (!(aVariant.isEmpty() || (aVariant.getLength() >= 7 && aVariant.indexOf('-') >= 2)))
incErrorStr( "invalid Variant", aVariant);
if (!(aVariant.isEmpty() || aLanguage == "qlt"))
incErrorStrStr( "Variant '%s' given but Language '%s' is not 'qlt'", aVariant, aLanguage);
commit e4c204bdbf5d67be2242301ae380789097cfc7f6
Author: Eike Rathke <erack at redhat.com>
Date: Tue Sep 10 20:15:44 2013 +0200
added ca-ES-valencia fallback to ca-XV fallback strings
Change-Id: Iedc5924cf5100a2e7d014be68dc4897d3c0e76a0
diff --git a/i18nlangtag/qa/cppunit/test_languagetag.cxx b/i18nlangtag/qa/cppunit/test_languagetag.cxx
index f3cea3a..aace20a 100644
--- a/i18nlangtag/qa/cppunit/test_languagetag.cxx
+++ b/i18nlangtag/qa/cppunit/test_languagetag.cxx
@@ -210,9 +210,12 @@ void TestLanguageTag::testAllTags()
CPPUNIT_ASSERT( ca_XV.getScript() == "" );
CPPUNIT_ASSERT( ca_XV.getLanguageAndScript() == "ca" );
::std::vector< OUString > ca_XV_Fallbacks( ca_XV.getFallbackStrings( true));
- CPPUNIT_ASSERT( ca_XV_Fallbacks.size() == 2);
+ CPPUNIT_ASSERT( ca_XV_Fallbacks.size() == 5);
CPPUNIT_ASSERT( ca_XV_Fallbacks[0] == "ca-XV");
- CPPUNIT_ASSERT( ca_XV_Fallbacks[1] == "ca");
+ CPPUNIT_ASSERT( ca_XV_Fallbacks[1] == "ca-ES-valencia");
+ CPPUNIT_ASSERT( ca_XV_Fallbacks[2] == "ca-valencia");
+ CPPUNIT_ASSERT( ca_XV_Fallbacks[3] == "ca-ES");
+ CPPUNIT_ASSERT( ca_XV_Fallbacks[4] == "ca");
CPPUNIT_ASSERT( ca_XV.makeFallback().getBcp47() == "ca-ES-valencia");
}
diff --git a/i18nlangtag/source/languagetag/languagetag.cxx b/i18nlangtag/source/languagetag/languagetag.cxx
index b356833..3e1b331 100644
--- a/i18nlangtag/source/languagetag/languagetag.cxx
+++ b/i18nlangtag/source/languagetag/languagetag.cxx
@@ -1237,8 +1237,16 @@ LanguageTag & LanguageTag::makeFallback()
aVec.push_back( aLanguage + "-TW");
else if (aCountry != "CN")
aVec.push_back( aLanguage + "-CN");
+ aVec.push_back( aLanguage);
}
- aVec.push_back( aLanguage);
+ else if (aLanguage == "ca" && aCountry == "XV")
+ {
+ ::std::vector< OUString > aCav( LanguageTag( "ca-ES-valencia").getFallbackStrings( true));
+ aVec.insert( aVec.end(), aCav.begin(), aCav.end());
+ // Already includes 'ca' language fallback.
+ }
+ else
+ aVec.push_back( aLanguage);
}
else if (bIncludeFullBcp47)
aVec.push_back( aLanguage);
commit c9489f68e8d805376cfbfb67b84ccbc250788773
Author: Eike Rathke <erack at redhat.com>
Date: Tue Sep 10 19:42:01 2013 +0200
added overrides for fallbacks of legacy codes
Change-Id: I62be84904b3f0f4beeda35e78906604090eefa86
diff --git a/i18nlangtag/qa/cppunit/test_languagetag.cxx b/i18nlangtag/qa/cppunit/test_languagetag.cxx
index 5ddc9b8..f3cea3a 100644
--- a/i18nlangtag/qa/cppunit/test_languagetag.cxx
+++ b/i18nlangtag/qa/cppunit/test_languagetag.cxx
@@ -194,6 +194,29 @@ void TestLanguageTag::testAllTags()
}
{
+ OUString s_ca_XV( "ca-XV" );
+ LanguageTag ca_XV( s_ca_XV, true );
+ lang::Locale aLocale = ca_XV.getLocale();
+ CPPUNIT_ASSERT( ca_XV.getBcp47() == s_ca_XV );
+ CPPUNIT_ASSERT( aLocale.Language == "ca" );
+ CPPUNIT_ASSERT( aLocale.Country == "XV" );
+ CPPUNIT_ASSERT( aLocale.Variant == "" );
+ CPPUNIT_ASSERT( ca_XV.getLanguageType() == LANGUAGE_CATALAN_VALENCIAN );
+ CPPUNIT_ASSERT( ca_XV.isValidBcp47() == true );
+ CPPUNIT_ASSERT( ca_XV.isIsoLocale() == true );
+ CPPUNIT_ASSERT( ca_XV.isIsoODF() == true );
+ CPPUNIT_ASSERT( ca_XV.getLanguage() == "ca" );
+ CPPUNIT_ASSERT( ca_XV.getCountry() == "XV" );
+ CPPUNIT_ASSERT( ca_XV.getScript() == "" );
+ CPPUNIT_ASSERT( ca_XV.getLanguageAndScript() == "ca" );
+ ::std::vector< OUString > ca_XV_Fallbacks( ca_XV.getFallbackStrings( true));
+ CPPUNIT_ASSERT( ca_XV_Fallbacks.size() == 2);
+ CPPUNIT_ASSERT( ca_XV_Fallbacks[0] == "ca-XV");
+ CPPUNIT_ASSERT( ca_XV_Fallbacks[1] == "ca");
+ CPPUNIT_ASSERT( ca_XV.makeFallback().getBcp47() == "ca-ES-valencia");
+ }
+
+ {
OUString s_de_DE( "de-DE" );
LanguageTag de_DE( s_de_DE, true );
lang::Locale aLocale = de_DE.getLocale();
diff --git a/i18nlangtag/source/isolang/isolang.cxx b/i18nlangtag/source/isolang/isolang.cxx
index 4e9a343..74eb737 100644
--- a/i18nlangtag/source/isolang/isolang.cxx
+++ b/i18nlangtag/source/isolang/isolang.cxx
@@ -34,6 +34,9 @@ struct IsoLanguageCountryEntry
LanguageType mnLang;
sal_Char maLanguage[4];
sal_Char maCountry[3];
+ /** If TRUE, a higher (! else infinite recursion occurs!) level override
+ with the same mnLang (!) exists that should be used instead. */
+ bool mbOverrideExists;
/** Obtain a language tag string with '-' separator. */
OUString getTagString() const;
@@ -140,434 +143,434 @@ struct IsoLangOtherEntry
static IsoLanguageCountryEntry const aImplIsoLangEntries[] =
{
// MS-LANGID codes ISO639-1/2/3 ISO3166
- { LANGUAGE_ENGLISH, "en", "" },
- { LANGUAGE_ENGLISH_US, "en", "US" },
- { LANGUAGE_ENGLISH_UK, "en", "GB" },
- { LANGUAGE_ENGLISH_AUS, "en", "AU" },
- { LANGUAGE_ENGLISH_CAN, "en", "CA" },
- { LANGUAGE_FRENCH, "fr", "FR" },
- { LANGUAGE_GERMAN, "de", "DE" },
- { LANGUAGE_ITALIAN, "it", "IT" },
- { LANGUAGE_DUTCH, "nl", "NL" },
- { LANGUAGE_SPANISH_MODERN, "es", "ES" },
- { LANGUAGE_SPANISH_DATED, "es", "ES" },
- { LANGUAGE_PORTUGUESE, "pt", "PT" },
- { LANGUAGE_PORTUGUESE_BRAZILIAN, "pt", "BR" },
- { LANGUAGE_DANISH, "da", "DK" },
- { LANGUAGE_GREEK, "el", "GR" },
- { LANGUAGE_CHINESE_SIMPLIFIED, "zh", "CN" },
- { LANGUAGE_CHINESE_SIMPLIFIED_LEGACY, "zh", "CN" },
- { LANGUAGE_CHINESE_TRADITIONAL, "zh", "TW" },
- { LANGUAGE_CHINESE_TRADITIONAL_LEGACY, "zh", "TW" },
- { LANGUAGE_CHINESE_HONGKONG, "zh", "HK" },
- { LANGUAGE_CHINESE_SINGAPORE, "zh", "SG" },
- { LANGUAGE_CHINESE_MACAU, "zh", "MO" },
- { LANGUAGE_ENGLISH_HONG_KONG_SAR, "en", "HK" },
- { LANGUAGE_JAPANESE, "ja", "JP" },
- { LANGUAGE_KOREAN, "ko", "KR" },
- { LANGUAGE_KOREAN_JOHAB, "ko", "KR" },
- { LANGUAGE_USER_KOREAN_NORTH, "ko", "KP" },
- { LANGUAGE_SWEDISH, "sv", "SE" },
- { LANGUAGE_SWEDISH_FINLAND, "sv", "FI" },
- { LANGUAGE_FINNISH, "fi", "FI" },
- { LANGUAGE_RUSSIAN, "ru", "RU" },
- { LANGUAGE_TATAR, "tt", "RU" },
- { LANGUAGE_ENGLISH_NZ, "en", "NZ" },
- { LANGUAGE_ENGLISH_EIRE, "en", "IE" },
- { LANGUAGE_DUTCH_BELGIAN, "nl", "BE" },
- { LANGUAGE_FRENCH_BELGIAN, "fr", "BE" },
- { LANGUAGE_FRENCH_CANADIAN, "fr", "CA" },
- { LANGUAGE_FRENCH_SWISS, "fr", "CH" },
- { LANGUAGE_GERMAN_SWISS, "de", "CH" },
- { LANGUAGE_GERMAN_AUSTRIAN, "de", "AT" },
- { LANGUAGE_ITALIAN_SWISS, "it", "CH" },
- { LANGUAGE_ALBANIAN, "sq", "AL" },
- { LANGUAGE_ARABIC_SAUDI_ARABIA, "ar", "SA" },
- { LANGUAGE_ARABIC_EGYPT, "ar", "EG" },
- { LANGUAGE_ARABIC_UAE, "ar", "AE" },
- { LANGUAGE_ARABIC_IRAQ, "ar", "IQ" },
- { LANGUAGE_ARABIC_LIBYA, "ar", "LY" },
- { LANGUAGE_ARABIC_ALGERIA, "ar", "DZ" },
- { LANGUAGE_ARABIC_MOROCCO, "ar", "MA" },
- { LANGUAGE_ARABIC_TUNISIA, "ar", "TN" },
- { LANGUAGE_ARABIC_OMAN, "ar", "OM" },
- { LANGUAGE_ARABIC_YEMEN, "ar", "YE" },
- { LANGUAGE_ARABIC_SYRIA, "ar", "SY" },
- { LANGUAGE_ARABIC_JORDAN, "ar", "JO" },
- { LANGUAGE_ARABIC_LEBANON, "ar", "LB" },
- { LANGUAGE_ARABIC_KUWAIT, "ar", "KW" },
- { LANGUAGE_ARABIC_BAHRAIN, "ar", "BH" },
- { LANGUAGE_ARABIC_QATAR, "ar", "QA" },
- { LANGUAGE_USER_ARABIC_CHAD, "ar", "TD" },
- { LANGUAGE_USER_ARABIC_COMOROS, "ar", "KM" },
- { LANGUAGE_USER_ARABIC_DJIBOUTI, "ar", "DJ" },
- { LANGUAGE_USER_ARABIC_ERITREA, "ar", "ER" },
- { LANGUAGE_USER_ARABIC_ISRAEL, "ar", "IL" },
- { LANGUAGE_USER_ARABIC_MAURITANIA, "ar", "MR" },
- { LANGUAGE_USER_ARABIC_PALESTINE, "ar", "PS" },
- { LANGUAGE_USER_ARABIC_SOMALIA, "ar", "SO" },
- { LANGUAGE_USER_ARABIC_SUDAN, "ar", "SD" },
- { LANGUAGE_ARABIC_PRIMARY_ONLY, "ar", "" },
- { LANGUAGE_BASQUE, "eu", "" },
- { LANGUAGE_BULGARIAN, "bg", "BG" },
- { LANGUAGE_CZECH, "cs", "CZ" },
- { LANGUAGE_CZECH, "cz", "" },
- { LANGUAGE_ENGLISH_JAMAICA, "en", "JM" },
- { LANGUAGE_ENGLISH_CARRIBEAN, "en", "BS" }, // not 100%, because AG is Bahamas
- { LANGUAGE_ENGLISH_BELIZE, "en", "BZ" },
- { LANGUAGE_ENGLISH_TRINIDAD, "en", "TT" },
- { LANGUAGE_ENGLISH_ZIMBABWE, "en", "ZW" },
- { LANGUAGE_ENGLISH_INDONESIA, "en", "ID" },
- { LANGUAGE_ESTONIAN, "et", "EE" },
- { LANGUAGE_FAEROESE, "fo", "FO" },
- { LANGUAGE_FARSI, "fa", "IR" },
- { LANGUAGE_FRENCH_LUXEMBOURG, "fr", "LU" },
- { LANGUAGE_FRENCH_MONACO, "fr", "MC" },
- { LANGUAGE_GERMAN_LUXEMBOURG, "de", "LU" },
- { LANGUAGE_GERMAN_LIECHTENSTEIN, "de", "LI" },
- { LANGUAGE_HEBREW, "he", "IL" }, // new: old was "iw"
- { LANGUAGE_HEBREW, "iw", "IL" }, // old: new is "he"
- { LANGUAGE_HUNGARIAN, "hu", "HU" },
- { LANGUAGE_ICELANDIC, "is", "IS" },
- { LANGUAGE_INDONESIAN, "id", "ID" }, // new: old was "in"
- { LANGUAGE_INDONESIAN, "in", "ID" }, // old: new is "id"
- { LANGUAGE_NORWEGIAN, "no", "NO" },
- { LANGUAGE_NORWEGIAN_BOKMAL, "nb", "NO" },
- { LANGUAGE_NORWEGIAN_NYNORSK, "nn", "NO" },
- { LANGUAGE_POLISH, "pl", "PL" },
- { LANGUAGE_RHAETO_ROMAN, "rm", "CH" },
- { LANGUAGE_ROMANIAN, "ro", "RO" },
- { LANGUAGE_ROMANIAN_MOLDOVA, "ro", "MD" },
- { LANGUAGE_SLOVAK, "sk", "SK" },
- { LANGUAGE_SLOVENIAN, "sl", "SI" },
- { LANGUAGE_SPANISH_MEXICAN, "es", "MX" },
- { LANGUAGE_SPANISH_GUATEMALA, "es", "GT" },
- { LANGUAGE_SPANISH_COSTARICA, "es", "CR" },
- { LANGUAGE_SPANISH_PANAMA, "es", "PA" },
- { LANGUAGE_SPANISH_DOMINICAN_REPUBLIC, "es", "DO" },
- { LANGUAGE_SPANISH_VENEZUELA, "es", "VE" },
- { LANGUAGE_SPANISH_COLOMBIA, "es", "CO" },
- { LANGUAGE_SPANISH_PERU, "es", "PE" },
- { LANGUAGE_SPANISH_ARGENTINA, "es", "AR" },
- { LANGUAGE_SPANISH_ECUADOR, "es", "EC" },
- { LANGUAGE_SPANISH_CHILE, "es", "CL" },
- { LANGUAGE_SPANISH_URUGUAY, "es", "UY" },
- { LANGUAGE_SPANISH_PARAGUAY, "es", "PY" },
- { LANGUAGE_SPANISH_BOLIVIA, "es", "BO" },
- { LANGUAGE_SPANISH_EL_SALVADOR, "es", "SV" },
- { LANGUAGE_SPANISH_HONDURAS, "es", "HN" },
- { LANGUAGE_SPANISH_NICARAGUA, "es", "NI" },
- { LANGUAGE_SPANISH_PUERTO_RICO, "es", "PR" },
- { LANGUAGE_SPANISH_UNITED_STATES, "es", "US" },
- { LANGUAGE_SPANISH_LATIN_AMERICA, "es", "" },
- { LANGUAGE_TURKISH, "tr", "TR" },
- { LANGUAGE_UKRAINIAN, "uk", "UA" },
- { LANGUAGE_VIETNAMESE, "vi", "VN" },
- { LANGUAGE_LATVIAN, "lv", "LV" },
- { LANGUAGE_MACEDONIAN, "mk", "MK" },
- { LANGUAGE_MALAY_MALAYSIA, "ms", "MY" },
- { LANGUAGE_MALAY_BRUNEI_DARUSSALAM, "ms", "BN" },
- { LANGUAGE_ENGLISH_MALAYSIA, "en", "MY" },
- { LANGUAGE_THAI, "th", "TH" },
- { LANGUAGE_LITHUANIAN, "lt", "LT" },
- { LANGUAGE_LITHUANIAN_CLASSIC, "lt", "LT" },
- { LANGUAGE_CROATIAN, "hr", "HR" }, // Croatian in Croatia
- { LANGUAGE_CROATIAN_BOSNIA_HERZEGOVINA, "hr", "BA" },
- { LANGUAGE_BOSNIAN_LATIN_BOSNIA_HERZEGOVINA, "bs", "BA" },
-// { LANGUAGE_BOSNIAN_CYRILLIC_BOSNIA_AND_HERZEGOVINA, "bs", "BA" }, // script codes not supported yet
- { LANGUAGE_USER_SERBIAN_CYRILLIC_SERBIA, "sr", "RS" }, // Serbian Cyrillic in Serbia
- { LANGUAGE_SERBIAN_CYRILLIC, "sr", "YU" }, // legacy Serbian Cyrillic in Serbia and Montenegro (former Yugoslavia); kludge, needed to be sr_CS instead, sr_CS not supported by ICU 2.6 (3.4 does)
- { LANGUAGE_SERBIAN_CYRILLIC, "sr", "CS" }, // alias to be able to integrate localizations, rsc needs it
- { LANGUAGE_USER_SERBIAN_CYRILLIC_MONTENEGRO, "sr", "ME" },
- { LANGUAGE_SERBIAN_CYRILLIC_BOSNIA_HERZEGOVINA, "sr", "BA" },
- { LANGUAGE_USER_SERBIAN_LATIN_SERBIA, "sh", "RS" }, // Serbian Latin in Serbia; kludge, needed to be sr_Latn_RS instead, script codes not supported yet
- { LANGUAGE_SERBIAN_LATIN, "sh", "YU" }, // legacy Serbian Latin in Serbia and Montenegro (former Yugoslavia); kludge, needed to be sr_Latn_CS instead, script codes not supported yet
- { LANGUAGE_SERBIAN_LATIN, "sh", "CS" }, // Serbian Latin in Serbia and Montenegro; kludge, needed to be sr_Latn_CS instead, script codes not supported yet
- { LANGUAGE_USER_SERBIAN_LATIN_MONTENEGRO, "sh", "ME" }, // Serbian Latin in Montenegro; kludge, needed to be sr_Latn_ME instead, script codes not supported yet
- { LANGUAGE_SERBIAN_LATIN_BOSNIA_HERZEGOVINA, "sh", "BA" },
- { LANGUAGE_SERBIAN_LATIN_NEUTRAL, "sh", "" }, // kludge, needed to be sr_Latn instead, script codes not supported yet
- { LANGUAGE_ARMENIAN, "hy", "AM" },
- { LANGUAGE_AZERI_LATIN, "az", "AZ" },
-// { LANGUAGE_AZERI_CYRILLIC, "az", "AZ" }, // script codes not supported yet
- { LANGUAGE_UZBEK_LATIN, "uz", "UZ" },
-// { LANGUAGE_UZBEK_CYRILLIC, "uz", "UZ" }, // script codes not supported yet
- { LANGUAGE_BENGALI_BANGLADESH, "bn", "BD" },
- { LANGUAGE_BENGALI, "bn", "IN" },
- { LANGUAGE_BURMESE, "my", "MM" },
- { LANGUAGE_KAZAKH, "kk", "KZ" },
- { LANGUAGE_ENGLISH_INDIA, "en", "IN" },
- { LANGUAGE_URDU_INDIA, "ur", "IN" },
- { LANGUAGE_URDU_PAKISTAN, "ur", "PK" },
- { LANGUAGE_HINDI, "hi", "IN" },
- { LANGUAGE_GUJARATI, "gu", "IN" },
- { LANGUAGE_KANNADA, "kn", "IN" },
- { LANGUAGE_ASSAMESE, "as", "IN" },
- { LANGUAGE_KASHMIRI_INDIA, "ks", "IN" },
- { LANGUAGE_KASHMIRI, "ks", "" }, // Kashmiri in "Jammu and Kashmir" ... no ISO3166 code for that
- { LANGUAGE_MALAYALAM, "ml", "IN" },
- { LANGUAGE_MANIPURI, "mni", "IN" },
- { LANGUAGE_MARATHI, "mr", "IN" },
- { LANGUAGE_KONKANI, "kok", "IN" },
- { LANGUAGE_NEPALI, "ne", "NP" },
- { LANGUAGE_NEPALI_INDIA, "ne", "IN" },
- { LANGUAGE_ORIYA, "or", "IN" },
- { LANGUAGE_PUNJABI, "pa", "IN" },
- { LANGUAGE_SANSKRIT, "sa", "IN" },
- { LANGUAGE_SINDHI, "sd", "IN" },
- { LANGUAGE_TAMIL, "ta", "IN" },
- { LANGUAGE_TELUGU, "te", "IN" },
- { LANGUAGE_PUNJABI_PAKISTAN, "lah", "PK" }, // preferring "lah" over "pa" for Western Punjabi, see http://www.ethnologue.com/show_language.asp?code=PNB
- { LANGUAGE_PUNJABI_PAKISTAN, "pa", "PK" },
- { LANGUAGE_SINDHI_PAKISTAN, "sd", "PK" },
- { LANGUAGE_BELARUSIAN, "be", "BY" },
- { LANGUAGE_CATALAN, "ca", "ES" }, // Spain (default)
- { LANGUAGE_CATALAN, "ca", "AD" }, // Andorra
+ { LANGUAGE_ENGLISH, "en", "" , false },
+ { LANGUAGE_ENGLISH_US, "en", "US", false },
+ { LANGUAGE_ENGLISH_UK, "en", "GB", false },
+ { LANGUAGE_ENGLISH_AUS, "en", "AU", false },
+ { LANGUAGE_ENGLISH_CAN, "en", "CA", false },
+ { LANGUAGE_FRENCH, "fr", "FR", false },
+ { LANGUAGE_GERMAN, "de", "DE", false },
+ { LANGUAGE_ITALIAN, "it", "IT", false },
+ { LANGUAGE_DUTCH, "nl", "NL", false },
+ { LANGUAGE_SPANISH_MODERN, "es", "ES", false },
+ { LANGUAGE_SPANISH_DATED, "es", "ES", false },
+ { LANGUAGE_PORTUGUESE, "pt", "PT", false },
+ { LANGUAGE_PORTUGUESE_BRAZILIAN, "pt", "BR", false },
+ { LANGUAGE_DANISH, "da", "DK", false },
+ { LANGUAGE_GREEK, "el", "GR", false },
+ { LANGUAGE_CHINESE_SIMPLIFIED, "zh", "CN", false },
+ { LANGUAGE_CHINESE_SIMPLIFIED_LEGACY, "zh", "CN", false },
+ { LANGUAGE_CHINESE_TRADITIONAL, "zh", "TW", false },
+ { LANGUAGE_CHINESE_TRADITIONAL_LEGACY, "zh", "TW", false },
+ { LANGUAGE_CHINESE_HONGKONG, "zh", "HK", false },
+ { LANGUAGE_CHINESE_SINGAPORE, "zh", "SG", false },
+ { LANGUAGE_CHINESE_MACAU, "zh", "MO", false },
+ { LANGUAGE_ENGLISH_HONG_KONG_SAR, "en", "HK", false },
+ { LANGUAGE_JAPANESE, "ja", "JP", false },
+ { LANGUAGE_KOREAN, "ko", "KR", false },
+ { LANGUAGE_KOREAN_JOHAB, "ko", "KR", false },
+ { LANGUAGE_USER_KOREAN_NORTH, "ko", "KP", false },
+ { LANGUAGE_SWEDISH, "sv", "SE", false },
+ { LANGUAGE_SWEDISH_FINLAND, "sv", "FI", false },
+ { LANGUAGE_FINNISH, "fi", "FI", false },
+ { LANGUAGE_RUSSIAN, "ru", "RU", false },
+ { LANGUAGE_TATAR, "tt", "RU", false },
+ { LANGUAGE_ENGLISH_NZ, "en", "NZ", false },
+ { LANGUAGE_ENGLISH_EIRE, "en", "IE", false },
+ { LANGUAGE_DUTCH_BELGIAN, "nl", "BE", false },
+ { LANGUAGE_FRENCH_BELGIAN, "fr", "BE", false },
+ { LANGUAGE_FRENCH_CANADIAN, "fr", "CA", false },
+ { LANGUAGE_FRENCH_SWISS, "fr", "CH", false },
+ { LANGUAGE_GERMAN_SWISS, "de", "CH", false },
+ { LANGUAGE_GERMAN_AUSTRIAN, "de", "AT", false },
+ { LANGUAGE_ITALIAN_SWISS, "it", "CH", false },
+ { LANGUAGE_ALBANIAN, "sq", "AL", false },
+ { LANGUAGE_ARABIC_SAUDI_ARABIA, "ar", "SA", false },
+ { LANGUAGE_ARABIC_EGYPT, "ar", "EG", false },
+ { LANGUAGE_ARABIC_UAE, "ar", "AE", false },
+ { LANGUAGE_ARABIC_IRAQ, "ar", "IQ", false },
+ { LANGUAGE_ARABIC_LIBYA, "ar", "LY", false },
+ { LANGUAGE_ARABIC_ALGERIA, "ar", "DZ", false },
+ { LANGUAGE_ARABIC_MOROCCO, "ar", "MA", false },
+ { LANGUAGE_ARABIC_TUNISIA, "ar", "TN", false },
+ { LANGUAGE_ARABIC_OMAN, "ar", "OM", false },
+ { LANGUAGE_ARABIC_YEMEN, "ar", "YE", false },
+ { LANGUAGE_ARABIC_SYRIA, "ar", "SY", false },
+ { LANGUAGE_ARABIC_JORDAN, "ar", "JO", false },
+ { LANGUAGE_ARABIC_LEBANON, "ar", "LB", false },
+ { LANGUAGE_ARABIC_KUWAIT, "ar", "KW", false },
+ { LANGUAGE_ARABIC_BAHRAIN, "ar", "BH", false },
+ { LANGUAGE_ARABIC_QATAR, "ar", "QA", false },
+ { LANGUAGE_USER_ARABIC_CHAD, "ar", "TD", false },
+ { LANGUAGE_USER_ARABIC_COMOROS, "ar", "KM", false },
+ { LANGUAGE_USER_ARABIC_DJIBOUTI, "ar", "DJ", false },
+ { LANGUAGE_USER_ARABIC_ERITREA, "ar", "ER", false },
+ { LANGUAGE_USER_ARABIC_ISRAEL, "ar", "IL", false },
+ { LANGUAGE_USER_ARABIC_MAURITANIA, "ar", "MR", false },
+ { LANGUAGE_USER_ARABIC_PALESTINE, "ar", "PS", false },
+ { LANGUAGE_USER_ARABIC_SOMALIA, "ar", "SO", false },
+ { LANGUAGE_USER_ARABIC_SUDAN, "ar", "SD", false },
+ { LANGUAGE_ARABIC_PRIMARY_ONLY, "ar", "" , false },
+ { LANGUAGE_BASQUE, "eu", "" , false },
+ { LANGUAGE_BULGARIAN, "bg", "BG", false },
+ { LANGUAGE_CZECH, "cs", "CZ", false },
+ { LANGUAGE_CZECH, "cz", "" , false },
+ { LANGUAGE_ENGLISH_JAMAICA, "en", "JM", false },
+ { LANGUAGE_ENGLISH_CARRIBEAN, "en", "BS", false }, // not 100%, because AG is Bahamas
+ { LANGUAGE_ENGLISH_BELIZE, "en", "BZ", false },
+ { LANGUAGE_ENGLISH_TRINIDAD, "en", "TT", false },
+ { LANGUAGE_ENGLISH_ZIMBABWE, "en", "ZW", false },
+ { LANGUAGE_ENGLISH_INDONESIA, "en", "ID", false },
+ { LANGUAGE_ESTONIAN, "et", "EE", false },
+ { LANGUAGE_FAEROESE, "fo", "FO", false },
+ { LANGUAGE_FARSI, "fa", "IR", false },
+ { LANGUAGE_FRENCH_LUXEMBOURG, "fr", "LU", false },
+ { LANGUAGE_FRENCH_MONACO, "fr", "MC", false },
+ { LANGUAGE_GERMAN_LUXEMBOURG, "de", "LU", false },
+ { LANGUAGE_GERMAN_LIECHTENSTEIN, "de", "LI", false },
+ { LANGUAGE_HEBREW, "he", "IL", false }, // new: old was "iw"
+ { LANGUAGE_HEBREW, "iw", "IL", false }, // old: new is "he"
+ { LANGUAGE_HUNGARIAN, "hu", "HU", false },
+ { LANGUAGE_ICELANDIC, "is", "IS", false },
+ { LANGUAGE_INDONESIAN, "id", "ID", false }, // new: old was "in"
+ { LANGUAGE_INDONESIAN, "in", "ID", false }, // old: new is "id"
+ { LANGUAGE_NORWEGIAN, "no", "NO", false },
+ { LANGUAGE_NORWEGIAN_BOKMAL, "nb", "NO", false },
+ { LANGUAGE_NORWEGIAN_NYNORSK, "nn", "NO", false },
+ { LANGUAGE_POLISH, "pl", "PL", false },
+ { LANGUAGE_RHAETO_ROMAN, "rm", "CH", false },
+ { LANGUAGE_ROMANIAN, "ro", "RO", false },
+ { LANGUAGE_ROMANIAN_MOLDOVA, "ro", "MD", false },
+ { LANGUAGE_SLOVAK, "sk", "SK", false },
+ { LANGUAGE_SLOVENIAN, "sl", "SI", false },
+ { LANGUAGE_SPANISH_MEXICAN, "es", "MX", false },
+ { LANGUAGE_SPANISH_GUATEMALA, "es", "GT", false },
+ { LANGUAGE_SPANISH_COSTARICA, "es", "CR", false },
+ { LANGUAGE_SPANISH_PANAMA, "es", "PA", false },
+ { LANGUAGE_SPANISH_DOMINICAN_REPUBLIC, "es", "DO", false },
+ { LANGUAGE_SPANISH_VENEZUELA, "es", "VE", false },
+ { LANGUAGE_SPANISH_COLOMBIA, "es", "CO", false },
+ { LANGUAGE_SPANISH_PERU, "es", "PE", false },
+ { LANGUAGE_SPANISH_ARGENTINA, "es", "AR", false },
+ { LANGUAGE_SPANISH_ECUADOR, "es", "EC", false },
+ { LANGUAGE_SPANISH_CHILE, "es", "CL", false },
+ { LANGUAGE_SPANISH_URUGUAY, "es", "UY", false },
+ { LANGUAGE_SPANISH_PARAGUAY, "es", "PY", false },
+ { LANGUAGE_SPANISH_BOLIVIA, "es", "BO", false },
+ { LANGUAGE_SPANISH_EL_SALVADOR, "es", "SV", false },
+ { LANGUAGE_SPANISH_HONDURAS, "es", "HN", false },
+ { LANGUAGE_SPANISH_NICARAGUA, "es", "NI", false },
+ { LANGUAGE_SPANISH_PUERTO_RICO, "es", "PR", false },
+ { LANGUAGE_SPANISH_UNITED_STATES, "es", "US", false },
+ { LANGUAGE_SPANISH_LATIN_AMERICA, "es", "" , false },
+ { LANGUAGE_TURKISH, "tr", "TR", false },
+ { LANGUAGE_UKRAINIAN, "uk", "UA", false },
+ { LANGUAGE_VIETNAMESE, "vi", "VN", false },
+ { LANGUAGE_LATVIAN, "lv", "LV", false },
+ { LANGUAGE_MACEDONIAN, "mk", "MK", false },
+ { LANGUAGE_MALAY_MALAYSIA, "ms", "MY", false },
+ { LANGUAGE_MALAY_BRUNEI_DARUSSALAM, "ms", "BN", false },
+ { LANGUAGE_ENGLISH_MALAYSIA, "en", "MY", false },
+ { LANGUAGE_THAI, "th", "TH", false },
+ { LANGUAGE_LITHUANIAN, "lt", "LT", false },
+ { LANGUAGE_LITHUANIAN_CLASSIC, "lt", "LT", false },
+ { LANGUAGE_CROATIAN, "hr", "HR", false }, // Croatian in Croatia
+ { LANGUAGE_CROATIAN_BOSNIA_HERZEGOVINA, "hr", "BA", false },
+ { LANGUAGE_BOSNIAN_LATIN_BOSNIA_HERZEGOVINA, "bs", "BA", false },
+// { LANGUAGE_BOSNIAN_CYRILLIC_BOSNIA_AND_HERZEGOVINA, "bs", "BA", false }, // script codes not supported yet
+ { LANGUAGE_USER_SERBIAN_CYRILLIC_SERBIA, "sr", "RS", false }, // Serbian Cyrillic in Serbia
+ { LANGUAGE_SERBIAN_CYRILLIC, "sr", "YU", false }, // legacy Serbian Cyrillic in Serbia and Montenegro (former Yugoslavia); kludge, needed to be sr_CS instead, sr_CS not supported by ICU 2.6 (3.4 does)
+ { LANGUAGE_SERBIAN_CYRILLIC, "sr", "CS", false }, // alias to be able to integrate localizations, rsc needs it
+ { LANGUAGE_USER_SERBIAN_CYRILLIC_MONTENEGRO, "sr", "ME", false },
+ { LANGUAGE_SERBIAN_CYRILLIC_BOSNIA_HERZEGOVINA, "sr", "BA", false },
+ { LANGUAGE_USER_SERBIAN_LATIN_SERBIA, "sh", "RS", false }, // Serbian Latin in Serbia; kludge, needed to be sr_Latn_RS instead, script codes not supported yet
+ { LANGUAGE_SERBIAN_LATIN, "sh", "YU", false }, // legacy Serbian Latin in Serbia and Montenegro (former Yugoslavia); kludge, needed to be sr_Latn_CS instead, script codes not supported yet
+ { LANGUAGE_SERBIAN_LATIN, "sh", "CS", false }, // Serbian Latin in Serbia and Montenegro; kludge, needed to be sr_Latn_CS instead, script codes not supported yet
+ { LANGUAGE_USER_SERBIAN_LATIN_MONTENEGRO, "sh", "ME", false }, // Serbian Latin in Montenegro; kludge, needed to be sr_Latn_ME instead, script codes not supported yet
+ { LANGUAGE_SERBIAN_LATIN_BOSNIA_HERZEGOVINA, "sh", "BA", false },
+ { LANGUAGE_SERBIAN_LATIN_NEUTRAL, "sh", "" , false }, // kludge, needed to be sr_Latn instead, script codes not supported yet
+ { LANGUAGE_ARMENIAN, "hy", "AM", false },
+ { LANGUAGE_AZERI_LATIN, "az", "AZ", false },
+// { LANGUAGE_AZERI_CYRILLIC, "az", "AZ", false }, // script codes not supported yet
+ { LANGUAGE_UZBEK_LATIN, "uz", "UZ", false },
+// { LANGUAGE_UZBEK_CYRILLIC, "uz", "UZ", false }, // script codes not supported yet
+ { LANGUAGE_BENGALI_BANGLADESH, "bn", "BD", false },
+ { LANGUAGE_BENGALI, "bn", "IN", false },
+ { LANGUAGE_BURMESE, "my", "MM", false },
+ { LANGUAGE_KAZAKH, "kk", "KZ", false },
+ { LANGUAGE_ENGLISH_INDIA, "en", "IN", false },
+ { LANGUAGE_URDU_INDIA, "ur", "IN", false },
+ { LANGUAGE_URDU_PAKISTAN, "ur", "PK", false },
+ { LANGUAGE_HINDI, "hi", "IN", false },
+ { LANGUAGE_GUJARATI, "gu", "IN", false },
+ { LANGUAGE_KANNADA, "kn", "IN", false },
+ { LANGUAGE_ASSAMESE, "as", "IN", false },
+ { LANGUAGE_KASHMIRI_INDIA, "ks", "IN", false },
+ { LANGUAGE_KASHMIRI, "ks", "" , false }, // Kashmiri in "Jammu and Kashmir" ... no ISO3166 code for that
+ { LANGUAGE_MALAYALAM, "ml", "IN", false },
+ { LANGUAGE_MANIPURI, "mni", "IN", false },
+ { LANGUAGE_MARATHI, "mr", "IN", false },
+ { LANGUAGE_KONKANI, "kok", "IN", false },
+ { LANGUAGE_NEPALI, "ne", "NP", false },
+ { LANGUAGE_NEPALI_INDIA, "ne", "IN", false },
+ { LANGUAGE_ORIYA, "or", "IN", false },
+ { LANGUAGE_PUNJABI, "pa", "IN", false },
+ { LANGUAGE_SANSKRIT, "sa", "IN", false },
+ { LANGUAGE_SINDHI, "sd", "IN", false },
+ { LANGUAGE_TAMIL, "ta", "IN", false },
+ { LANGUAGE_TELUGU, "te", "IN", false },
+ { LANGUAGE_PUNJABI_PAKISTAN, "lah", "PK", false }, // preferring "lah" over "pa" for Western Punjabi, see http://www.ethnologue.com/show_language.asp?code=PNB
+ { LANGUAGE_PUNJABI_PAKISTAN, "pa", "PK", false },
+ { LANGUAGE_SINDHI_PAKISTAN, "sd", "PK", false },
+ { LANGUAGE_BELARUSIAN, "be", "BY", false },
+ { LANGUAGE_CATALAN, "ca", "ES", false }, // Spain (default)
+ { LANGUAGE_CATALAN, "ca", "AD", false }, // Andorra
//LANGUAGE_CATALAN_VALENCIAN ca-ES-valencia Bcp47CountryEntry takes precedence
- { 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" },
- { LANGUAGE_FRENCH_SENEGAL, "fr", "SN" },
- { LANGUAGE_FRENCH_ZAIRE, "fr", "CD" }, // Democratic Republic Of Congo
- { LANGUAGE_FRENCH_MOROCCO, "fr", "MA" },
- { LANGUAGE_FRENCH_REUNION, "fr", "RE" },
- { LANGUAGE_FRENCH, "fr", "" }, // needed as a catcher before other "fr" entries!
- { LANGUAGE_FRENCH_NORTH_AFRICA, "fr", "" },
- { LANGUAGE_FRENCH_WEST_INDIES, "fr", "" }, // unknown ISO country code
- { LANGUAGE_FRISIAN_NETHERLANDS, "fy", "NL" },
- { LANGUAGE_GAELIC_IRELAND, "ga", "IE" },
- { LANGUAGE_GAELIC_SCOTLAND, "gd", "GB" },
- { LANGUAGE_GALICIAN, "gl", "ES" },
- { LANGUAGE_GEORGIAN, "ka", "GE" },
- { LANGUAGE_KHMER, "km", "KH" },
- { LANGUAGE_KIRGHIZ, "ky", "KG" },
- { LANGUAGE_LAO, "lo", "LA" },
- { LANGUAGE_MALTESE, "mt", "MT" },
- { LANGUAGE_MONGOLIAN, "mn", "MN" }, // Cyrillic script
- { LANGUAGE_MONGOLIAN_MONGOLIAN, "mn", "MN" },
- { LANGUAGE_RUSSIAN_MOLDOVA, "mo", "MD" },
- { LANGUAGE_SWAHILI, "sw", "KE" },
- { LANGUAGE_USER_SWAHILI_TANZANIA, "sw", "TZ" },
- { LANGUAGE_TAJIK, "tg", "TJ" },
- { LANGUAGE_TIBETAN, "bo", "CN" }, // CN politically correct?
- { LANGUAGE_USER_TIBETAN_INDIA, "bo", "IN" },
- { LANGUAGE_DZONGKHA, "dz", "BT" },
- { LANGUAGE_TURKMEN, "tk", "TM" },
- { LANGUAGE_WELSH, "cy", "GB" },
- { LANGUAGE_SESOTHO, "st", "ZA" },
- { LANGUAGE_SEPEDI, "nso", "ZA" },
- { LANGUAGE_SEPEDI, "ns", "ZA" }, // fake "ns" for compatibility with existing OOo1.1.x localization to be able to read those documents
- { LANGUAGE_TSONGA, "ts", "ZA" },
- { LANGUAGE_TSWANA, "tn", "ZA" },
- { LANGUAGE_ENGLISH_SAFRICA, "en", "ZA" },
- { LANGUAGE_AFRIKAANS, "af", "ZA" },
- { LANGUAGE_VENDA, "ve", "ZA" }, // default 639-1
- { LANGUAGE_VENDA, "ven", "ZA" }, // 639-2 may have been used temporarily since 2004-07-23
- { LANGUAGE_XHOSA, "xh", "ZA" },
- { LANGUAGE_ZULU, "zu", "ZA" },
- { LANGUAGE_QUECHUA_ECUADOR, "qu", "EC" },
- { LANGUAGE_QUECHUA_PERU, "qu", "PE" },
- { LANGUAGE_QUECHUA_BOLIVIA, "qu", "BO" }, // macro: quh-BO, qul-BO
- { LANGUAGE_PASHTO, "ps", "AF" },
- { LANGUAGE_OROMO, "om", "ET" },
- { LANGUAGE_DHIVEHI, "dv", "MV" },
- { LANGUAGE_UIGHUR_CHINA, "ug", "CN" },
- { LANGUAGE_TIGRIGNA_ETHIOPIA, "ti", "ET" },
- { LANGUAGE_TIGRIGNA_ERITREA, "ti", "ER" },
- { LANGUAGE_AMHARIC_ETHIOPIA, "am", "ET" },
- { LANGUAGE_GUARANI_PARAGUAY, "gug", "PY" },
- { LANGUAGE_HAWAIIAN_UNITED_STATES, "haw", "US" },
- { LANGUAGE_EDO, "bin", "NG" },
- { LANGUAGE_FULFULDE_NIGERIA, "ff", "NG" },
- { LANGUAGE_HAUSA_NIGERIA, "ha", "NG" },
- { LANGUAGE_USER_HAUSA_GHANA, "ha", "GH" },
- { LANGUAGE_IGBO_NIGERIA, "ig", "NG" },
- { LANGUAGE_KANURI_NIGERIA, "kr", "NG" },
- { LANGUAGE_YORUBA, "yo", "NG" },
- { LANGUAGE_SOMALI, "so", "SO" },
- { LANGUAGE_PAPIAMENTU, "pap", "AN" },
- { LANGUAGE_USER_PAPIAMENTU_ARUBA, "pap", "AW" },
- { LANGUAGE_USER_PAPIAMENTU_CURACAO, "pap", "CW" },
- { LANGUAGE_USER_PAPIAMENTU_BONAIRE, "pap", "BQ" },
- { LANGUAGE_ENGLISH_SINGAPORE, "en", "SG" },
- { LANGUAGE_USER_YIDDISH_US, "yi", "US" },
- { LANGUAGE_YIDDISH, "yi", "IL" }, // new: old was "ji"
- { LANGUAGE_YIDDISH, "ji", "IL" }, // old: new is "yi"
- { LANGUAGE_SYRIAC, "syr", "TR" }, // "TR" according to http://www.ethnologue.com/show_language.asp?code=SYC
- { LANGUAGE_SINHALESE_SRI_LANKA, "si", "LK" },
- { LANGUAGE_CHEROKEE_UNITED_STATES, "chr", "US" },
- { LANGUAGE_INUKTITUT_LATIN_CANADA, "iu", "CA" },
-// { LANGUAGE_INUKTITUT_SYLLABICS_CANADA, "iu", "CA" }, // script codes not supported yet
- { LANGUAGE_SAMI_NORTHERN_NORWAY, "se", "NO" },
- { LANGUAGE_SAMI_INARI, "smn", "FI" },
- { LANGUAGE_SAMI_LULE_NORWAY, "smj", "NO" },
- { LANGUAGE_SAMI_LULE_SWEDEN, "smj", "SE" },
- { LANGUAGE_SAMI_NORTHERN_FINLAND, "se", "FI" },
- { LANGUAGE_SAMI_NORTHERN_SWEDEN, "se", "SE" },
- { LANGUAGE_SAMI_SKOLT, "sms", "FI" },
- { LANGUAGE_SAMI_SOUTHERN_NORWAY, "sma", "NO" },
- { LANGUAGE_SAMI_SOUTHERN_SWEDEN, "sma", "SE" },
- { LANGUAGE_USER_SAMI_KILDIN_RUSSIA, "sjd", "RU" },
- { LANGUAGE_MAPUDUNGUN_CHILE, "arn", "CL" },
- { LANGUAGE_CORSICAN_FRANCE, "co", "FR" },
- { LANGUAGE_ALSATIAN_FRANCE, "gsw", "FR" }, // in fact 'gsw' is Schwyzerduetsch (Swiss German), which is a dialect of Alemannic German, as is Alsatian. They aren't distinct languages and share this code.
- { LANGUAGE_YAKUT_RUSSIA, "sah", "RU" },
- { LANGUAGE_MOHAWK_CANADA, "moh", "CA" },
- { LANGUAGE_BASHKIR_RUSSIA, "ba", "RU" },
- { LANGUAGE_KICHE_GUATEMALA, "qut", "GT" },
- { LANGUAGE_DARI_AFGHANISTAN, "gbz", "AF" },
- { LANGUAGE_WOLOF_SENEGAL, "wo", "SN" },
- { LANGUAGE_FILIPINO, "fil", "PH" },
- { LANGUAGE_USER_TAGALOG, "tl", "PH" },
- { LANGUAGE_ENGLISH_PHILIPPINES, "en", "PH" },
-// { LANGUAGE_IBIBIO_NIGERIA, "nic", "NG" }, // ISO "nic" is only a collective language code
- { LANGUAGE_YI, "ii", "CN" },
- { LANGUAGE_TAMAZIGHT_LATIN, "kab", "DZ" }, // In practice Kabyle is the language used for this
- { LANGUAGE_OBSOLETE_USER_KABYLE, "kab", "DZ" },
- { LANGUAGE_TAMAZIGHT_LATIN, "ber", "DZ" }, // In practice Algeria has standardized on Kabyle as the member of the "ber" collective which gets used there.
- { LANGUAGE_TAMAZIGHT_TIFINAGH, "ber", "MA" }, // Morocco is officially using Tifinagh for its Berber languages so store it to distinguish explicitly from LANGUAGE_TAMAZIGHT_LATIN, even though as a collective language its not of much use
-// { LANGUAGE_TAMAZIGHT_ARABIC, "ber", "" }, // ISO "ber" only collective!
- { LANGUAGE_LATIN, "la", "VA" },
- { LANGUAGE_OBSOLETE_USER_LATIN, "la", "VA" },
- { LANGUAGE_USER_ESPERANTO, "eo", "" },
- { LANGUAGE_USER_INTERLINGUA, "ia", "" },
- { LANGUAGE_MAORI_NEW_ZEALAND, "mi", "NZ" },
- { LANGUAGE_OBSOLETE_USER_MAORI, "mi", "NZ" },
- { LANGUAGE_KINYARWANDA_RWANDA, "rw", "RW" },
- { LANGUAGE_OBSOLETE_USER_KINYARWANDA, "rw", "RW" },
- { LANGUAGE_UPPER_SORBIAN_GERMANY, "hsb", "DE" }, // MS maps this to 'wen-DE', which is nonsense. 'wen' is a collective language code, 'WEN' is a SIL code, see http://www.ethnologue.com/14/show_iso639.asp?code=wen and http://www.ethnologue.com/14/show_language.asp?code=WEN
- { LANGUAGE_OBSOLETE_USER_UPPER_SORBIAN,"hsb", "DE" },
- { LANGUAGE_LOWER_SORBIAN_GERMANY, "dsb", "DE" }, // MS maps this to 'wee-DE', which is nonsense. 'WEE' is a SIL code, see http://www.ethnologue.com/14/show_language.asp?code=WEE
- { LANGUAGE_OBSOLETE_USER_LOWER_SORBIAN,"dsb", "DE" },
- { LANGUAGE_OCCITAN_FRANCE, "oc", "FR" },
- { LANGUAGE_OBSOLETE_USER_OCCITAN, "oc", "FR" },
- { LANGUAGE_USER_KURDISH_TURKEY, "ku", "TR" },
- { LANGUAGE_USER_KURDISH_SYRIA, "ku", "SY" },
- { LANGUAGE_USER_KURDISH_IRAQ, "ku", "IQ" },
- { LANGUAGE_USER_KURDISH_IRAN, "ku", "IR" },
- { LANGUAGE_USER_SARDINIAN, "sc", "IT" }, // macrolanguage code
- { LANGUAGE_USER_SARDINIAN_CAMPIDANESE, "sro", "IT" },
- { LANGUAGE_USER_SARDINIAN_GALLURESE, "sdn", "IT" },
- { LANGUAGE_USER_SARDINIAN_LOGUDORESE, "src", "IT" },
- { LANGUAGE_USER_SARDINIAN_SASSARESE, "sdc", "IT" },
- { LANGUAGE_BRETON_FRANCE, "br", "FR" },
- { LANGUAGE_OBSOLETE_USER_BRETON, "br", "FR" },
- { LANGUAGE_KALAALLISUT_GREENLAND, "kl", "GL" },
- { LANGUAGE_OBSOLETE_USER_KALAALLISUT, "kl", "GL" },
- { LANGUAGE_USER_SWAZI, "ss", "ZA" },
- { LANGUAGE_USER_NDEBELE_SOUTH, "nr", "ZA" },
- { LANGUAGE_USER_TSWANA_BOTSWANA, "tn", "BW" },
- { LANGUAGE_USER_MOORE, "mos", "BF" },
- { LANGUAGE_USER_BAMBARA, "bm", "ML" },
- { LANGUAGE_USER_AKAN, "ak", "GH" },
- { LANGUAGE_LUXEMBOURGISH_LUXEMBOURG, "lb", "LU" },
- { LANGUAGE_OBSOLETE_USER_LUXEMBOURGISH, "lb", "LU" },
- { LANGUAGE_USER_FRIULIAN, "fur", "IT" },
- { LANGUAGE_USER_FIJIAN, "fj", "FJ" },
- { LANGUAGE_USER_AFRIKAANS_NAMIBIA, "af", "NA" },
- { LANGUAGE_USER_ENGLISH_NAMIBIA, "en", "NA" },
- { LANGUAGE_USER_WALLOON, "wa", "BE" },
- { LANGUAGE_USER_COPTIC, "cop", "EG" },
- { LANGUAGE_USER_GASCON, "gsc", "FR" },
- { LANGUAGE_USER_GERMAN_BELGIUM, "de", "BE" },
- { LANGUAGE_USER_CHUVASH, "cv", "RU" },
- { LANGUAGE_USER_EWE_GHANA, "ee", "GH" },
- { LANGUAGE_USER_ENGLISH_GHANA, "en", "GH" },
- { LANGUAGE_USER_SANGO, "sg", "CF" },
- { LANGUAGE_USER_GANDA, "lg", "UG" },
- { LANGUAGE_USER_LINGALA_DRCONGO, "ln", "CD" },
- { LANGUAGE_USER_LOW_GERMAN, "nds", "DE" },
- { LANGUAGE_USER_HILIGAYNON, "hil", "PH" },
- { LANGUAGE_USER_ENGLISH_MALAWI, "en", "MW" }, /* en default for MW */
- { LANGUAGE_USER_NYANJA, "ny", "MW" },
- { LANGUAGE_USER_KASHUBIAN, "csb", "PL" },
- { LANGUAGE_USER_SPANISH_CUBA, "es", "CU" },
- { LANGUAGE_USER_QUECHUA_NORTH_BOLIVIA, "qul", "BO" },
- { LANGUAGE_USER_QUECHUA_SOUTH_BOLIVIA, "quh", "BO" },
- { LANGUAGE_USER_BODO_INDIA, "brx", "IN" },
- { LANGUAGE_USER_DOGRI_INDIA, "dgo", "IN" },
- { LANGUAGE_USER_MAITHILI_INDIA, "mai", "IN" },
- { LANGUAGE_USER_SANTALI_INDIA, "sat", "IN" },
- { LANGUAGE_USER_TETUN, "tet", "ID" },
- { LANGUAGE_USER_TETUN_TIMOR_LESTE, "tet", "TL" },
- { LANGUAGE_USER_TOK_PISIN, "tpi", "PG" },
- { LANGUAGE_USER_SHUSWAP, "shs", "CA" },
- { LANGUAGE_USER_ANCIENT_GREEK, "grc", "GR" },
- { LANGUAGE_USER_ASTURIAN, "ast", "ES" },
- { LANGUAGE_USER_LATGALIAN, "ltg", "LV" },
- { LANGUAGE_USER_MAORE, "swb", "YT" },
- { LANGUAGE_USER_BUSHI, "buc", "YT" },
- { LANGUAGE_USER_TAHITIAN, "ty", "PF" },
- { LANGUAGE_USER_MALAGASY_PLATEAU, "plt", "MG" },
- { LANGUAGE_USER_MALAGASY_PLATEAU, "mg", "MG" },
- { LANGUAGE_USER_BAFIA, "ksf", "CM" },
- { LANGUAGE_USER_GIKUYU, "ki", "KE" },
- { LANGUAGE_USER_RUSYN_UKRAINE, "rue", "UA" },
- { LANGUAGE_USER_RUSYN_SLOVAKIA, "rue", "SK" },
- { LANGUAGE_USER_LIMBU, "lif", "NP" },
- { LANGUAGE_USER_LOJBAN, "jbo", "" },
- { LANGUAGE_USER_HAITIAN, "ht", "HT" },
- { LANGUAGE_FRENCH_HAITI, "fr", "HT" },
- { LANGUAGE_USER_BEEMBE, "beq", "CG" },
- { LANGUAGE_USER_BEKWEL, "bkw", "CG" },
- { LANGUAGE_USER_KITUBA, "mkw", "CG" },
- { LANGUAGE_USER_LARI, "ldi", "CG" },
- { LANGUAGE_USER_MBOCHI, "mdw", "CG" },
- { LANGUAGE_USER_TEKE_EBOO, "ebo", "CG" },
- { LANGUAGE_USER_TEKE_IBALI, "tek", "CG" },
- { LANGUAGE_USER_TEKE_TYEE, "tyx", "CG" },
- { LANGUAGE_USER_VILI, "vif", "CG" },
- { LANGUAGE_USER_PORTUGUESE_ANGOLA, "pt", "AO" },
- { LANGUAGE_USER_MANX, "gv", "GB" },
- { LANGUAGE_USER_ARAGONESE, "an", "ES" },
- { LANGUAGE_USER_KEYID, "qtz", "" }, // key id pseudolanguage used for UI testing
- { LANGUAGE_USER_PALI_LATIN, "pi", "" }, // Pali with Latin script, ISO 639-1
- { LANGUAGE_USER_PALI_LATIN, "pli", "" }, // Pali with Latin script, ISO 639-3 (sigh..) back-compat
- { LANGUAGE_USER_KYRGYZ_CHINA, "ky", "CN" },
- { LANGUAGE_USER_KOMI_ZYRIAN, "kpv", "RU" },
- { LANGUAGE_USER_KOMI_PERMYAK, "koi", "RU" },
- { LANGUAGE_USER_PITJANTJATJARA, "pjt", "AU" },
- { LANGUAGE_USER_ERZYA, "myv", "RU" },
- { LANGUAGE_USER_MARI_MEADOW, "mhr", "RU" },
- { LANGUAGE_USER_KHANTY, "kca", "RU" },
- { LANGUAGE_USER_LIVONIAN, "liv", "RU" },
- { LANGUAGE_USER_MOKSHA, "mdf", "RU" },
- { LANGUAGE_USER_MARI_HILL, "mrj", "RU" },
- { LANGUAGE_USER_NGANASAN, "nio", "RU" },
- { LANGUAGE_USER_OLONETS, "olo", "RU" },
- { LANGUAGE_USER_VEPS, "vep", "RU" },
- { LANGUAGE_USER_VORO, "vro", "EE" },
- { LANGUAGE_USER_NENETS, "yrk", "RU" },
- { LANGUAGE_USER_AKA, "axk", "CF" },
- { LANGUAGE_USER_AKA_CONGO, "axk", "CG" },
- { LANGUAGE_USER_DIBOLE, "bvx", "CG" },
- { LANGUAGE_USER_DOONDO, "dde", "CG" },
- { LANGUAGE_USER_KAAMBA, "xku", "CG" },
- { LANGUAGE_USER_KOONGO, "kng", "CD" },
- { LANGUAGE_USER_KOONGO_CONGO, "kng", "CG" },
- { LANGUAGE_USER_KUNYI, "njx", "CG" },
- { LANGUAGE_USER_NGUNGWEL, "ngz", "CG" },
- { LANGUAGE_USER_NJYEM, "njy", "CM" },
- { LANGUAGE_USER_NJYEM_CONGO, "njy", "CG" },
- { LANGUAGE_USER_PUNU, "puu", "GA" },
- { LANGUAGE_USER_PUNU_CONGO, "puu", "CG" },
- { LANGUAGE_USER_SUUNDI, "sdj", "CG" },
- { LANGUAGE_USER_TEKE_KUKUYA, "kkw", "CG" },
- { LANGUAGE_USER_TSAANGI, "tsa", "CG" },
- { LANGUAGE_USER_YAKA, "iyx", "CG" },
- { LANGUAGE_USER_YOMBE, "yom", "CD" },
- { LANGUAGE_USER_YOMBE_CONGO, "yom", "CG" },
- { LANGUAGE_USER_SIDAMA, "sid", "ET" },
- { LANGUAGE_USER_NKO, "nqo", "GN" },
- { LANGUAGE_USER_UDMURT, "udm", "RU" },
- { LANGUAGE_USER_CORNISH, "kw", "UK" },
- { LANGUAGE_USER_SAMI_PITE_SWEDEN, "sje", "SE" },
- { LANGUAGE_USER_NGAEBERE, "gym", "PA" },
- { LANGUAGE_MULTIPLE, "mul", "" }, // multiple languages, many languages are used
- { LANGUAGE_UNDETERMINED, "und", "" }, // undetermined language, language cannot be identified
- { LANGUAGE_NONE, "zxx", "" }, // added to ISO 639-2 on 2006-01-11: Used to declare the absence of linguistic information
- { LANGUAGE_DONTKNOW, "", "" } // marks end of table
+ { LANGUAGE_CATALAN_VALENCIAN, "ca", "XV", true }, // XV: ISO 3166 user-assigned; old workaround for UI localization only, in case it escaped to document content
+ { LANGUAGE_CATALAN_VALENCIAN, "qcv", "ES", true }, // 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", false },
+ { LANGUAGE_FRENCH_COTE_D_IVOIRE, "fr", "CI", false },
+ { LANGUAGE_FRENCH_MALI, "fr", "ML", false },
+ { LANGUAGE_FRENCH_SENEGAL, "fr", "SN", false },
+ { LANGUAGE_FRENCH_ZAIRE, "fr", "CD", false }, // Democratic Republic Of Congo
+ { LANGUAGE_FRENCH_MOROCCO, "fr", "MA", false },
+ { LANGUAGE_FRENCH_REUNION, "fr", "RE", false },
+ { LANGUAGE_FRENCH, "fr", "" , false }, // needed as a catcher before other "fr" entries!
+ { LANGUAGE_FRENCH_NORTH_AFRICA, "fr", "" , false },
+ { LANGUAGE_FRENCH_WEST_INDIES, "fr", "" , false }, // unknown ISO country code
+ { LANGUAGE_FRISIAN_NETHERLANDS, "fy", "NL", false },
+ { LANGUAGE_GAELIC_IRELAND, "ga", "IE", false },
+ { LANGUAGE_GAELIC_SCOTLAND, "gd", "GB", false },
+ { LANGUAGE_GALICIAN, "gl", "ES", false },
+ { LANGUAGE_GEORGIAN, "ka", "GE", false },
+ { LANGUAGE_KHMER, "km", "KH", false },
+ { LANGUAGE_KIRGHIZ, "ky", "KG", false },
+ { LANGUAGE_LAO, "lo", "LA", false },
+ { LANGUAGE_MALTESE, "mt", "MT", false },
+ { LANGUAGE_MONGOLIAN, "mn", "MN", false }, // Cyrillic script
+ { LANGUAGE_MONGOLIAN_MONGOLIAN, "mn", "MN", false },
+ { LANGUAGE_RUSSIAN_MOLDOVA, "mo", "MD", false },
+ { LANGUAGE_SWAHILI, "sw", "KE", false },
+ { LANGUAGE_USER_SWAHILI_TANZANIA, "sw", "TZ", false },
+ { LANGUAGE_TAJIK, "tg", "TJ", false },
+ { LANGUAGE_TIBETAN, "bo", "CN", false }, // CN politically correct?
+ { LANGUAGE_USER_TIBETAN_INDIA, "bo", "IN", false },
+ { LANGUAGE_DZONGKHA, "dz", "BT", false },
+ { LANGUAGE_TURKMEN, "tk", "TM", false },
+ { LANGUAGE_WELSH, "cy", "GB", false },
+ { LANGUAGE_SESOTHO, "st", "ZA", false },
+ { LANGUAGE_SEPEDI, "nso", "ZA", false },
+ { LANGUAGE_SEPEDI, "ns", "ZA", false }, // fake "ns" for compatibility with existing OOo1.1.x localization to be able to read those documents
+ { LANGUAGE_TSONGA, "ts", "ZA", false },
+ { LANGUAGE_TSWANA, "tn", "ZA", false },
+ { LANGUAGE_ENGLISH_SAFRICA, "en", "ZA", false },
+ { LANGUAGE_AFRIKAANS, "af", "ZA", false },
+ { LANGUAGE_VENDA, "ve", "ZA", false }, // default 639-1
+ { LANGUAGE_VENDA, "ven", "ZA", false }, // 639-2 may have been used temporarily since 2004-07-23
+ { LANGUAGE_XHOSA, "xh", "ZA", false },
+ { LANGUAGE_ZULU, "zu", "ZA", false },
+ { LANGUAGE_QUECHUA_ECUADOR, "qu", "EC", false },
+ { LANGUAGE_QUECHUA_PERU, "qu", "PE", false },
+ { LANGUAGE_QUECHUA_BOLIVIA, "qu", "BO", false }, // macro: quh-BO, qul-BO
+ { LANGUAGE_PASHTO, "ps", "AF", false },
+ { LANGUAGE_OROMO, "om", "ET", false },
+ { LANGUAGE_DHIVEHI, "dv", "MV", false },
+ { LANGUAGE_UIGHUR_CHINA, "ug", "CN", false },
+ { LANGUAGE_TIGRIGNA_ETHIOPIA, "ti", "ET", false },
+ { LANGUAGE_TIGRIGNA_ERITREA, "ti", "ER", false },
+ { LANGUAGE_AMHARIC_ETHIOPIA, "am", "ET", false },
+ { LANGUAGE_GUARANI_PARAGUAY, "gug", "PY", false },
+ { LANGUAGE_HAWAIIAN_UNITED_STATES, "haw", "US", false },
+ { LANGUAGE_EDO, "bin", "NG", false },
+ { LANGUAGE_FULFULDE_NIGERIA, "ff", "NG", false },
+ { LANGUAGE_HAUSA_NIGERIA, "ha", "NG", false },
+ { LANGUAGE_USER_HAUSA_GHANA, "ha", "GH", false },
+ { LANGUAGE_IGBO_NIGERIA, "ig", "NG", false },
+ { LANGUAGE_KANURI_NIGERIA, "kr", "NG", false },
+ { LANGUAGE_YORUBA, "yo", "NG", false },
+ { LANGUAGE_SOMALI, "so", "SO", false },
+ { LANGUAGE_PAPIAMENTU, "pap", "AN", false },
+ { LANGUAGE_USER_PAPIAMENTU_ARUBA, "pap", "AW", false },
+ { LANGUAGE_USER_PAPIAMENTU_CURACAO, "pap", "CW", false },
+ { LANGUAGE_USER_PAPIAMENTU_BONAIRE, "pap", "BQ", false },
+ { LANGUAGE_ENGLISH_SINGAPORE, "en", "SG", false },
+ { LANGUAGE_USER_YIDDISH_US, "yi", "US", false },
+ { LANGUAGE_YIDDISH, "yi", "IL", false }, // new: old was "ji"
+ { LANGUAGE_YIDDISH, "ji", "IL", false }, // old: new is "yi"
+ { LANGUAGE_SYRIAC, "syr", "TR", false }, // "TR" according to http://www.ethnologue.com/show_language.asp?code=SYC
+ { LANGUAGE_SINHALESE_SRI_LANKA, "si", "LK", false },
+ { LANGUAGE_CHEROKEE_UNITED_STATES, "chr", "US", false },
+ { LANGUAGE_INUKTITUT_LATIN_CANADA, "iu", "CA", false },
+// { LANGUAGE_INUKTITUT_SYLLABICS_CANADA, "iu", "CA", false }, // script codes not supported yet
+ { LANGUAGE_SAMI_NORTHERN_NORWAY, "se", "NO", false },
+ { LANGUAGE_SAMI_INARI, "smn", "FI", false },
+ { LANGUAGE_SAMI_LULE_NORWAY, "smj", "NO", false },
+ { LANGUAGE_SAMI_LULE_SWEDEN, "smj", "SE", false },
+ { LANGUAGE_SAMI_NORTHERN_FINLAND, "se", "FI", false },
+ { LANGUAGE_SAMI_NORTHERN_SWEDEN, "se", "SE", false },
+ { LANGUAGE_SAMI_SKOLT, "sms", "FI", false },
+ { LANGUAGE_SAMI_SOUTHERN_NORWAY, "sma", "NO", false },
+ { LANGUAGE_SAMI_SOUTHERN_SWEDEN, "sma", "SE", false },
+ { LANGUAGE_USER_SAMI_KILDIN_RUSSIA, "sjd", "RU", false },
+ { LANGUAGE_MAPUDUNGUN_CHILE, "arn", "CL", false },
+ { LANGUAGE_CORSICAN_FRANCE, "co", "FR", false },
+ { LANGUAGE_ALSATIAN_FRANCE, "gsw", "FR", false }, // in fact 'gsw' is Schwyzerduetsch (Swiss German), which is a dialect of Alemannic German, as is Alsatian. They aren't distinct languages and share this code.
+ { LANGUAGE_YAKUT_RUSSIA, "sah", "RU", false },
+ { LANGUAGE_MOHAWK_CANADA, "moh", "CA", false },
+ { LANGUAGE_BASHKIR_RUSSIA, "ba", "RU", false },
+ { LANGUAGE_KICHE_GUATEMALA, "qut", "GT", false },
+ { LANGUAGE_DARI_AFGHANISTAN, "gbz", "AF", false },
+ { LANGUAGE_WOLOF_SENEGAL, "wo", "SN", false },
+ { LANGUAGE_FILIPINO, "fil", "PH", false },
+ { LANGUAGE_USER_TAGALOG, "tl", "PH", false },
+ { LANGUAGE_ENGLISH_PHILIPPINES, "en", "PH", false },
+// { LANGUAGE_IBIBIO_NIGERIA, "nic", "NG", false }, // ISO "nic" is only a collective language code
+ { LANGUAGE_YI, "ii", "CN", false },
+ { LANGUAGE_TAMAZIGHT_LATIN, "kab", "DZ", false }, // In practice Kabyle is the language used for this
+ { LANGUAGE_OBSOLETE_USER_KABYLE, "kab", "DZ", false },
+ { LANGUAGE_TAMAZIGHT_LATIN, "ber", "DZ", false }, // In practice Algeria has standardized on Kabyle as the member of the "ber" collective which gets used there.
+ { LANGUAGE_TAMAZIGHT_TIFINAGH, "ber", "MA", false }, // Morocco is officially using Tifinagh for its Berber languages so store it to distinguish explicitly from LANGUAGE_TAMAZIGHT_LATIN, even though as a collective language its not of much use
+// { LANGUAGE_TAMAZIGHT_ARABIC, "ber", "" , false }, // ISO "ber" only collective!
+ { LANGUAGE_LATIN, "la", "VA", false },
+ { LANGUAGE_OBSOLETE_USER_LATIN, "la", "VA", false },
+ { LANGUAGE_USER_ESPERANTO, "eo", "" , false },
+ { LANGUAGE_USER_INTERLINGUA, "ia", "" , false },
+ { LANGUAGE_MAORI_NEW_ZEALAND, "mi", "NZ", false },
+ { LANGUAGE_OBSOLETE_USER_MAORI, "mi", "NZ", false },
+ { LANGUAGE_KINYARWANDA_RWANDA, "rw", "RW", false },
+ { LANGUAGE_OBSOLETE_USER_KINYARWANDA, "rw", "RW", false },
+ { LANGUAGE_UPPER_SORBIAN_GERMANY, "hsb", "DE", false }, // MS maps this to 'wen-DE', which is nonsense. 'wen' is a collective language code, 'WEN' is a SIL code, see http://www.ethnologue.com/14/show_iso639.asp?code=wen and http://www.ethnologue.com/14/show_language.asp?code=WEN
+ { LANGUAGE_OBSOLETE_USER_UPPER_SORBIAN,"hsb", "DE", false },
+ { LANGUAGE_LOWER_SORBIAN_GERMANY, "dsb", "DE", false }, // MS maps this to 'wee-DE', which is nonsense. 'WEE' is a SIL code, see http://www.ethnologue.com/14/show_language.asp?code=WEE
+ { LANGUAGE_OBSOLETE_USER_LOWER_SORBIAN,"dsb", "DE", false },
+ { LANGUAGE_OCCITAN_FRANCE, "oc", "FR", false },
+ { LANGUAGE_OBSOLETE_USER_OCCITAN, "oc", "FR", false },
+ { LANGUAGE_USER_KURDISH_TURKEY, "ku", "TR", false },
+ { LANGUAGE_USER_KURDISH_SYRIA, "ku", "SY", false },
+ { LANGUAGE_USER_KURDISH_IRAQ, "ku", "IQ", false },
+ { LANGUAGE_USER_KURDISH_IRAN, "ku", "IR", false },
+ { LANGUAGE_USER_SARDINIAN, "sc", "IT", false }, // macrolanguage code
+ { LANGUAGE_USER_SARDINIAN_CAMPIDANESE, "sro", "IT", false },
+ { LANGUAGE_USER_SARDINIAN_GALLURESE, "sdn", "IT", false },
+ { LANGUAGE_USER_SARDINIAN_LOGUDORESE, "src", "IT", false },
+ { LANGUAGE_USER_SARDINIAN_SASSARESE, "sdc", "IT", false },
+ { LANGUAGE_BRETON_FRANCE, "br", "FR", false },
+ { LANGUAGE_OBSOLETE_USER_BRETON, "br", "FR", false },
+ { LANGUAGE_KALAALLISUT_GREENLAND, "kl", "GL", false },
+ { LANGUAGE_OBSOLETE_USER_KALAALLISUT, "kl", "GL", false },
+ { LANGUAGE_USER_SWAZI, "ss", "ZA", false },
+ { LANGUAGE_USER_NDEBELE_SOUTH, "nr", "ZA", false },
+ { LANGUAGE_USER_TSWANA_BOTSWANA, "tn", "BW", false },
+ { LANGUAGE_USER_MOORE, "mos", "BF", false },
+ { LANGUAGE_USER_BAMBARA, "bm", "ML", false },
+ { LANGUAGE_USER_AKAN, "ak", "GH", false },
+ { LANGUAGE_LUXEMBOURGISH_LUXEMBOURG, "lb", "LU", false },
+ { LANGUAGE_OBSOLETE_USER_LUXEMBOURGISH, "lb", "LU", false },
+ { LANGUAGE_USER_FRIULIAN, "fur", "IT", false },
+ { LANGUAGE_USER_FIJIAN, "fj", "FJ", false },
+ { LANGUAGE_USER_AFRIKAANS_NAMIBIA, "af", "NA", false },
+ { LANGUAGE_USER_ENGLISH_NAMIBIA, "en", "NA", false },
+ { LANGUAGE_USER_WALLOON, "wa", "BE", false },
+ { LANGUAGE_USER_COPTIC, "cop", "EG", false },
+ { LANGUAGE_USER_GASCON, "gsc", "FR", false },
+ { LANGUAGE_USER_GERMAN_BELGIUM, "de", "BE", false },
+ { LANGUAGE_USER_CHUVASH, "cv", "RU", false },
+ { LANGUAGE_USER_EWE_GHANA, "ee", "GH", false },
+ { LANGUAGE_USER_ENGLISH_GHANA, "en", "GH", false },
+ { LANGUAGE_USER_SANGO, "sg", "CF", false },
+ { LANGUAGE_USER_GANDA, "lg", "UG", false },
+ { LANGUAGE_USER_LINGALA_DRCONGO, "ln", "CD", false },
+ { LANGUAGE_USER_LOW_GERMAN, "nds", "DE", false },
+ { LANGUAGE_USER_HILIGAYNON, "hil", "PH", false },
+ { LANGUAGE_USER_ENGLISH_MALAWI, "en", "MW", false }, /* en default for MW */
+ { LANGUAGE_USER_NYANJA, "ny", "MW", false },
+ { LANGUAGE_USER_KASHUBIAN, "csb", "PL", false },
+ { LANGUAGE_USER_SPANISH_CUBA, "es", "CU", false },
+ { LANGUAGE_USER_QUECHUA_NORTH_BOLIVIA, "qul", "BO", false },
+ { LANGUAGE_USER_QUECHUA_SOUTH_BOLIVIA, "quh", "BO", false },
+ { LANGUAGE_USER_BODO_INDIA, "brx", "IN", false },
+ { LANGUAGE_USER_DOGRI_INDIA, "dgo", "IN", false },
+ { LANGUAGE_USER_MAITHILI_INDIA, "mai", "IN", false },
+ { LANGUAGE_USER_SANTALI_INDIA, "sat", "IN", false },
+ { LANGUAGE_USER_TETUN, "tet", "ID", false },
+ { LANGUAGE_USER_TETUN_TIMOR_LESTE, "tet", "TL", false },
+ { LANGUAGE_USER_TOK_PISIN, "tpi", "PG", false },
+ { LANGUAGE_USER_SHUSWAP, "shs", "CA", false },
+ { LANGUAGE_USER_ANCIENT_GREEK, "grc", "GR", false },
+ { LANGUAGE_USER_ASTURIAN, "ast", "ES", false },
+ { LANGUAGE_USER_LATGALIAN, "ltg", "LV", false },
+ { LANGUAGE_USER_MAORE, "swb", "YT", false },
+ { LANGUAGE_USER_BUSHI, "buc", "YT", false },
+ { LANGUAGE_USER_TAHITIAN, "ty", "PF", false },
+ { LANGUAGE_USER_MALAGASY_PLATEAU, "plt", "MG", false },
+ { LANGUAGE_USER_MALAGASY_PLATEAU, "mg", "MG", false },
+ { LANGUAGE_USER_BAFIA, "ksf", "CM", false },
+ { LANGUAGE_USER_GIKUYU, "ki", "KE", false },
+ { LANGUAGE_USER_RUSYN_UKRAINE, "rue", "UA", false },
+ { LANGUAGE_USER_RUSYN_SLOVAKIA, "rue", "SK", false },
+ { LANGUAGE_USER_LIMBU, "lif", "NP", false },
+ { LANGUAGE_USER_LOJBAN, "jbo", "" , false },
+ { LANGUAGE_USER_HAITIAN, "ht", "HT", false },
+ { LANGUAGE_FRENCH_HAITI, "fr", "HT", false },
+ { LANGUAGE_USER_BEEMBE, "beq", "CG", false },
+ { LANGUAGE_USER_BEKWEL, "bkw", "CG", false },
+ { LANGUAGE_USER_KITUBA, "mkw", "CG", false },
+ { LANGUAGE_USER_LARI, "ldi", "CG", false },
+ { LANGUAGE_USER_MBOCHI, "mdw", "CG", false },
+ { LANGUAGE_USER_TEKE_EBOO, "ebo", "CG", false },
+ { LANGUAGE_USER_TEKE_IBALI, "tek", "CG", false },
+ { LANGUAGE_USER_TEKE_TYEE, "tyx", "CG", false },
+ { LANGUAGE_USER_VILI, "vif", "CG", false },
+ { LANGUAGE_USER_PORTUGUESE_ANGOLA, "pt", "AO", false },
+ { LANGUAGE_USER_MANX, "gv", "GB", false },
+ { LANGUAGE_USER_ARAGONESE, "an", "ES", false },
+ { LANGUAGE_USER_KEYID, "qtz", "" , false }, // key id pseudolanguage used for UI testing
+ { LANGUAGE_USER_PALI_LATIN, "pi", "" , false }, // Pali with Latin script, ISO 639-1
+ { LANGUAGE_USER_PALI_LATIN, "pli", "" , false }, // Pali with Latin script, ISO 639-3 (sigh..) back-compat
+ { LANGUAGE_USER_KYRGYZ_CHINA, "ky", "CN", false },
+ { LANGUAGE_USER_KOMI_ZYRIAN, "kpv", "RU", false },
+ { LANGUAGE_USER_KOMI_PERMYAK, "koi", "RU", false },
+ { LANGUAGE_USER_PITJANTJATJARA, "pjt", "AU", false },
+ { LANGUAGE_USER_ERZYA, "myv", "RU", false },
+ { LANGUAGE_USER_MARI_MEADOW, "mhr", "RU", false },
+ { LANGUAGE_USER_KHANTY, "kca", "RU", false },
+ { LANGUAGE_USER_LIVONIAN, "liv", "RU", false },
+ { LANGUAGE_USER_MOKSHA, "mdf", "RU", false },
+ { LANGUAGE_USER_MARI_HILL, "mrj", "RU", false },
+ { LANGUAGE_USER_NGANASAN, "nio", "RU", false },
+ { LANGUAGE_USER_OLONETS, "olo", "RU", false },
+ { LANGUAGE_USER_VEPS, "vep", "RU", false },
+ { LANGUAGE_USER_VORO, "vro", "EE", false },
+ { LANGUAGE_USER_NENETS, "yrk", "RU", false },
+ { LANGUAGE_USER_AKA, "axk", "CF", false },
+ { LANGUAGE_USER_AKA_CONGO, "axk", "CG", false },
+ { LANGUAGE_USER_DIBOLE, "bvx", "CG", false },
+ { LANGUAGE_USER_DOONDO, "dde", "CG", false },
+ { LANGUAGE_USER_KAAMBA, "xku", "CG", false },
+ { LANGUAGE_USER_KOONGO, "kng", "CD", false },
+ { LANGUAGE_USER_KOONGO_CONGO, "kng", "CG", false },
+ { LANGUAGE_USER_KUNYI, "njx", "CG", false },
+ { LANGUAGE_USER_NGUNGWEL, "ngz", "CG", false },
+ { LANGUAGE_USER_NJYEM, "njy", "CM", false },
+ { LANGUAGE_USER_NJYEM_CONGO, "njy", "CG", false },
+ { LANGUAGE_USER_PUNU, "puu", "GA", false },
+ { LANGUAGE_USER_PUNU_CONGO, "puu", "CG", false },
+ { LANGUAGE_USER_SUUNDI, "sdj", "CG", false },
+ { LANGUAGE_USER_TEKE_KUKUYA, "kkw", "CG", false },
+ { LANGUAGE_USER_TSAANGI, "tsa", "CG", false },
+ { LANGUAGE_USER_YAKA, "iyx", "CG", false },
+ { LANGUAGE_USER_YOMBE, "yom", "CD", false },
+ { LANGUAGE_USER_YOMBE_CONGO, "yom", "CG", false },
+ { LANGUAGE_USER_SIDAMA, "sid", "ET", false },
+ { LANGUAGE_USER_NKO, "nqo", "GN", false },
+ { LANGUAGE_USER_UDMURT, "udm", "RU", false },
+ { LANGUAGE_USER_CORNISH, "kw", "UK", false },
+ { LANGUAGE_USER_SAMI_PITE_SWEDEN, "sje", "SE", false },
+ { LANGUAGE_USER_NGAEBERE, "gym", "PA", false },
+ { LANGUAGE_MULTIPLE, "mul", "" , false }, // multiple languages, many languages are used
+ { LANGUAGE_UNDETERMINED, "und", "" , false }, // undetermined language, language cannot be identified
+ { LANGUAGE_NONE, "zxx", "" , false }, // added to ISO 639-2 on 2006-01-11: Used to declare the absence of linguistic information
+ { LANGUAGE_DONTKNOW, "", "" , false } // marks end of table
};
static IsoLanguageScriptCountryEntry const aImplIsoLangScriptEntries[] =
@@ -586,7 +589,7 @@ static Bcp47CountryEntry const aImplBcp47CountryEntries[] =
};
static IsoLanguageCountryEntry aLastResortFallbackEntry =
-{ LANGUAGE_ENGLISH_US, "en", "US" };
+{ LANGUAGE_ENGLISH_US, "en", "US", false };
OUString IsoLanguageCountryEntry::getTagString() const
{
@@ -812,6 +815,19 @@ void MsLangId::Conversion::convertLanguageToLocaleImpl( LanguageType nLang,
// -----------------------------------------------------------------------
// static
+com::sun::star::lang::Locale MsLangId::Conversion::getLocale( const IsoLanguageCountryEntry * pEntry )
+{
+ if (pEntry->mbOverrideExists)
+ {
+ lang::Locale aLocale;
+ convertLanguageToLocaleImpl( pEntry->mnLang, aLocale);
+ return aLocale;
+ }
+ else
+ return pEntry->getLocale();
+}
+
+// static
::com::sun::star::lang::Locale MsLangId::Conversion::lookupFallbackLocale(
const ::com::sun::star::lang::Locale & rLocale )
{
@@ -887,7 +903,7 @@ void MsLangId::Conversion::convertLanguageToLocaleImpl( LanguageType nLang,
if (*pEntry->maCountry)
{
if (nCountryLen && aUpperCountry.equalsAscii( pEntry->maCountry))
- return pEntry->getLocale();
+ return getLocale( pEntry); // may override
}
else
{
@@ -900,7 +916,7 @@ void MsLangId::Conversion::convertLanguageToLocaleImpl( LanguageType nLang,
case LANGUAGE_USER_LOJBAN:
case LANGUAGE_KASHMIRI:
case LANGUAGE_USER_KEYID:
- return pEntry->getLocale();
+ return getLocale( pEntry); // may override
default:
; // nothing
}
@@ -921,7 +937,7 @@ void MsLangId::Conversion::convertLanguageToLocaleImpl( LanguageType nLang,
if (aLowerLang.equalsAscii( pEntry->maLanguage))
{
if (*pEntry->maCountry)
- return pEntry->getLocale();
+ return getLocale( pEntry); // may override
}
}
diff --git a/include/i18nlangtag/mslangid.hxx b/include/i18nlangtag/mslangid.hxx
index 6be7e66..95adb91 100644
--- a/include/i18nlangtag/mslangid.hxx
+++ b/include/i18nlangtag/mslangid.hxx
@@ -27,6 +27,8 @@
#include <com/sun/star/lang/Locale.hpp>
#include <vector>
+struct IsoLanguageCountryEntry;
+
/** Methods related to Microsoft language IDs. For details about MS-LANGIDs
please see lang.h */
class I18NLANGTAG_DLLPUBLIC MsLangId
@@ -230,6 +232,11 @@ public:
const OString& rLang, const OString& rCountry );
+ /** Used by lookupFallbackLocale(Locale) */
+ I18NLANGTAG_DLLPRIVATE static com::sun::star::lang::Locale getLocale(
+ const IsoLanguageCountryEntry * pEntry );
+
+
/** Convert a LanguageType to a Locale.
@param bResolveSystem
@@ -240,7 +247,8 @@ public:
I18NLANGTAG_DLLPRIVATE static ::com::sun::star::lang::Locale convertLanguageToLocale(
LanguageType nLang, bool bResolveSystem );
- /** Used by convertLanguageToLocale(LanguageType,bool)
+ /** Used by convertLanguageToLocale(LanguageType,bool) and
+ getLocale(IsoLanguageCountryEntry*)
@return rLocale set to mapped values, unchanged if no mapping was
found. E.g. pass empty Locale to obtain empty SYSTEM locale
More information about the Libreoffice-commits
mailing list