I’ve tried this but still see the Japanese title under the icon which is very strange - I’ve attached the very simple code I’ve used…I don’t suppose you can see where I’m going wrong?
oh - I just noted that: system.getPreference on my Mac is giving back “zh-Hant” not “zh”. So I wonder if this is an issue if:
a) CFBundleLocalizations in build.settings has “zh”, and
b) directory name for InfoPlist.string is “zh.lproj”
Any ideas?
Ref from api:
system.getPreference()
print( system.getPreference( “ui”, “language” ) ) – print the ui (device) language (eg. en)
well did get things working by adding additional:
a) line items in CFBundleLocalizations for “zh-Hans” and “zh-Hant”, and
b) two additional directories for the InfoPlist.strings to cover “zh-Hans” and “zh-Hant” as well as “zh”
That’s good to know.
I assumed that zh would have been chosen by default for both zh-Hans and zh-Hant if there were no specific localizations for the Simplified and Traditional variants.
Be aware that they are two different scripts though. Traditional Chinese (zh-Hant) is the official script for Taiwan, whereas Simplified Chinese (zh-Hans) is the official script for mainland China.
If you specify both zh-Hans, and zh-Hant in CFBundleLocalizations, then you’re telling your users that the app supports both scripts. I’m not sure, but this may cause some backlash (review-wise) unless it’s actually been translated to both variants.
the plot thickens thanks for the education ingemar - I think I’d better stick with zh-Hans for the moment and see how that goes
One thing you can do is to only specify zh-Hans in your CFBundleLocalizations, but keep all the .lproj directories. That way the app is advertised to support Simplified, and should pick up the Simplified Chinese script even if the device is set to Traditional.
hi batgirl/guys - just getting to the point of implementing this and having troubles (on IOS) - wonder if you could confirm it I’ve got it right.
So to get localized app titles (under the icon) you need to the following? I’m doing this but I’m still not seeing the app title change under the icon when I change the “LANGUAGE” setting of my iPhone.
a) put CFBundleLocalizations in build.settings per below
settings = { iphone = { plist = { CFBundleIconFile = "Icon.png", CFBundleIconFiles = { \<\< cut for this put \>\>}, CFBundleLocalizations = { "English", "French", "Japanese", "Chinese", }, }, },
b) put a ‘InfoPlist.strings’ file for each language in a directory like ‘fr.lproj’ under the root. In the strings file put:
CFBundleDisplayName = “Parachutiste”;
Is this all that’s required? I must be either (a) missing something here or (b) misunderstanding how to test a change of language on my iPhone to test this?
greg886, that should do it. just to confirm how you’re changing languages, you’re going into settings > general > international > language and selecting the language, then done, right? Then it’ll go blank for a few seconds, then reboot in the chosen language. Usually the native app titles will be localized (settings, pictures, etc), so you can check those to make sure you’re in a different language.
thanks - think I have it - I made two changes so one of these worked:
a) put a CFBundleName = “xxxx”; line in as well as the CFBundleDisplayName
b) noted that the inverted commas I’d used (from a copy paste) were ones with a slight angle in them, so replaced with the normal ones - doh. I never even saw the difference but I’d just copied pasted the lines from another file to make sure I had the spelling right, then it worked, and on closer inspection noticed it
Oh - I’m still not sure which language line in the iPhone languages list to trigger the “zh” (chinese) - don’t suppose you know which one?
Hi there,
Traditional Chinese (official language of Taiwan)
Simplified Chinese (official language in mainland China)
Scroll down in the language list and find these “squiggles”
PS.
Option b above in your post was the culprit.
thanks ingemar for confirming. Oh I’m pretty sure I’ve tried these but didn’t see the localization being picked up. I’ll try again, but while you there, I have 3 languages working fine, but for Chinese I’m using the following…i.e. just in case you see something obvious:
In build.settings:
CFBundleLocalizations = {
“English”,
“French”,
“Japanese”,
“Chinese”,
},
In zh.lproj/InfoPlist.strings
CFBundleDisplayName = “伞兵”;
CFBundleName = “伞兵”;
In my code: looking for “zh” to match self:getDeviceLanguage()
You don’t need CFBundleName in InfoPlist. You can take it away (That’s the filename you internally give the app).
It’s recommended to use 2-letter country codes instead of country names in CFBundleLocalizations.
My suggestion would be:
CFBundleLocalizations = {
“en”,
“fr”,
“ja”,
"zh,
}
A full list of country codes can be found here:
ok thanks - that makes much more sense - I’ll try this…
I’ve tried this but still see the Japanese title under the icon which is very strange - I’ve attached the very simple code I’ve used…I don’t suppose you can see where I’m going wrong?
oh - I just noted that: system.getPreference on my Mac is giving back “zh-Hant” not “zh”. So I wonder if this is an issue if:
a) CFBundleLocalizations in build.settings has “zh”, and
b) directory name for InfoPlist.string is “zh.lproj”
Any ideas?
Ref from api:
system.getPreference()
print( system.getPreference( “ui”, “language” ) ) – print the ui (device) language (eg. en)
well did get things working by adding additional:
a) line items in CFBundleLocalizations for “zh-Hans” and “zh-Hant”, and
b) two additional directories for the InfoPlist.strings to cover “zh-Hans” and “zh-Hant” as well as “zh”
That’s good to know.
I assumed that zh would have been chosen by default for both zh-Hans and zh-Hant if there were no specific localizations for the Simplified and Traditional variants.
Be aware that they are two different scripts though. Traditional Chinese (zh-Hant) is the official script for Taiwan, whereas Simplified Chinese (zh-Hans) is the official script for mainland China.
If you specify both zh-Hans, and zh-Hant in CFBundleLocalizations, then you’re telling your users that the app supports both scripts. I’m not sure, but this may cause some backlash (review-wise) unless it’s actually been translated to both variants.
the plot thickens thanks for the education ingemar - I think I’d better stick with zh-Hans for the moment and see how that goes
One thing you can do is to only specify zh-Hans in your CFBundleLocalizations, but keep all the .lproj directories. That way the app is advertised to support Simplified, and should pick up the Simplified Chinese script even if the device is set to Traditional.
actually just coming back to the Android steps required to get the app name displayed localized on Android & found ingemar steps - thanks
Anyone know if Coronalabs is planning to support this process so you only need to build once with corona and then get the final apk that will work?