I have an app which gives a feature to choose the language in which only the reports will be generated. Is there any way in which I can achieve this. I don't want to use the localization feature because it will then translate my whole app.
Sorry If I am not clear enough.
In my app I have a feature through which certain reports (I have used fragments as there are 5+ pages) are generated.
Mainactivity has an option to set the language for reports.
Now when the language is selected only the reports need to be translated to the selected language.
I tried the strings.xml approach but then it translates the entire app which is not what I want.
From what I understand, you want to prevent a string from being translated. Do this, declare the string in the strings.xml file and then set translatable to "false" for that particular string.
Related
I am working on a project that requires to be translated on multiple languages. I am using Zanata to translate everything and it works except context menu. I can not find anything in official documentation how to translate it. Regardless of language that I set on the phone it will always show english language in context menu(copy, select all, paste..)
Example of untranslated context menu
I thought that it will be done automatically by operating system but it is not. Does anyone has the same problem and is there any solution for this?
Thank you.
For iOS, you need to add the supported localization languages in Xcode Project settings.
If the device language matches one of these languages, the system will show the tooltips in that language. The actual strings, as far as I'm aware, cannot be changed.
Additionally, you can define a CFBundleDevelopmentRegion value in your Info.plist to define a default language.
In our Android app, we have an option for the user to change the language, which means he can select whether he want to use English or Sinhala. The default is always in English. We have one string.xml for English and another for Sinhala.
I was referring Android documents about "localization" but that is not exactly what I am looking for, I can't ask the user to change his phone settings. I also noticed programmatic localization which is discussed in here but most users do not recommend it due to loads of errors (anyway these posts are pretty old)
So, what's the best way of changing the String?XML file, with the preferred language of a user? It seems not easy on Android.
Or, is this is simply not a good idea?
I'm currently working on an app, which will be used (hopefully) by various tourist to my city. as such, i would like to complement as many languages as i can, and i have the appropriate translators to do so. I've read and started to implement the various different resources in the res folder, i already have some translated, i have a folder for each language as described in the guide from google.
How do I make the app initiate as non-English language in my phone while testing? for example Spanish. every time i run it, it's always English, and i would like to see that the app also works in the other languages, but i can't find anywhere how to initiate it.
I realize I might be simply overlooking something basic.
Thanks.
The language of the app is based on the system language. You need to change the language in Settings -> Language & input.
Change phone language from Settings->Language & input
If you use a physico-chimiques devices you have to change the languages of your device
If you use a emulator I think you can set the language on the creation.
If your tester have a android with spanish language, the app will be automatically on spanish. (if you create a filé string.xml in a values-es folder)
I am trying to make small app for android. My idea for app is that user can change the language whichever they want ...etc french , german,chinese , english etc...
how to force the locale language in my app or how to get access to the language used by user on their device and with respect to that I can change my application language.
THank you,
For this you may need to make use of Localization.
Please go through the following example available at the developer site.
May be this can solve your issue.
http://developer.android.com/resources/tutorials/localization/index.html
In my android app I need to do something like this: I have 5 languages. When app starts the user choose one of them from a spinner list. For each language there is a string.xml file. The question is: there is possible what I'm trying to do or not?
Implement the tutorial for localization.
It's only only a few steps and well-explained.
A setup like that would be unneccessary as the Android system handles this. Having your different language xml files will suffice (make sure you name them correctly, see the link posted by Raz). Android picks out the right file based on the language selected by the user within the Android OS settings.
Yes, you can do this by changing the Locale of the application. There's a similar question in here, see Changing Locale within the app itself
Yes, it is. Details: http://developer.android.com/guide/topics/resources/localization.html