Fix CLDR C++ generation to name "Han with Bopomofo" properly

We were using "Han With Bopomofo" (capitalized With) so that an enum
member in qlocale.h would be suitably camel-case; however, this lead
to spurious changes in qlocale_data_p.h where it names the script.
Use the correct (lower-case with) form and arrange for the enum
members to be generated with first letter of each word upper-case (but
not with each word capitalize()d; some words in there are already
camel-case, so .capitalize()ing would lower-case the later sub-words
in these).

Change-Id: I974c89dd40814eaf3bd538f06b9b4ebf17492f20
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
This commit is contained in:
Edward Welbourne 2017-05-23 17:18:18 +02:00
parent 99dd95f3c2
commit 72900b3d88
2 changed files with 3 additions and 2 deletions

View File

@ -798,7 +798,7 @@ script_list = {
137 : [ "Newa", "Newa" ],
138 : [ "Osage", "Osge" ],
139 : [ "Tangut", "Tang" ],
140 : [ "Han With Bopomofo", "Hanb" ],
140 : [ "Han with Bopomofo", "Hanb" ],
141 : [ "Jamo", "Jamo" ]
}

View File

@ -148,7 +148,8 @@ def loadLikelySubtagsMap(doc):
return result
def fixedScriptName(name, dupes):
name = name.replace(" ", "")
# Don't .capitalize() as some names are already camel-case (see enumdata.py):
name = ''.join(word[0].upper() + word[1:] for word in name.split())
if name[-6:] != "Script":
name = name + "Script";
if name in dupes: