summaryrefslogtreecommitdiff
path: root/i18npool/source
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2012-11-16 18:44:19 +0100
committerEike Rathke <erack@redhat.com>2012-11-16 18:45:05 +0100
commit3eb4304af99265c898835cd307ba7d689038996b (patch)
tree3f35698617a8fa89555382ba88dcdbefa1670d1d /i18npool/source
parentd0776ccbd5a7b69dc85fba214e0916f1b6bd2eb1 (diff)
added LanguageTag::getIsoLanguageCountry() method
Change-Id: I8917c2958f021f11933d9da7fec8ef01609387c8
Diffstat (limited to 'i18npool/source')
-rw-r--r--i18npool/source/languagetag/languagetag.cxx14
1 files changed, 14 insertions, 0 deletions
diff --git a/i18npool/source/languagetag/languagetag.cxx b/i18npool/source/languagetag/languagetag.cxx
index 3e655ee87bb3..f863ae2ca7b1 100644
--- a/i18npool/source/languagetag/languagetag.cxx
+++ b/i18npool/source/languagetag/languagetag.cxx
@@ -618,6 +618,20 @@ LanguageType LanguageTag::getLanguageType( bool bResolveSystem ) const
}
+void LanguageTag::getIsoLanguageCountry( rtl::OUString& rLanguage, rtl::OUString& rCountry ) const
+{
+ if (!isIsoLocale())
+ {
+ rLanguage = OUString();
+ rCountry = OUString();
+ return;
+ }
+ // After isIsoLocale() it's safe to call getLanguage() for ISO code.
+ rLanguage = getLanguage();
+ rCountry = getCountry();
+}
+
+
namespace
{