raghav-coder
4/12/2018 - 3:40 AM

UI Basics - Localisation

Translation

  • Any text that you would expect to be translated like labels and titles and button descriptions should all be defined as a string resource in res/values/strings.xml

  • Create a new values folder with the pattern value-xx, where xx can be the abbreviation of any language from the ISO 639 code list here, for example res/values-fr/strings.xml will contain the french version of the strings.xml file with all the strings translated from the default language to french.

  • This way, when a user who has set up their phone to use french as the default language, android will automatically load the french version of strings and use all the pre-translated french labels.

  • You would still want to use the strings recourses for strings that you don't intend to translate, for such strings use

    hh:mm a

Language Code List

https://www.loc.gov/standards/iso639-2/php/code_list.php

Localization Checklist

https://developer.android.com/distribute/best-practices/launch/localization-checklist.html

Udacity Link

https://classroom.udacity.com/nanodegrees/nd801-inba1/parts/6e9bed25-fbc5-43ec-a976-34ba354b633a/modules/4bcc9396-5041-41a7-869d-e980c6b4a30c/lessons/92320789-2acc-42cc-9d64-b1d0e5f1947a/concepts/0124ee43-1e8c-4c8a-8d19-e98ef6125940