summaryrefslogtreecommitdiffstats
path: root/i18nlangtag
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2013-09-20 15:39:06 +0200
committerEike Rathke <erack@redhat.com>2013-09-20 18:31:05 +0200
commit01bde208acc429a0c65fdf6e65415ebea72e9ddc (patch)
treec1f4b2394072c8b752a1ea134e8b2a3dc7f08b77 /i18nlangtag
parentadded registerImpl() re-entered warning (diff)
downloadcore-01bde208acc429a0c65fdf6e65415ebea72e9ddc.tar.gz
core-01bde208acc429a0c65fdf6e65415ebea72e9ddc.zip
added isOnTheFlyID()
Change-Id: Ifddbec485814e3287e671e6bc4059689ca3f6c93
Diffstat (limited to 'i18nlangtag')
-rw-r--r--i18nlangtag/source/languagetag/languagetag.cxx11
1 files changed, 11 insertions, 0 deletions
diff --git a/i18nlangtag/source/languagetag/languagetag.cxx b/i18nlangtag/source/languagetag/languagetag.cxx
index 7d0359702860..ee4a1425cd7f 100644
--- a/i18nlangtag/source/languagetag/languagetag.cxx
+++ b/i18nlangtag/source/languagetag/languagetag.cxx
@@ -126,6 +126,17 @@ static LanguageType getNextOnTheFlyLanguage()
}
+// static
+bool LanguageTag::isOnTheFlyID( LanguageType nLang )
+{
+ LanguageType nPri = MsLangId::getPrimaryLanguage( nLang);
+ LanguageType nSub = MsLangId::getSubLanguage( nLang);
+ return
+ LANGUAGE_ON_THE_FLY_START <= nPri && nPri <= LANGUAGE_ON_THE_FLY_END &&
+ LANGUAGE_ON_THE_FLY_SUB_START <= nSub && nSub <= LANGUAGE_ON_THE_FLY_SUB_END;
+}
+
+
/** A reference holder for liblangtag data de/initialization, one static
instance. Currently implemented such that the first "ref" inits and dtor
(our library deinitialized) tears down.