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.
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.
I want to be able to update localized strings by code from the app. What I actually want to do is to make changes to the localization on a server and then let the iPhone application fetch updated localization strings from a server and then save them to the localizable.strings file.
You can't ! Those files are part of the bundle and can't be updated. You will have to setup the whole translation framework by yourself (which is not that much work) and implement caching using either core data or serialized dictionaries (one for each language I suppose).
You won't be able to modify the Localizable.strings file in your app bundle because the app bundle is read-only on iOS devices. To grab localized strings from a strings file in your app's Library directory, you could programmatically create a bundle at that location, put a Localizable.strings file in it and then grab the localized strings with NSLocalizedStringFromTableInBundle(). (I haven't tried this but it should work.)
There's service (Get Localization) that allows you to upload those .strings files to server and fetch them via API. However there's no client for iPhone yet but it would be quite simple to do. You can contribute one or then wait that there's official available.
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'm developing multi languages application and intent to have DONE button localized. This button is appear in UIWebView when user clicked on dropdown ("select" tag) with multiselect:
By default, this is always in English. However, if you set CFBundleAllowMixedLocalizations to YES in .plist file, you will be able to get it in current SYSTEM language:
Here, DONE is written in Chinese, when text in select in Arabic. It is because current system languages (i.e. set in Settings) is Chinese, but inside app I selected Arabic so app is using Arabic bundle with Arabic strings file.
I wonder, is any possibility to localize "DONE" button to current Application's language, but not system language?
Don't use "Application's language". Simply use the system language, like all other applications do.
I'm sure it's possible to somehow achieve it, but you're simply taking the wrong approach to localization.
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.