Detect locales available on device - android

I am implementing overriding the locale of the device in my application allowing the selection of a different language via a preference.
Now when presenting the list of available languages I am looking at using Locale.getAvailableLocales() to see which ones are installed on the device.
Will that work and e.g. only return a smaller set of locales if they are not fulled installed down to the needed fonts and so on?

As Android's Documentation states:
Most locale-sensitive classes offer their own getAvailableLocales method, which should be preferred over this general purpose method.
To me that means you should test against these methods to be on the safe side. So it seems that the answer is no. However, in terms of installed fonts, I believe that system provides a way to display almost any language. Some symbolic glyphs might be missing but I don't think it regards to regular characters (or maybe it does in regards to some obscure scripts but I don't think you would use them).

Related

Extension language for Android app

I'm writing a Android app for encrypting texts, and I wonder if I can use a extension language to write additional algorithms outside the app instead of writing them inside the app and recompile the source. After doing some researches, Lisp seems to be a good language to use, and I've come up with a few choices:
Write my own lisp. This seems to be viable, but I always have trouble with writing a new program, and debugging is very time-consuming. It won't be my first choice.
Use lisp written by others. I've been searching Java-lisp repos on Github, and I found some small projects that may be useful, but lack some important features I want to include. I can add more to others' projects and use, but because of the reason above, this is not a good choice either.
Use Clojure. This seems to be a good choice, because Clojure is a well maintained and supported language. The only problem left is how to integrate it into my app.
Number 3 is my preferred choice now, but I want to ask you to help me choose. Other solutions are also welcome. Thanks!

Pre-built localization strings for multiple languages

It is a tedious task to localize app's for multiple languages, and very often the same work is done over and over again:
For example, phrases like "OK", "Cancel" are in almost every android app.
Localization of mobile apps - Any resources available for the basics?
This question is 3 years old, I wonder if anything changed since then.
Are there any comprehensive libraries/collections which take care of this? So that I only have to translate the actually app-specific strings?
I would suggest using the Google Translator Toolkit. It supports the various localization files. It also has support for iOS and Android localization files.
Example: For Android you can upload your strings.xml you can select to which files you want to get it translated. It is automatically translated by Google Translate. It uses different colors to display how sure Google Translate is about the translation, and gives feedback about things that needs to be changed in the translations.
You can also use a translation memory. This is a database with saved translations. You can create a personal Translation memory. This contains all the translations you made. You can also use the global TM.
The global TM saves and stores translations from Translator Toolkit users everywhere. Please note that the global TM is available for anyone to see and use.
You read more about it on the support page
It has an editor build in which allows you to change the automatically translated words/sentences. You can export the translations as strings.xml again, so you can use them straightaway in your Android project.
A disadvantage: I don't think it is possible to switch between localization formats, so you have to translate all sentences for both the iOS and Android version.
You can read more about it on the support page

How do I verify Android internationalization visually?

We're facing a upcoming internationalization project for our Android app, expanding significantly on the three currently supported languages. All the languages that we're initially supporting will use existing layouts and are left-to-right, and we are already familiar with language specific setups (separate resource files etc.) as required, so fortunately nothing too exotic is in store for now.
I would like to be able to visually verify that our layouts work and that everything looks OK. Are there any good tools or best practices available for this need? Trying to find resources, I've only been able to identify tools for managing the actual string resources themselves or different platforms for sourcing translations, but nothing that would render them in their actual context for verification.
The only immediate thing that I can think of is to essentially run our test scripts with something like this screenshot lib, and then rinse and repeat for every language we should support. Is there a better, less work intensive and time-consuming (a single testrun times languages supported will probably take at least a few hours on a single device) approach?

Android standard Icons for use in commercial apps?

These are the standarad icons I am referring to.
http://speckyboy.com/wp-content/uploads/2010/05/android_gui_11.jpg
Are these able to be used in apps that are for sale. I am assuming not. But it would save some time if I could use any.
These icons are available in the sdk (platforms\android-XX\data\res\drawable-[whatever]), so I would think they could be used in your commercial app. When you use these, you can access them via android.R.drawable, but it is better practice to copy the files and include them in your project for consistency.
If your purpose is only to save time, you can take a look into Iconspedia
site, it has lots of icons of very good quality and you can search by license type.
Also, they usually come on different sizes and formats.
There are many icons on the official Android Developer resource

How to use Android in hungarian?

I have checked the regional settings in my emulator and I can't yet choose Hungarian.
I am wondering how can I make my application to work in hungarian? How do I set what language to use?
Updated answer:
Android supports Hungarian out of the box, took me some time to figure out it's called "Magyar" in the Languages list, and it properly uses all values contained in values-hu
Android does not officially support Hungarian at this time, so the emulator does not have Hungarian strings. You can see the list of supported languages on each SDK's release notes page.

Categories

Resources