In android app we generally use xml to design the activities, is it possible to implement any other formatting language
Related
I'm working on localizing an app of mine, and I was reading through the android documentation on localization here. and this line caught my attention:
Put the app's default text in res/values/strings.xml.
The text strings in res/values/strings.xml should use the default language, which is the language that you expect most of your app's users to speak.
now my question is, what if the app's default text is in a right-to-left language lets say Arabic, and you build all the layouts to fit the Arabic language, then how would you deal with LTR languages? how would you tell android that the default language is RTL and Layouts were designed for RTL languages, and to actually flip the layouts when the user choses a LTR languages?
After couple of days of research, reading articles on localization and some tinkering with xml it seems like using an RTL language as the default language and building all your UI in RTL by default is not a good option, and though can be done as explained below, I wouldn't advise doing it this way unless you have an app that has already been build with only RTL language in mind and now you want to support LTR languages without having to go and fix all your layouts manually.
the only thing that you need to do is to force android to use LTR for layouts directions (yes, LTR not RTL, since you already build layouts in RTL but android is expecting it to be LTR and will flip it, so you have to flip it again) and you can do that easily by adding <item name="android:layoutDirection">ltr</item> into you app theme in styles.xml.
After that you should create another styles.xml with a localized qualifier of the supported LTR language(s) and override your app theme and use rtl for layoutDirection this time.
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.
I am writing an app in which I have to support all Indian languages and for that I am looking for some third party library (free or paid)
I googled many times for the same but I did not get any decent option (library)
I just got use strings.xml for (English, Hindi) in their respective folders.
But I have seen in Whatsapp there is a multilanguage option, which supports almost all major indian languages
For an Example : If I do select Hindi language, so it translates complete app in Hindi language only
Same kind of functionality, I need in my app, like in drop down, If user do tap on any of the Indian language, my app has to converted in same one only (Like: Hindi, Telugu, Marathi, Gujarati and others)
What would be the best way of doing this and getting it done?
It depends what do you mean by "support"
Android supports all Indic languages. But it is not localized in all them.
Because of that, some of them cannot be selected from Settings.
But if you can provide string.xml files for all of them, and put them in the proper values-xy folder.
Possible problems:
How to select a language that the OS does not support? Have your own language selection. Once a locale is selected, call Locale.setDefault (to change the formatters), and change the resource loading configuration (Set Locale programmatically)
You see squares. This means missing fonts. Android has fonts for all the Indic scripts. But older phones might miss some. And OEMs might remove some to reduce size. So you can embed the proper Noto fonts in your application and use them (https://www.google.com/get/noto/). Use styles, and have language specific style sheets.
Keyboard missing. Install one. Here is the Google one: https://play.google.com/store/apps/details?id=com.google.android.apps.inputmethod.hindi. But there are also third party ones, for instance https://play.google.com/store/apps/details?id=org.smc.inputmethod.indic
I am new to android programming.I learned some basic stuffs from the youtube tutorial videos.I want to create an app for my blog. The app should act as a web browser and display the content of my blog as such.But the problem is I used to write my blog in a local Indian language.So I want my app to support my local language font which is a Unicode supported font.Is it possible to make my app to support such local font.Please help me?Sorry for my poor english!! :)
You can use Custom fonts for your Android Application,
For this, you need to use Typeface and also you need to have knowledge of Character Mapping of your font.
Following likns will help you,
how to set custom locale for indian regional languages
Can I embed a custom font in an Android application?
Android development using custom fonts
Customize Android Fonts
I want to localize my android app based on user defined language instead of device locale. How can I do that?