summaryrefslogtreecommitdiff
path: root/i18npool/inc/i18npool/languagetag.hxx
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2012-12-11 11:46:19 +0100
committerEike Rathke <erack@redhat.com>2012-12-11 13:11:00 +0100
commit19095016e005bc084a1b032ac5c70abf82178e02 (patch)
tree3e263962e62ad53add72a33d9037d7132298b34d /i18npool/inc/i18npool/languagetag.hxx
parent54d6055685d0b4b24779708373f7641eeec7d7d6 (diff)
avoid liblangtag processing for known locales, and know 'qtz'
For "simple" known (to us) locales avoid the overhead of liblangtag, also in preparation of not having to initialize its database during startup. This also enables recognition of the 'qtz' pseudolocale for key ID resources again, see fdo#57413 Change-Id: Id52a1ddc37b42063e3bf68a6dbeaeacfbfa704ef (cherry picked from commit 4d24507451fbc2b7d72cf5f7048a424d52b63850)
Diffstat (limited to 'i18npool/inc/i18npool/languagetag.hxx')
-rw-r--r--i18npool/inc/i18npool/languagetag.hxx28
1 files changed, 24 insertions, 4 deletions
diff --git a/i18npool/inc/i18npool/languagetag.hxx b/i18npool/inc/i18npool/languagetag.hxx
index 0b3eeddd150f..bb86b72262f0 100644
--- a/i18npool/inc/i18npool/languagetag.hxx
+++ b/i18npool/inc/i18npool/languagetag.hxx
@@ -229,6 +229,7 @@ private:
mutable Decision meIsValid;
mutable Decision meIsIsoLocale;
mutable Decision meIsIsoODF;
+ mutable Decision meIsLiblangtagNeeded; ///< whether processing with liblangtag needed
bool mbSystemLocale : 1;
mutable bool mbInitializedBcp47 : 1;
mutable bool mbInitializedLocale : 1;
@@ -245,17 +246,36 @@ private:
void convertLangToLocale();
void convertLangToBcp47();
- bool canonicalize() const;
+ bool canonicalize();
- rtl::OUString getLanguageFromLangtag() const;
- rtl::OUString getScriptFromLangtag() const;
- rtl::OUString getRegionFromLangtag() const;
+ rtl::OUString getLanguageFromLangtag();
+ rtl::OUString getScriptFromLangtag();
+ rtl::OUString getRegionFromLangtag();
void resetVars();
+ /** Obtain Language, Script and Country via simpleExtract() and assign them
+ to the cached variables if successful.
+
+ @return return of simpleExtract()
+ */
+ bool cacheSimpleLSC();
+
static bool isIsoLanguage( const rtl::OUString& rLanguage );
static bool isIsoScript( const rtl::OUString& rScript );
static bool isIsoCountry( const rtl::OUString& rRegion );
+
+ /** Of a simple language tag of the form lll[-Ssss][-CC] (i.e. one that
+ would fulfill the isIsoODF() condition) extract the portions.
+
+ Does not check case or content!
+
+ @return TRUE if it detected a simple tag, else FALSE.
+ */
+ static bool simpleExtract( const rtl::OUString& rBcp47,
+ rtl::OUString& rLanguage,
+ rtl::OUString& rScript,
+ rtl::OUString& rCountry );
};
#endif // INCLUDED_I18NPOOL_LANGUAGETAG_HXX