I'm using PreferencesFragment with addPreferencesFromResource(R.xml.preferences) as described on Android Development site. And it works great and is a simple way of making multiple choice pref...but, my app is to be localized for Serbia and it has to support Cyrillic and Latin.
Now title and choices are easy to customize for Latin in res/values and Cyrillic in res/values-sr...
The problem is "cancel" at bottom of the dialog...
res/values is for default and that's English and when dialog pops everything is in Serbian Latin except cancel.
The second problem is on some phones Serbian language is supported in Latin (normally it's Cyrillic like on Nexus 4, 7, etc.) so everything in res/values-sr comes up in Latin so I'm using res/values-ru which works everywhere, but again the same problem with "cancel"...it's now in Russian.
Is there a simple way to customize "cancel" or to remove it?
Related
I've just started to internationalize my app with NSLocalizedStrings, ready to localize it into French, German, and Italian. I've got no translations done yet so just make some dummy translations to convince myself that its working ok.
I'm still just working in the simulator and change its language to French to have a look at my dummy translated strings.
When doing so I notice that my App actually gets called $PRODUCT_NAME in the springboard, under the app icon. This is only when in non-english language settings, i've been testing it in French as described.
The actual strings exported into XLIFFs do include the $PRODUCT_NAME strings, but I just localize them back to $PRODUCT_NAME for all languages, hoping this would keep it evaluating as a VARIABLE look up.
I notice that my app does have BundleDisplayName properties that a small dummy app does not have, perhaps that's related.
Should I just stop the display name being tied to $PRODUCT_NAME, which itself is tied to $TARGET_NAME and explicitly write it out as my AppName... just feels odd having to do so. I was probably thinking of leaving my AppName as unlocalized so that i can have more of an identity across territories, though I don't know if this is a good thing or not.
Would be good for now if i could just make the app icon behave consistently with $PRODUCT_NAME being evaluated rather than being output literally in non-English languages.
Thanks for your time
I can't get my app to work with localization.
I have created a Localizable.strings file and ticked the languages that I am localizing. (For now I have base, english and spanish.)
Localized storyboard with three languages.
In Project settings > Info I checked Use Base internationalization and all languages are correctly added. (Moreover, beside the language it shows 2 Files Localized, which I guess they must be the storyboard and .strings file.
I am using this example for testing:
self.loginLabel.text = NSLocalizedString(#"login", #"Login text info");
This is how the Localizable.strings (Base) file is looking like:
"login" = "Log in";
However, it is not working and instead it is showing login. Have I forgotten a key step?
BTW: I have tried already changing the login text just it case something was overriding the label.
Those are the steps indeed, I don't think you've left anything out. I usually set the comment to nil instead of another NSString though - not sure if that makes a difference.
However, rather than in only base, make sure you're adding the same line also to the English and Spanish files (obviously translated as appropriate).
Next, for the language to show up, set the device to said language. Close your app and start it again. Strings should now show up in the other language.
Note that the Simulator often has trouble with new translations, especially when they've been added to an already deployed app. In that case, remove the app from the Simulator, click on Product - Clean, and re-deploy.
In my case, it didn't work because the UILabel text was set as "Attributed" instead of "Plain" in the Attributes Inspector.
Localization with a .strings file doesn't seem to work on Attributed strings.
I even had a storyboard with mixed Plain and Attributed string labels, and the localization only worked on the Plain ones.
For anyone having a similar issue in the future:
Check if your *.strings file has any non-printed characters.
I used JavaScript for a simple task and didn't realize it included some whitespace characters.
An easy way to check is to put the translation at the top of the file and see if it works. If it does, there might be some whitespace characters. The next steps are... binary search and remove the whitespace characters.
I have a very simple app which only contains a PickerView, UILocalNotification, UIAlertview and less than 8 views. What I want is:
I have a main view which contains two buttons one says English and the other says French.
What in my mind is:
When the user hits English it'll take him to the Project I have right now,
However, when the User hits French it'll take him to a duplicated views that I'd simply and manually change and translate it's labels into French.
** Now my question is ** how do I translate the PickerView, LocalNotification and the AlertView? and how to connect the French button to these translations?
From what I've googled and read here in SO is that I can get the strings out and list them into Localizable.strings but I still don't know how to make my french button ask for these strings? Also, is there an easier and simpler way? any idea?
Thanks,
Kindly try this for doing localization
http://www.raywenderlich.com/2876/how-to-localize-an-iphone-app-tutorial
For buttons use something like this
[self.yourButton setTitle:NSLocalizedString(#"YOUR_KEY", #"Comment") forState:UIControlStateNormal];
Do not duplicate your views and view controller just for the sake of localization, considering that for both languages have the same layout and everything only thing that would change is the language. So add English strings and French strings to your project and use NSLocalizedString to get these values.
Note:NSLocalizedString works with device language only so if you want to change the app's language manually try this. I have used AMLocalizedString in many of my projects and they work fine.
Hi as you want to make it localized only at App basis not at device basis hence NSLocalisedString will not work you have to manage it so you have to take two different files and you have to fetch the string value on the basis of selected language. In similar manner as LocalisedString works as in localization there are multiple .strings file created for languages and it works in a way to select default language of the device and shows the text from the localised file.
I'm developing multi languages application and intent to have DONE button localized. This button is appear in UIWebView when user clicked on dropdown ("select" tag) with multiselect:
By default, this is always in English. However, if you set CFBundleAllowMixedLocalizations to YES in .plist file, you will be able to get it in current SYSTEM language:
Here, DONE is written in Chinese, when text in select in Arabic. It is because current system languages (i.e. set in Settings) is Chinese, but inside app I selected Arabic so app is using Arabic bundle with Arabic strings file.
I wonder, is any possibility to localize "DONE" button to current Application's language, but not system language?
Don't use "Application's language". Simply use the system language, like all other applications do.
I'm sure it's possible to somehow achieve it, but you're simply taking the wrong approach to localization.
I want to develop a blackberry application that supports multiple languages, such as English, Hindi and Gujarati. I have tried using utf-8 characters but it displays "??????" for Hindi.
I have try also i18n but there are not possible to write in Hindi in property file. have any idea.
The device needs to have the appropriate fonts installed to display different languages. So you would need to make sure Hindi fonts are available. It sounds like they aren't. Try going to a hindi web page, and see if the characters display correctly there.
For the resource bundle, which I think is what you mean by 'i18n', the compiler forces you to use the default java character encoding. If you're on Windows, this is CP1252. To get characters outside of that encoding, you use the Java unicode escape, which is the four digit hexidecimal encoding of the unicode code point, prefixed with '\u', such as '\u00f3'. The Eclipse editor will do this for you automatically, but if you are editing the file with another editor, this escape encoding will be required.
Make sure you are testing your code on an actual device, and not just the simulator. I learned this the hard way. I spent many hours trying to figure out why my translated text was showing as "?????", and once I tried it on the actual device, the translations showed with no problem (japanese, chinese, russian, arabic, etc).