This question already has answers here:
Closed 11 years ago.
Possible Duplicate:
iPhone App Localization - English problems?
I am working on an App for iOS devices. I made it available for English (en) and German (de). That works fine with localization. Now I want to create a specified localization for German with region Luxemburg: German (Luxemburg) or de_LU.
I added it into my Localizable.strings but nothing happened... I deleted the cache, I reinstall the app serval times: Nothing. He ignores that.
My iPhone is configured with the German language and Luxemburg as region.
Where is the problem? Or is it impossible to do that?
It is possible, to localize into that culture you should have a de-LU.lproj folder, is that the case?
A typical application has at least one strings file per localization, that is, one strings file in each of the bundle’s .lproj subdirectories. The name of the default strings file is Localizable.strings but you can create strings files with any file name you choose.
(Quoting Apple documentation)
If you're using Xcode 4, just go to project settings, Info tab, then add your localization from there, it will setup the project accordingly for you.
Also note that Apple recommends that you save strings files using the UTF-16 encoding
Check for region & language in code. If language German & region Luxemburg then keep new key for localization.And initialize that key in German language localized file. It is working for me.
Unfortunately, I believe that supporting dialects is currently impossible in iOS 4.
Related
I want to get the language of the device (macOS). All I found is a bunch of examples for the app itself or the prefered user setting, not the device itself:
Locale.preferredLanguages => ["en", "de-DE"] (I'm using english XCode, non localized app and german macOS)
I want to set the labels of the Finder as extended attributes the same language as the OS itself. For me it is "de", regardless of the localization of the app.
I also found some old tips (5 - 10 years old) which needed a lot of changes in code, but still don't work.
What's the correct function call to get the language used by the OS to set color names like "Rot" or "Red" later on? (e.g. "de" for my setup)
I found an solution:
((Locale.current as NSLocale).object(forKey: NSLocale.Key.languageCode)! as! String)
My iOS-App was first German and English. As it was just a fault, I removed the English localization. Somehow if I change the language in the iOS Simulator to english not it loads the old storyboard that doesn't even exist anymore. I cleaned the folder and there is now only a base storyboard. Although I cleaned the Project the App is still crashing after start (because it's loading an old storyboard of prior App version (I removed english localization in 1.1, and now in 1.2 it still loads the 1.0 storyboard).
This is really weird, how can I achieve that the App ALWAYS uses the same storyboard, no matter which language? I already removed the english localization!
Thanks very much!
From my understanding based on a previous experience, if you are localizing an application you need to keep the English one. Because it will default to English if the device is not set in the language that you are supporting.
(Have you notice in the setting app how english is always the second choice and that you can't change the order like on the desktop to default to something else before english)
So if you are planning on supporting only 1 language remove all localization into your application. Because other wise it would default to a non-existing asset and crash.
That would be my best guest for a try.
Have you delete the application on your device after all those change and a clean up may be necessary. I've notice that file, (especially not code file) that get deleted have a tendency to lay around the executable.
And if you get file (1) b.xml and (2) fr.lproj/b.xml even if the device if in french the french one (2) won't get used. The system will see (1) first and think there is no localization for that file.
As for "losing" your German Xib. If you take a copy out of your de.lproj (and put that copy up a directory in the file system it should work)
This question already has answers here:
Closed 11 years ago.
Possible Duplicate:
iPhone App Localization - English problems?
Currently, I have a localization strings file for Mexican Spanish. I do not have a plain Spanish strings file. I would like to have my app be localizable for this particular dialect of Spanish, and so in Xcode 4, I added Spanish-Mexican. I have a Localizable.strings (Spanish-Mexico) file generated by Xcode 4, with Spanish strings added. But when I go into the simulator and change the International settings to Español for Language and Mexico for region, the strings are not displayed, but the default English ones appear instead.
However, in the Simulator when I set the language to Spanish, and the Region Format to Mexico, the strings do not appear, but the plain English is displayed instead. Is there any way to support dialects in iOS 4, not just the languages that appear under Languages? There is the extensive Region Formats preference, but I'm uncertain how it's actually used.
I understand that Locale and Dialects are two different things. But other for different formatting to represent their files (underscore vs. hyphen), how do we use them in iOS? And is Locale and Region Format the same thing?
Relevant threads with the same problem:
iOS localization with region (de_LU)
iPhone en_* sublanguage localization
Hack-y workaround:
http://hamishrickerby.com/2010/07/23/iphone-ipad-localizations-regions/
Looks like it's currently unsupported:
When searching for resources in Mac OS X, the bundle interfaces take into account the user’s preferred region settings in addition to the preferred language settings. For languages that have multiple dialects, an application can specify custom resource files for each region. For example, for the English language, an application might include different sets of resource files for users in the United States, Great Britain, Canada, and Australia. By using the user’s preferred region settings, the bundle interfaces are able to return even more precisely localized content to the user. This support is available in Mac OS X only, though; in iOS, only the preferred language is taken into consideration.
http://developer.apple.com/library/ios/#documentation/MacOSX/Conceptual/BPInternational/Articles/InternatSupport.html
I have an Xcode4 project where I have support for several languages (localization files) .. My text and xib files change correct when I change languange on my iPhone ..
My Question is;
Can I make a release to a specific languange, even if I have several localization files?
Force my app to use only one localization?
My idea would be to set a flag in the info.plist file like;
Localization = English (Lock my app to the enligsh language)
You can do this by deleting localized strings and nib files. I don't think you can lock your app to a particular language (If localization support is there for other language).
If the localized.lproj folders are in the bundle, iOS will use them. The easiest way would be to remove your localized resources folders from the bundle and build the app.
You could probably programmatically set code a workaround in your main.m class file, by stating only to use en.lproj but I can't imagine this will be either pretty or useful.
Side note: You can set your default project localisation in the Target > Info pane. Look for key: Localization native development region
Is it possible to localize the app icon and Default.png files? Do I just drop them in the respective language folders or must I do something else?
As per my comment, there's an answer elsewhere, but you can read more in the Internationalizing Your Application section of the iPhone Application Programming Guide. There's an example of how to structure your language files in your app bundle, for example.
The correct answer is that it is not possible to localize the app icon.
An iOS application should be internationalized and have a
language.lproj folder for each language it supports. In addition to
providing localized versions of your application’s custom resources,
you can also localize your application icons and launch images by
placing files with the same name in your language-specific project
directories. Even if you provide localized versions, however, you
should always include a default version of these files at the
top-level of your application bundle. The default version is used in
situations where a specific localization is not available. For more
information about localized resources, see “Localized Resources in
Bundles.”
https://developer.apple.com/library/ios/#documentation/CoreFoundation/Conceptual/CFBundles/BundleTypes/BundleTypes.html
Apple docs update/change frequently. This is the correct link at this point in time. Also, I haven't actually tried localizing the app icon/default images, but Apple says it works so why not :-)
This same question appears numerous times on stackoverflow.