diff options
Diffstat (limited to 'i18npool')
-rw-r--r-- | i18npool/inc/i18npool/mslangid.hxx | 3 | ||||
-rw-r--r-- | i18npool/source/isolang/isolang.cxx | 8 |
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 |