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
Related
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.
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.
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.
I'm trying to add a localization. I've read all those localization/internationalization guides from Apple and raywenderlich.com. I've marked all my code with NSLocalizedString macro, I've used genstrings to create Localizable.strings. But somehow I'm missing some important step.
When I try to add localization to my Localizable.strings I'm somehow restricted to English only.
When I try to add localization to project via "Editor"->"Add Localization" all language options are disabled.
Does anybody have any thoughts as to why am I restricted to English only? What have I missed?
I've tried to add localization to other projects with the same result. :(
You need to first add your localizations to your project. Click on the project file, ensure that the project, not the target, is selected in the middle pane and then choose the "Info" screen. There's a area called "Localizations" where you can add languages. You should then be able to localize your resources.
Another possible issue is that you are not selecting appropriately the project, which leads to all languages in the Add localization list being disabled.
By default the target may be selected, make sure you select the project instead. Then you can use the Add localization normally.
Something which kept me busy for too long. I looked over the language I needed (Swedish) in the first list and took the one from the "Other" list. Well my phone or emulator didn't change at all to Swedish. But when I took Swedish from the first list it got nicely updated when changing the language settings.
With Xcode 6, you can do it via Project Settings.
In Bombr 1.2 I added a half-assed French localization, over time adding more strings to localize I've decided to drop the French localization. In Bombr 1.2.1 I removed the reference to fr.lproj/Localizable.strings from the Xcode project but the file still exists. Now that 1.2.1 is on the app store it still says that French is a supported language.
Will removing the fr.lproj folder and resubmitting correctly display the supported languages (this is my hunch), or is it possibly that iTunes Connect will not allow you to drop support for a language?
(I took a year of French in high school for fun, but not enough to translate my own app.)
Building on the answer given by #vanya, select your project from the list and delete the language under in the "localization" section.
If you want to remove app metadata localization, there's a delete menu on iTunesConnect
try to look at the info.plist which defines localizations and I guess some work in iTunesConnect should be done as well, but before approving an app
To remove the localization from Xcode (I'm using 4.2 on Snow Leopard) click on the file/folder in the sidebar, "Localizable.strings" and open the File Inspector (keyboard shortcut cmd-opt-1 or View > Utilities > Show File Inspector in the menu bar). You'll see a Localization pane with your localizations listed. Select the one you want to remove and click the minus sign to delete it.
So I landed on this question, but with some specific criteria:
I want to remove the base development language (English)
I want to keep the localized language (French)
None of the above answers worked and I couldn't find anything better on Stack Overflow. Eventually I found this gem: XCode: Remove localizations on build.
I develop in English, so the entire base of the app is in the English localisation. I then translated it into Finnish for the first release, but the intention was to only release the Finnish content and not the English.
Setting up a small script during a final Build phase works wonders to strip unwanted localisations:
#Remove english
rm -r "${TARGET_BUILD_DIR}/${PRODUCT_NAME}.app/en.lproj"
# Remove base (iOS 9)
rm -r "${TARGET_BUILD_DIR}/${PRODUCT_NAME}.app/Base.lproj"
Then I had some runtime errors because some Storyboard files were localized and located in the Base.lproj folder. I worked around this by doing the following:
Un-localized those Storyboards (unchecked all languages) and then "Moved to trash"
Dragged the Storyboards from the trash back into the project. (Basically moving the Storyboards from Base.lproj folder – which the script would delete – to the project folder.)
Note: none of these Storyboards were actually localized (the .strings files were all empty). All the translations were properly set in code using NSLocalizedString.