How do i add base language in settings bundle.
In my project, i have added two .strings file (french and english) inside settings bundle. I could see the languages reflecting on my app under iPhone settings screen. But when i select different language other than above two languages, the last shown language is displaying. for eg, if i select french as my default language, it is showing french but when i select swedish as my language (i have no swedish language in project), it still shows french. But i need to show English as Base Language. This is working on Localizable.strings inside the project. But this is not reflecting on settings bundle.
Any Idea!
Base language is not a "default language". In fact, in iOS doesn't exist the concept of default language as you think. See the answer of this question.
Related
I am trying to add localization on my project. Right now I have my main project, and all the text in the Main Storyboard and the .swift classes is in language Norwegian. I have another project where everything is in English, but I want to only use one project with both languages, so I can have one app only on the app store. I have about 20 different classes, and some classes contain multiple arrays with over 400 strings each. How exactly do I add English language to my existing project?
According to Apple guidelines, the default language of your app will be based on the user device default language settings.
To add localization to your xcode project, start by the adding the language you want from Project navigator -> Info -> Localizations tab and select the language you want to add. After selecting the language, a popup will appear to select the resource that you want to include in your localization:
You will notice that you will have a new .string file under your selected resource (for example, Main.storyboard) where you can do all the translation you want.
There are other topics like localizing strings from your code (for example, having a .string and an extension to your String) or image localization.
I need to set Spanish as development language for an iOS app. I'm already using Xcode 6, and I changed the Localization native development region entry in app's Info.plist (CFBundleDevelopmentRegion) from "en" to "es". However, in Project > Info > Localizations, English remains set as Development Language.
As said in Information Property List Key Reference, CFBundleDevelopmentRegion specifies the default language. I need to set Spanish to the default language, what am I missing?
Thanks
Here's how you can do this:
Add the language you want to be your Base language first. Uncheck all of the files that Xcode offers to localize for you.
In the Info.plist, change the development region to the language that you want to be your base language. Note that the property is a bit misnamed, because its value should be a language code (with an optional country code), rather than a region or country code.
Close your project in Xcode. In another code editor, open projectname.xcodeproj/project.pbxproj and search for developmentRegion. You should see a line like developmentRegion = English;. Change this to reference the same language you put in your Info.plist file.
Reopen the project in Xcode. Go through all your localizable files and check the boxes next to English to generate the localizable resources. Note that for storyboards and xibs, Xcode might create a storyboard instead of a strings file. If that happens, just change the filetype to strings file.
Here's an example of the result for me using fr as the Base language:
For Xcode 9 through 13:
Close Xcode.
Open your project.pbxproj in a text editor
Look for developmentRegion and set its value (es for spanish, fr for french,...)
Look for knownRegions and add the new language to the list
Open Xcode: Your project info should now show the language name with Development Language next to it.
In your project's .xcodeproj file, search for the string developmentRegion. Supposedly, it says "English" right now. If you change it to "Spanish", Xcode 6 should recognize Spanish as your project's default localization language in the "Info" tab as long as you add "Spanish" to the list.
You can read more about this topic at http://eschatologist.net/blog/?p=224
open your target -> info -> change "Localization native development region" to your language
Changing the default localization is now natively supported as of Xcode 14.3. It can be configured from the language menu in the project editor’s Info tab.
For someone that needs help like I did, I have two targets, one I want to be EN Base localization and second target I need to be another language.
The option mention above: "change projectname.xcodeproj/project.pbxproj and search for developmentRegion and change ..." doesn't work for me because of targets.
What worked for me, Xcode 11.5, is that only I need to change the language code in the "Localization native development region" for that particular target and it works, no need to change anything in projectname.xcodeproj/project.pbxproj
P.S.
Here "Localization native development region" must go country code like fr_Fr or in my case hr for Croatian
There are a lot of posts on this but all seem to be an out of date method? It seems its done using info.plist and adding localization to it and then more info.plist files are created within for each language. It seems to be working but only ever displays the English Bundle display name no matter what system language I use. Not sure what else needs to be done. I checked it on both the simulator and a device.
you need to create "InfoPlist.strings" and add languages which you want to support there, then set your bundle name and display name as the following for each language
"CFBundleDisplayName" = "App Name";
"CFBundleName" = "App Name";
How to enable Localization and add more language to your project.
Choose your project on the tree.
Choose your project.
Info Tab -> Localizations.
Choose which language you want to support.
then on your strings file, when you choose it, on right side you can find which languages you want to support into this strings file.
I'm in the process of adding French Localization for an iOS app. After turning on the French localization via the localization settings in the project properites, I ended up with a project structure that doesn't appear correct.
The "fr.lproj" folder is nested under the "en.lproj" folder and appears as follows:
/Resources/en.lproj/
...
InfoPlist.strings
Localizable.strings
..
/Resources/en.lproj/fr.lproj
...
InfoPlist.strings
Localizable.strings
..
For all the other locations where a .lproj folder exists, the "en.lproj" and "fr.lproj" folders are at the same level. However, for this location it's not. I've tried moving the fr.lproj to the same level however it causes the project to have errors. I do not see a place to edit this location after moving.
If you change the localization of the project, I think (not sure) you change the default language of the project.
If you just want to test the French localization texts, you can leave the project language setting to English. But you have to change the language setting in the emulator or on your test device to french and then restart your app. The device language setting is stored, so you only need to restart your app the first time you change the language.
I'm localizing an app for the first time, and only need to localize my "Localizable.strings" file. To set that up I created the file, then selected it and pressed the "Make localized..." button and it let me add an English localization (I haven't added any other languages yet).
To my surprise, with Xcode 4.4, doing that also automatically localized these files, moving them into the "en.lproj" folder:
InfoPlist.strings
MainStoryboard.storyboard
I don't need or want to localize the storyboard file, as there's nothing in it that's language based... and as far as I know, I don't need to localize InfoPlist.strings either (unless I decide to localize the app name?).
So, how do I unlocalize a file?
I see there's an option for "Use base internationalization" which from my understanding would use a base main storyboard rather than localizing it. That sounds like what I need, but according to the Xcode 4.4 release notes that won't work on iOS projects:
The Use Base Internationalization setting in the project editor works
only on Mac products for deployment on OS X v.10.8 and later. Xcode
must also be running on OS X v.10.8 or later. This setting is not
supported on iOS projects. 11712855
https://developer.apple.com/library/mac/#releasenotes/DeveloperTools/RN-Xcode/_index.html
Thanks for any help.
If you select a file and look at the info for that file. Under the "General" tap there is a section for localization with a +/- for the various languages. Just remove all the languages from there and it will no longer be localized.