Regarding implementation of Android internationalization - android

I have to create an Android app where we can implement internationalization? For example, suppose there is an app where we can login and move to the next page. I want to change the the language from English to Chinese, how do I do that? It should be applied to the whole application i.e the login page as well as the next page.
Please Help guys, if you have an example please do share. Thank you in advance.

The solutions lies in using the locale of the user, and providing associated text using xml files in language specific folder.
Have strings.xml,dimens.xml,fonts.xml etc in Project--> res--> values-?? folder where "??" represents the locale of the user. if you want to support english,spanish,etc,you should have folders values-en,values-es,etc. all in the Project/res/ to support them.
You can have a look at this link.

Related

Change chinese title to english using flutter_filereader in Flutter

Hope you all doing fine. I want to develop an Flutter application to view all major types of documents which include; .docx, .ppt, .pptx, .doc, .xls, .xlsx, .pdf files I found two free plugin which are file_preview (https://github.com/aliyoge/flutter_file_preview/blob/master/android/src/main/java/zzaning/com/filepreview/LoadFileApi.java) and file_preview (https://pub.dev/packages/flutter_filereader) but the issue with these two is they both download some plugin at initial or at very first time when app start's up. Which only shows in log and I am not able to show it on loading screen plus second issue is when a document is loaded it displays in Chinese language which I can not get rid of.
Please help me out guys.
Because the Chinese develop the packages, so the language is mostly in Chinese.
For the issue when a document is loaded, it displays in the Chinese language which you can not get rid of, my solution is you just download the latest packages file inside the version archive menu here.
And then, open the file and translate each Chinese language manually using Google Translate.
After you've finished it, you can add that manually to your project.
As for another issue, you can (again) edit the file and display it like this. I hope it will help a little bit.

How to add support to multi languages in android?

I would like to add support to different languages in my app. As I understand, Android uses the proper strings.xml file according to the operation languages of the device. But what If I want to allow users to change the language in the settings? What steps should I do? I thought of keeping the the user's language in the his document (Firebase cloud) but then if the user if logs out the app, the main page (login/sign up) will be in the default language (and not in his language).
I guess that there is a proper "flow" that I need to follow in order to add support to multi languages. Is it possible to share this flow with me?
you can go to res- values, then from the right click list create a new Values Resource File
from the window appears name the files strings and then select locale and add your language or country.. picture below to make it clear for you
then after that you can change the locale programmatically using these methods and let android system do the rest of work

Translation tool

am wondering if is possible to use a feature on my app that can translate the app to other languages so the user can select through a list of languages so as he can read the app even if he doesnt speak English, thanks a lot
If you use the framework's localization facilities, this will happen automatically based on the user's language setting on their device
http://developer.android.com/guide/topics/resources/localization.html
Basically, instead of using string literals in your code (ie. txt.setText("Something") or android:text="Something"), you create these in your strings.xml file and use the automatically created reference id's.
res/values/strings.xml:
<string name="something">Something</string>
Then, you create alternate res/values folders for the other languages you support and create a similar strings.xml file there.
res/values-es/strings.xml
<string name="something">Algo</string>
Then your layouts and codes would have txt.setText(R.string.something) or android:text="#string/something".
You can do the same thing for drawable, layout, menu, etc.
"to use a feature on my app that can translate the app to other languages"
I do not think such feature exist from Google. But if you write the app according Google's localization guide then you can use our Nativer app, which is designed exactly for that. It takes you language resources - translates with a machine and then let's the crowd to correct it. All these happens in runtime - so you do not need to bother when the language translation finished by the crowd. You can find further info here transround.com
Peter

How to use multiple languages in android

I want to give my user an option to select his language and according to his selection i want to display language.
Can my android app support multiple languages. How to do that?
What you are referring to is termed Localization
You can do it under your resource folder. For example, let's say you want to have language support for France. For such cases, you can do it by creating a folder res/values-fr/strings.xml. In addition, you can have a folder called res/drawables-fr, as well.
You can check out more on these sites.
http://developer.android.com/resources/tutorials/localization/index.html
http://www.icanlocalize.com/site/tutorials/android-application-localization-tutorial

How to set my App to German Locale

My question is much the same as this one, but unfortunately it was never answered.
how to set application locale?
I am actually trying to load the app onto the market place but it is showing that the default language is English when I upload it. I am guessing that there is a setting in the manifest file but can't find it.
All of the text in the app is in German but I just need the application to show this.
You can choose your default language in the parameters in the Market as follow:
1st step
2nd step
3rd step
Last step
My interface is in french but it is basically the same.
If your resources are localized to German then anyone with a German-localized phone should see everything in German.
The answer is in here:
http://www.tutorialforandroid.com/2009/01/force-localize-application-on-android.html
You can also use the default files to force german.
Instead of having:
strings-en.xml
strings-de.xml
strings-ch.xml
...
Use strings.xml only, and put german strings there. Any user will see german.

Categories

Resources