summaryrefslogtreecommitdiff
path: root/i18npool
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2013-04-03 16:31:16 +0200
committerEike Rathke <erack@redhat.com>2013-04-03 21:19:24 +0200
commitf51aff9e69b2eb5ad60167a055a969842eb3bcb8 (patch)
tree4d5ef2d4df5f70bbce711a881da00dfcd6798d43 /i18npool
parentf8e697abc35a3fb910859a26a23d8e3a9de6753e (diff)
let IsoLangEntry decide how to form a language tag string
Change-Id: I868cd8ea0610b6b8dd8155cdc72f7d238f279ef2
Diffstat (limited to 'i18npool')
-rw-r--r--i18npool/inc/i18npool/mslangid.hxx3
-rw-r--r--i18npool/source/isolang/isolang.cxx8
2 files changed, 11 insertions, 0 deletions
diff --git a/i18npool/inc/i18npool/mslangid.hxx b/i18npool/inc/i18npool/mslangid.hxx
index b3d04ecd6bb4..b29c6dfbfc48 100644
--- a/i18npool/inc/i18npool/mslangid.hxx
+++ b/i18npool/inc/i18npool/mslangid.hxx
@@ -180,6 +180,9 @@ public:
LanguageType mnLang;
sal_Char maLangStr[4];
sal_Char maCountry[3];
+
+ /** Obtain a language tag string with '-' separator. */
+ OUString getTagString() const;
};
/** @internal - Return a pointer to the IsoLangEntry of the underlying table,
diff --git a/i18npool/source/isolang/isolang.cxx b/i18npool/source/isolang/isolang.cxx
index 942cd84d27b6..e41d22892967 100644
--- a/i18npool/source/isolang/isolang.cxx
+++ b/i18npool/source/isolang/isolang.cxx
@@ -520,6 +520,14 @@ static MsLangId::IsoLangEntry const aImplIsoLangEntries[] =
static MsLangId::IsoLangEntry aLastResortFallbackEntry =
{ LANGUAGE_ENGLISH_US, "en", "US" };
+OUString MsLangId::IsoLangEntry::getTagString() const
+{
+ if (maCountry[0])
+ return OUString( OUString::createFromAscii( maLangStr) + "-" + OUString::createFromAscii( maCountry));
+ else
+ return OUString::createFromAscii( maLangStr);
+}
+
// -----------------------------------------------------------------------
// In this table are the countries which should mapped to a specific