summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDenis Dzyubenko <denis.dzyubenko@nokia.com>2011-03-04 14:52:27 +0100
committerDenis Dzyubenko <denis.dzyubenko@nokia.com>2011-03-04 14:55:15 +0100
commit2a21c69a038c6aeee23b249ac70572a92f27ec1a (patch)
treea6eea2f971b162b8b1756c9e8f7c4a5bee2068d9
parentdc2280dbcd27d3ff9cbcb230943cc1036e8a2761 (diff)
Added convenience script enum values to QLocale.
Apparently SimplifiedHan and TraditionalHan are not widely used terms, hence adding convenience names SimplifiedChineseScript and TraditionalChineseScript. Also added the missing documentation for the Script enum. Reviewed-by: trustme
-rw-r--r--src/corelib/tools/qlocale.h3
-rw-r--r--src/corelib/tools/qlocale.qdoc27
-rwxr-xr-xutil/local_database/qlocalexml2cpp.py2
3 files changed, 30 insertions, 2 deletions
diff --git a/src/corelib/tools/qlocale.h b/src/corelib/tools/qlocale.h
index d5c41d07f5..4af6e82e5e 100644
--- a/src/corelib/tools/qlocale.h
+++ b/src/corelib/tools/qlocale.h
@@ -372,6 +372,8 @@ public:
LatinScript = 7,
MongolianScript = 8,
TifinaghScript = 9,
+ SimplifiedChineseScript = SimplifiedHanScript,
+ TraditionalChineseScript = TraditionalHanScript,
LastScript = TifinaghScript
};
enum Country {
@@ -734,6 +736,7 @@ public:
inline bool operator!=(const QLocale &other) const;
static QString languageToString(Language language);
+ static QString languageToString(Language language, Script script);
static QString countryToString(Country country);
static QString scriptToString(Script script);
static void setDefault(const QLocale &locale);
diff --git a/src/corelib/tools/qlocale.qdoc b/src/corelib/tools/qlocale.qdoc
index 4f5e0e575e..253edb31e0 100644
--- a/src/corelib/tools/qlocale.qdoc
+++ b/src/corelib/tools/qlocale.qdoc
@@ -118,6 +118,7 @@
This enumerated type is used to specify a language.
+ \value AnyLanguage
\value C The "C" locale is identical in behavior to English/UnitedStates.
\value Abkhazian
\value Afan
@@ -340,7 +341,7 @@
\value Shambala
\omitvalue LastLanguage
- \sa language()
+ \sa language(), languageToString()
*/
/*!
@@ -598,7 +599,29 @@
\value LatinAmericaAndTheCaribbean
\omitvalue LastCountry
- \sa country()
+ \sa country(), countryToString()
+*/
+
+/*!
+ \enum QLocale::Script
+
+ This enumerated type is used to specify a script.
+
+ \value AnyScript
+ \value ArabicScript
+ \value CyrillicScript
+ \value DeseretScript
+ \value GurmukhiScript
+ \value SimplifiedHanScript same as SimplifiedChineseScript
+ \value SimplifiedChineseScript same as SimplifiedHanScript
+ \value TraditionalHanScript same as TraditionalChineseScript
+ \value TraditionalChineseScript same as TraditionalHanScript
+ \value LatinScript
+ \value MongolianScript
+ \value TifinaghScript
+ \omitvalue LastScript
+
+ \sa script(), scriptToString(), languageToString()
*/
/*!
diff --git a/util/local_database/qlocalexml2cpp.py b/util/local_database/qlocalexml2cpp.py
index b8e4e896da..cf1ced6509 100755
--- a/util/local_database/qlocalexml2cpp.py
+++ b/util/local_database/qlocalexml2cpp.py
@@ -798,6 +798,8 @@ def main():
for key in script_map.keys():
script = fixedScriptName(script_map[key][0], dupes)
qlocaleh_temp_file.write(" " + script + " = " + str(key) + ",\n")
+ qlocaleh_temp_file.write(" SimplifiedChineseScript = SimplifiedHanScript,\n")
+ qlocaleh_temp_file.write(" TraditionalChineseScript = TraditionalHanScript,\n")
qlocaleh_temp_file.write(" LastScript = " + script + "\n")
qlocaleh_temp_file.write(" };\n")