Adding localized files to a new IOS 7 app - ios

I'm starting to studying app localizations and I'm stuck at the very beginning.. I've created a new project called LocalizedStrings2:
I click the plus button to add Italian Language and it offers me to localize 2 InfoPlist.strings files:
Is this correct? BTW, I add the italian language:
Then I've wrote the following code in the English InfoPlist.strings file:
"ERR_MSG" = "Error Message!"
The following line has been entered in the Italian version of the file:
"ERR_MSG" = "Messaggio d'errore!"
When I compile I receive the following error (I have the same error even if the two files are empty:
Any hint or good reference for up-to-date How To Localize my IOS App documentation?
Thanks in advance for any help!
Gianni

I was facing the same problem for many days. Then I figured it out…
Just put a ; at the end of the line and it's fixed! :D

Recommendation
I don't think you should have two English references to your file in the UI. Change one to italian and verify that the files are in the proper location in your finder folder.
I would then consider removing the file references from the project and re-add them. I've noticed some peculiar behaviors when using localization for older versions of the SDK in Xcode 5+. BTW - If you are planning to support a deployment target of iOS5 you will need to remove the Base localization setting and just create the localization folders manually (inside the project folder in Finder). After you re-add the files I would check the Build Phases > Copy Bundle Resources > search for plist to verify that ProjectName/(localization).lproj is found.
NOTE
Please check out the updated documentation and let me know if that is a sufficient answer.
Internationalizing Your App

I guess the second InfoPlist.strings file derives trom your tests.
Check out the "Supporting Files-Folder" in your apps test target.

Related

The file “Main.strings” couldn’t be opened because there is no such file.

After attempting to localize a project (originally created in Xcode 6) I am seeing an obscure error in the debug navigator.
Steps performed
Enable Base Localization
Add strings file for an additional language (Portuguese)
Edit the scheme to changing the Application Language and Application Region to Portuguese (Brazil) and Brazil respectively.
Result
"The file “Main.strings” couldn’t be opened because there is no such file."
When attempting to select the file I am presented an alert.
"The document "Main.storyboardc" could not be opened. Interface Builder cannot open compiled nibs."
As a sanity check I created a new project with the same setup (using NSLocalizedString) and ran through the same steps listed above. I provided alternate translations for the additional language, then built and ran the project which worked as expected presenting the alternate translation of strings.
Environment
Xcode 7.1.1 (7B1005)
OS X 10.11.1 (15B42)
I have already attempted following this answer but the question and answer don't quite apply to the issue I'm seeing.
I'm at a loss here. Any advice?
What do the error and alert indicate?
Why does one project (created with Xcode 6) fail when attempting to localize and yet a brand new project (created with Xcode 6) succeed?
I faced the same issue while on a project that was also created on Xcode 6. I resolved the issue in following way without compromising on localization of storyboard file:
Import the XLIFF for localized language (in my case, it was French)
Try to run the app, it will show the mentioned error
Now, right-click on storybook file and click on “Show in Finder”
From the directory location, move out the .storyboard file from Base.lproj folder
Now go back to Xcode, and remove the storyboard file (only reference)
Now, drag the .storyboard file from its new location into the project
Now, add localization from ‘File Inspector’ for .storyboard file. You can use existing .strings file for localization
Everything should work fine now.
I never found a solution to this problem by using Main.strings. Instead I kept all translatable content in classes allowing me to rely solely on Localizable.strings.
Remove app from device, clean & build your project.

How to add a localization to a settings.bundle?

My app supports two languages. When I add a settings-bundle, it´s only in english. In Xcode 6.1 I found no way to add a localization to Settings.bundle. Did I miss something?
Nevertheless I found a working solution.
1) open Settings.bundle package
2) create new folder de.lproj (dont´t duplicate en.lproj - Finder don´t likes this)
3) copy Root.strings from en.lproj-folder to de.lproj-folder
4) now you can edit the new language in Xcode
It seems not working in Simulator. I am using Xcode 8.2.1.
OK. I find out the issue. In my Xcode project, the file Root.plist in Settings.bundle, there is one item missing: Strings Filename. I added this entry and set its value to Root, which is for language localization. With this missing item added, my app settings are working as expected in Simulator!
See my blog on this for more information.

Error when localize ios app to support multiple languge

I have two questions
Have any tutorial for localizing iOS app to support multiple language with app not using storyboard?
I doing my app without storyboard, I localized it by created Base.lproj folder in my project direction, copy .xib to it, and added language in Project->Info->Localization.(I tested successfully on demo) but with my app when I build and run on simulator my app doesn't update according to setting language on simulator, it only update when I rebuild. Anyone could give me a reason or doubtful questions?
When you localize resources in your Xcode project, you don't need to copy anything: Xcode does everything for you. If you start copying things here and there, you might get lost, and files might not even get copied to your app bundle.
What you need to do is:
1/ Reference all languages in your Xcode project
2/ Create a new "Strings" file in your project using Xcode, call it "Localizable.strings", and create localized versions of it through Xcode, using the "Localization" pane in the File inspector
3/ Once you have created multiple versions of your Strings file, enter a sample string that you will test in your app, like:
"HELLO_STR" = "Hello, world";
in your English version, and
"HELLO_STR" = "Bonjour tout le monde";
in your French version.
Then in your application startup code, add this line:
NSLog(#"%#", NSLocalizedString(#"HELLO_STR", nil));
The message logged in your console should now correspond to your device or simulator language setting.
4/ You now need to add all localized strings to your Localizable.strings files.
5/ As for the XIBs, it works exactly like the Storyboards: you can ask Xcode to create a localizable version of all your XIBs. They are copied and bundled by Xcode in much the same way as the strings file we already built in steps 1-4. It is better to do that once you have "finished" designing your interfaces, because any subsequent modification to one localized XIB version will have to be repeated in all other localized versions.
Good luck.

iOS: Localization gone wrong

I'm starting to get confused..I've wanted to finally add my translation file for all strings to my app according to ray wenderlich's tutorial. But somehow now everything got messed up. I removed now every localization again, which deleted my strings file, the storyboard etc. And now I have no localization language set in the project settings and I've copied all files back from the trash.
But my localized string (NSLocalizedString(..)) somehow don't load..or load something else. I've changed some of them to check if my strings file in the project explorer is actually used but it still uses the old strings and I have no idea from where..I've checked the project folder and there aren't any other files.
How can I set up everything again that it works? How can I set the strings file it should use? And how should I set up then the localization, with or without base language?
Edit: And in the simulator I cannot get my app running..it's showing only a black screen. Whereas on my iphone it still works (if I use my iphone from Xcode).
I guess I've deleted all my languages in project settings and now I cannot add any localization anymore :-(
Here's what I would try:
Check your project folder for any leftover .lproj folders / .strings file and delete
Clean / Build
Start localization from scratch following SmoothLocalize's Tutorial
This should delete all old files and create a new default localizable.strings, and then you can add more languages.

iOS - error during archiving noting UAPushLocalization.bundle/en.lproj/Localizable.strings

I created a new set of controllers and when I tried to archive the new code, I got this error which happened when the archiving was going over those controllers:
error: open /Users/owner12/Library/Developer/Xcode/DerivedData/Marketing-eusiyfrkjsbjfxdgpauubwhvpazb/Build/Intermediates/ArchiveIntermediates/Marketing/InstallationBuildProductsLocation/Applications/Marketing.app/UAPushLocalization.bundle/en.lproj/Localizable.strings: No such file or directory
I understand that it is talking about the push-enabling library. And something about some localization setting.
But I have no idea how to fix this.
Would anyone be able to suggest how to fix this?
And here is the screen shot of this reference highlighted in red in the Build Phases --> Copy Bundle Resources list.
Thanks,
Alex
Xcode has some weird issues with localization from time to time. I would recommend you to copy all the text in the EN localization file (expand the localization strings file and select the english one "en"). Paste it somewhere, right click the file, show in finder, delete, select the localizations file, uncheck localization for english, clean your project, select the localization file, check the english one (a new file will be created) and paste your strings here.
Also make sure there are no typos in it.

Resources