I wrote a game with cocos2d and translated all the image and text in the
game in two different language.
When the app launches, I load different resource according to the locale of
the device and this worked all OK.
Then when I upload this app for review, I first named it say "test".
Then in the localization part I add a language "Japanese".
But I found that in the "Japanese meta data part", I can edit a lot of
things except the "app name" which is "test". But I want my app to show
different names according to the locale of the device also.
Can somebody tell me how to get this work? Thanks in advance...
You can create a file called InfoPlist.strings in each of your language specific directories, and set a language specific value for CFBundleDisplayName.
Related
Hello everyone I wanted to have information ...
I changed the development language on Xcode EN -> IT
Now I wanted to know if these changes will remain even when I publish the app on the app store or if they remain only during development
My app is for Italy only and I wanted to know if I can avoid entering Locale(identifier: "it") for each date display, now that I have set the development language to Italian.
You will want to go to File > New File > Strings File, name it Localizable.strings, this is important.
Open the attribute inspector. Click Localize..., select your language.
In your file, for each piece of text you want to show in your app, come up with an identifier/key for it, then write as follows:
"welcome_message" = "Welcome to my app!"; // This would be in your English file.
Then do the same thing for each language you want to support, but just change the phrase itself in each file, and keep the same key/identifier.
Then when you want to use that phrase in your app, replace whichever String with NSLocalizedString("welcome_message", comment: "")
No need to set Locale(identifier:String) in your files. The app will look for the device's set language and use the corresponding Localizable.strings file.
For example, my app supports French and I would like to use my French screenshots in both the French (fr-FR) app store, but also in the French Canadian (fr-CA) app store as well.
In the interest of time, I'd like to only run one of these during my screenshot creation phase, so I only have fr-FR under my languages option in my snapfile.
Therefor, is it possible to route the screenshots under fr-FR to fr-CA as well within iTunes Connect when running fastlane?
Looking through the upload_to_app_store documentation, I have not found anything that appears to address this.
I added a shell file that runs a copy script to create a new folder and copy the contents from French into the fr-CA folder.
I am trying to localize a pass and save it in the iOS wallet.
The problem is that while the text on the back of the pass properly localizes, the strip.png image does not.
The strip.png image will be the image that was originally exported from my app.
So if my app was currently using the Spanish language, the Spanish strip.png would be exported. If my language was set to English the English strip.png would be exported.
However, once it lives in the wallet app the strip.png no longer changes. If the strip.png was in English and I switch the language to Spanish, the strip.png would still persist while the text on the back of the pass would change to Spanish as expected.
My .pkpass object contains two folders: en.lproj and es.lproj.
They both have their own localized version of strip.png and pass.strings file.
What am I doing wrong?
If localizing a strip.png is not supported then what are some other alternatives?
You have come across a "feature" of Wallet, designed to save space on a user's device. The rationale behind this feature is that users rarely change their base locale.
Once a .pkpass bundle has been installed on a device, all of the unnecessary image assets are dropped.
If, as it sounds, your pass is installed with the correct locale image, then your bundle is correct. Unfortunately this means that to demo the locale functionality, you will need to delete and then reinstall the pass with a new language setting.
We're currently at the stage of looking at localising our app in to multiple languages now that the general concepts of the app have been decided. This is something I want to ensure is done correct from the start to lower the risk of headaches in the future.
The app targets iOS 7 and above, uses storyboards, and is written in Swift.
Storyboards
When working with a storyboard (or a xib), what's the best way to mark a UI element as "not to be translated"? For example, I have a placeholder string for a user's display name (Display Name), which will be replaced by a users display name at run time. This display name will not be localised, but neither should the string "Display Name". Is there a method of not having a UI element's value automatically put in to the strings file? If not, is going in to that file and manually removing strings I don't want localising a sustainable option?
Strings In Code
I'm using the Swift function NSLocalizedString with the key and comment parameters. Some places I've seen say to set the key to be a unique id based on the context (e.g., intro.login-button-text), while others seem to just put the full string in the default language (e.g., Login). I like the idea of the unique ids for the key, but would this not go against the idea of the "base" language?
Exporting
Xcode 6's "Export For Localization" option seems very useful for getting the correct format of file to be sent to translators. However, as mentioned previously, placeholder text does not need to be translated. Should these placeholders be removed from the exported xliff or the strings file prior to export?
Looking for the the same questions myself. Hope this will help you and others. Also I would recommend to have some kind of tool to organize the xliff/string files
Storyboards:
I've seen developers putting non translating texts in storyboard with extra parentheses. i.e. {Display name}.
By using this you can see by the translation itself if it needs to be translated or not. We use oneskyapp.com and can select to hide those translations and they will be hidden for each import of that key.
Strings in Code
By following this thread they suggest to use keywords.
Best practice for key values in translation files
Exporting
I cannot find a way to have some translations automatically removed when exporting. Off course you can put the views which has dynamic fields in different XIB/storyboards and decide not to translate those.
Again a tool like onskyapp.com can help you with this.
Formats
As of context with the field is important and a translation can be different when it is followed by i.e. a users name I would go for "%1$# is online!"
I have a very simple app which only contains a PickerView, UILocalNotification, UIAlertview and less than 8 views. What I want is:
I have a main view which contains two buttons one says English and the other says French.
What in my mind is:
When the user hits English it'll take him to the Project I have right now,
However, when the User hits French it'll take him to a duplicated views that I'd simply and manually change and translate it's labels into French.
** Now my question is ** how do I translate the PickerView, LocalNotification and the AlertView? and how to connect the French button to these translations?
From what I've googled and read here in SO is that I can get the strings out and list them into Localizable.strings but I still don't know how to make my french button ask for these strings? Also, is there an easier and simpler way? any idea?
Thanks,
Kindly try this for doing localization
http://www.raywenderlich.com/2876/how-to-localize-an-iphone-app-tutorial
For buttons use something like this
[self.yourButton setTitle:NSLocalizedString(#"YOUR_KEY", #"Comment") forState:UIControlStateNormal];
Do not duplicate your views and view controller just for the sake of localization, considering that for both languages have the same layout and everything only thing that would change is the language. So add English strings and French strings to your project and use NSLocalizedString to get these values.
Note:NSLocalizedString works with device language only so if you want to change the app's language manually try this. I have used AMLocalizedString in many of my projects and they work fine.
Hi as you want to make it localized only at App basis not at device basis hence NSLocalisedString will not work you have to manage it so you have to take two different files and you have to fetch the string value on the basis of selected language. In similar manner as LocalisedString works as in localization there are multiple .strings file created for languages and it works in a way to select default language of the device and shows the text from the localised file.