Bahasa Melayu in iOS - ios

I have an App whose target audience is based in Malaysia and can read and type in Malaysian Language. I have Localizable.strings file in Malaysian language.
There is an option in iOS for "Bahasa Melayu" in Language selection in Settings.app
I want to know which language should I select in Xcode so that my the device chooses the correct Localizable.strings file.
Any other details I should provide?

You have to use the abbreviation ms.lproj for the folder. I heard, all indonesian countries learn bahasa at school and I created also a folder with the same files inside a folder called id.lproj. Maybe you can tell me, if it's right that most people in Indonesia talk bahasa like a basic language.
The folders should look like this
If you insert the localization folder into your project it looks like this:

Related

How to set Base Localization & Development Language in Xcode 12(.5)?

I'm writing this question because a lot of information on Stackoverflow (and even Apple's developer website) about this topic is unfortunately partially outdated:
I want to support multiple languages in my Xcode 12.5/Swift 5/iOS 12.3+ app: German as the default language and English as a "fallback".
Currently the "Info" tab lists two "Localization" languages:
The "Localization" section of the File Inspector for both my Main.storyboard and LaunchScreen.storyboard file look like this (by default):
"Base" is checked and that's why the first screenshot shows 2 files for it.
The language in Info.plist is set to the following:
So far I haven't touched the actual localization settings yet and I've been using the same language for every label,... in XIB (which is probably saved in "Base").
According to Apple's old Localization Guide, "Base" is the default language that is used, as long as it's included in the user's language settings (so in my case: German). The "Developer Language" is the "fallback" language that is used if the user's language settings don't include the base language (in my case: English). This Q&A page also says:
If you adopt Base Localization, make sure that the value of
CFBundleDevelopmentRegion matches the language used by your content in
the Base.lproj folder.
... and in this guide enabling the base localization for "English - Development Language" for both storyboards adds 2 localized files to it, without actually adding another ("Base") localization to the list. As you can see on my first screenshot, "Base" and "Development" are separate list entries, which wasn't the case in earlier Xcode versions.
My first question is: Did I understand all of this correctly? It's a bit confusing that the quote sees "Base" and "Development Language" as the same thing, even though you can of course have a default language that isn't the "fallback" language.
The same Q&A I linked above also goes into detail about regional versions of a specific language:
If my app supports "German" (language code: "de") but the user's language settings only list e.g. Austrian German ("de_AT"), then the app is still going to set its own language to German. Let's say I want to use Swiss German (de_CH) as the default language but the user only picked Austrian German ("de_AT") in his settings, does this still work the same way? Should you rather set your app's default language to the regular non-regional language (German = "de") instead, even if the labels,... use e.g. Swiss German words?
How do I change the "Base" language to German (let's say, "de_CH") and also make it appear as that in the list, while using English ("en") as the "fallback"? I did find a similar question but unfortunately the steps described in the answer don't work the same way in Xcode 12.5. anymore.
What I wanted to achieve:
Support English but use German as the default language that is also used if the user's language settings don't include English or German.
How I achieved this in Xcode 12.5:
Add "German (de)" to the "Localizations" list via the little "+" button. In the new Choose files and reference language to create German localization pop-up every storyboard file should already be ticked by default. This adds .strings (German) localization files for all storyboards in the Project Navigator on the left:
In Main.storyboard's File Inspector tick the "English" box in the "Localization" section (this might take a while). This adds an additional Main.strings (English) file in the Project Navigator. Repeat this step for each storyboard, including the launch screen.
To change the "Development Language", which is the language the app uses by default and also if it doesn't support any of the languages the user set in their device's language settings, close Xcode, then open the project's .xcodeproj file with a text editor (I used BBEdit, which is free). There should be a list of files, including project.pbxproj. Open it and set developmentRegion (= development language) to the language code of the language that you added in step 1, so in my case "de". Do not use a different code (e.g. add "German (de)" but set it to "de_CH") because that's going to create an additional localization.
There are now two ways to finish this part of localization:
A. Leave it as is. Changes in storyboard aren't going to affect any of the .strings files. Advantage: The text can be edited directly (without using storyboard), which is useful if you aren't the person who's working on the translations. Disadvantage: You can't quickly see and test the changes to a translation in storyboard but have to run the app in the simulator or on an actual device.
B. Use the default language as "Base" language: Untick "German" for every storyboard and hit "Remove" in the pop-up, which removes the localizations in the list. This way changes to the storyboard affect the default language, which makes it easier to test changes.
I used version B:
Important:
These .strings files are only used for storyboards! If you also want to set localized text at runtime using NSLocalizedString (e.g. for an error dialog), then you have to add an additional Localizable.strings file (more details here):
File - New - File - Strings File - Call it Localizable.strings
Click "Localize" in its File Inspector and pick one of the languages you want to use in code.
Afterwards, also in the File Inspector, you can tick the other languages in the "Localization" section (including the development one).
Bonus infos:
You can change the app language of the simulator through the scheme:
Product - Scheme - Edit Scheme - Run (left side) - Options tab (right side) - App Language
You can also show a preview of the currently selected UIViewController and change its displayed language without starting a simulator:
Editor - Preview - In the new preview window on the right there's a button in the bottom right
Disclaimer: I found this solution by testing different things, as there's currently no tutorial for this (using the latest Xcode version). If this is not the "right" way to do localization, please post your own answer and I'll check it out.

Can't choose "More" when choosing application language in Edit Scheme

I'm trying to account for both English and Georgian and an app I'm developing. I had added the localization language to the project, have all the storyboard languages setup and the strings files.
I now want to test to see if the text translates correctly.
However, when I go to Edit Scheme and find the application language drop down it doesn't have Georgian.
When I added the localization in the project settings I could go to a More menu that had LOADS of languages. Why does this not exist in the Application Language drop down in the scheme settings?
EDIT:
Tried the solution below by adding language and locale as arguments:
I have what I believe is the correct setup for translating strings depending on the language of the phone etc.
The Xcode scheme Debug options only include a subset of languages plus pseudolanguages for testing. However, there are workarounds.
If you want to see if text translates correctly, do one of the following:
Go to your scheme's Arguments tab and add the AppleLanguages and AppleLocale to the "Arguments Passed On Launch" section.
For example, to select the Georgian language and the Georgian region, you'd add:
-AppleLanguages "(ka-GE)"
-AppleLocale "GEO"
   or:
On the device or simulator, set the region and language in the device's Preferences and then run your app.
More here: Internationalization and Localization Guide
Note that the ISO language code for Georgia is "ka-GE", not "ge". You should have "ka-GE.lproj" as your localization folder name.
The language code comes from the ISO codes here: ISO 639-2 codes, and the region code comes from these: ISO_3166-2 codes
One other thing I just noticed is that your string translation files are called "Localize.strings". The default filename is "Localizable.strings" and if you're calling NSLocalizedString without providing an explicit file name in the optional table parameter, that's what iOS looks for. So, you'll probably need to rename your translation files for things to work.

Change Single Language of Xcode Project

How do you change the default language used by your project without doing localization?
What if I want my app to be in Japanese or Italian? Is it enough to just use Japanese or Italian texts? How do I change the language displayed on iTunes to say that it's in Japanese or Italian?
Generally, the resources that you put in the main folder are assumed to be in the Default language, which is set in iTunes Connect when you add or edit the application. The setting is on the Application page and if it's not correctly set after adding it, click the Edit at the top of the page to be able to change it with the drop-down menu.
If you're going to localize at all, you'll want to make sure to change the localization native language, you'll need to change the key in the Info.plist corresponding to Localization native development region (a.k.a. CFBundleDevelopmentRegion in raw form) to match the language you are using for the raw files. The value of the tag should match the original localization language directory base (so en if you have an english lproj directory named en.lproj). This language will be used in the event that one of the other localizations is missing for the specific resource. Recommendations these days point to using the 2-letter version of the language (i.e. en instead of English, jp instead of Japanese, etc) as best-practice.
If you're building a Japanese-only app, you could just put all the resources in the top level. If you're going to have Japanese and any other language, you should put the language-specific Japanese resources in jp.lproj and set the CFBundleDevelopmentRegion to jp. Any unlocalized resources (standard images, etc.) can be stored in the main application folder.
By the way, same general rules in OS X as well, except that wherever I mentioned "main application folder" above, the files would be within the Resources folder.

Several localizations yet still showing English only

I decided to merge several of my projects into one project using the same code base and use different targets for the different versions of my application.
My application is translated to 7 languages with English as default. The other languages are: Swedish, Dutch, German, French, Polish and Spanish. The translations worked like a charm before. I am using the NSLocalizedString and have my Localizable.strings which is translated.
However, now that I merged my projects together, and also added the InfoPlist.strings file, the application incists on using the default texts (English). When I start the application and get the "share location" question, I get the question in the localized language (So the OS does get the localization), but the rest of the application is still in English.
The files are correctly translation and have no errors. I have tested several languages, but all are in English.
If I set the CFBundleDevelopmentRegion to e.g. Swedish, the whole app is in Swedish instead. So the localizations work, but the app ignores the system setting.
Am I missing something?
I found the answer to my problem. I have several strings files, one for my app translation, and one for each target called InfoPlist.strings which contains just CFBundleDisplayName and CFBundleName for localized app name. These cannot be included into the Localizable.strings since these are different for each target.
I removed the InfoPlist.strings files from my project and now the app is localized again.

How to use a language other than english, but still use NSLocalizedString with english?

I couldn't find any similar questions, so here we go:
I am working on an iOS app that for the first release will only be in french, but we plan to release an english version as well in the future. At this point, I thought it was a good idea to use NSLocalizedString for all the text, so that the app will be ready when the english language will be required. However, I would really like to use english as the key value in my code:
aString = NSLocalizedString(#"Yes", #"Text for positive answer");
instead of
aString = NSLocalizedString(#"Oui", #"Text for positive answer");
Then I want to run genstrings, and localize the .strings file in french (and give it to the translators). But if I do it like that, how can I get rid of the "original" english .strings file? Am I totally wrong here, and do I have to use french for now in my code?
If you are developing the app in English and localizing it into French, I wonder why you would want to actively prevent the app from running in English. If some users in your target market (France only, I imagine?) prefer to run their iOS device in English language, why deny them their preferred language? Or is it because you won't be doing QA of the English version and therefore don't wish to expose it yet?
In any case, I believe that you can restrict the list of supported languages by simply editing your project metadata. In XCode the list of supporting languages is shown on this page -- simply remove English and I believe that your English localizations, even if they are present in your project, won't be used (I haven't tested this but I doubt it would delete your existing English files, it should just remove them from the application's supported languages list)
You can do your whole project in english, keep english words for keys in the localizable.strings files, but keep only the fr.lproj folder, and in the plist set the supported languages only to french.

Resources