Page 1 of 1

Foreign language support using Tiggzi

Posted: Thu Oct 18, 2012 6:50 am
by Haim

How does one do the following (eventual support on Android + iOS):

  1. Detect the language of the phone

  2. Provide for text/menu/etc in other supported languages

    Where can I provide alternative text values for the few text labels and boxes I have on my screens?


Foreign language support using Tiggzi

Posted: Thu Oct 18, 2012 9:03 am
by Maryna Brodina

Hello!

1) You can try to use navigator.language to get this information

language = navigator.language.split("-");
language_root = (language[0]);

2) It should be coded (you can change values with JS)

Try using Settings service


Foreign language support using Tiggzi

Posted: Thu Oct 18, 2012 9:50 am
by Haim

Thanks - but my questions was really related to the actual strings and where to declare the foreign language equivalent. If I remember correctly, there are resources that are declared in an Android build.

For example, I might have a directory in the Android build called "values" which sits until "res" - and these values include XML files like "strings.xml" which has all my strings declared.

If I want to support Spanish (language code is "es") - then I would create a parallel "values" directory called "values-es" which also sits in "res" and would contain equivalent Spanish translated strings.

Am I going down an old path? I know that a previous version of our app (custom build) used this approach - perhaps there's a better way?


Foreign language support using Tiggzi

Posted: Thu Oct 18, 2012 11:30 am
by Maryna Brodina

It seems that it's possible to create such functionality only after exporting App to Eclipce and xCode where it should be coded separately for Android and iPhone.


Foreign language support using Tiggzi

Posted: Thu Oct 25, 2012 12:28 pm
by Haim

By the way, thanks for the above - it wasn't my original question, but it does answer another question on how to query the phone's language setting. Thanks.