|
| 1 | +# Translation Guide for MyPlanet |
| 2 | +April 22, 2025 • [huitk](https://github.com/huitk) |
| 3 | + |
| 4 | +In myPlanet Android Application, six languages are supported. It is important to ensure that all strings are translated into these six languages whenever new strings are added. The supported languages and their corresponding resource files are: |
| 5 | + |
| 6 | + English in res/values/strings.xml |
| 7 | + Arabic in res/values-ar/strings.xml |
| 8 | + French in res/values-fr/strings.xml |
| 9 | + Nepali in res/values-ne/strings.xml |
| 10 | + Somali in res/values-so/strings.xml |
| 11 | + Spanish in res/values-es/strings.xml |
| 12 | + |
| 13 | +## How to translate |
| 14 | +How to translate |
| 15 | + |
| 16 | +When you create a string for example, |
| 17 | +`callback.onError(“planet is up to date”)`. |
| 18 | +This string is currently compatible with only one language, English. To make the application support all six languages, you need to: |
| 19 | + |
| 20 | +- Translate each string using chapGPT or any translator you have. |
| 21 | +- Add the translated strings to each string.xml file for the six languages. |
| 22 | +- Make sure that the translations are on the same line number across all language files. For example, in English: |
| 23 | +`<string name="planet_is_up_to_date">Planet is up to date.</string>` appears on line 1252. The translations for the other five languages should also be placed on line 1252 in their respective files. |
| 24 | + |
| 25 | + |
| 26 | + |
| 27 | + |
| 28 | +- After you finish the translation, use the translated string by adding this line: |
| 29 | +`(context.getString(R.your_string_name)` |
| 30 | +For example, write |
| 31 | +`callback.onError(context.getString(R.string.planet_is_up_to_date)`, false) instead of: `callback.onError(“Planet is up to date”)` |
| 32 | + |
| 33 | + |
| 34 | + |
| 35 | +**Note** |
| 36 | + |
| 37 | + When doing a peer review on GitHub, please refer to this Translation Guide and ensure that all translations follow the required format. |
| 38 | + |
| 39 | +## Conclusion |
| 40 | + |
| 41 | +Ensuring that all user-facing strings are properly translated into the six supported languages is essential for maintaining accessibility and a consistent user experience across the MyPlanet Android application. By following the outlined process—adding each new string to all six `strings.xml` files at the correct line number and referencing them using `context.getString(R.string.key)`—we guarantee that the application remains fully localized and inclusive for all users. Maintaining this translation discipline as part of the development workflow will prevent language inconsistencies and improve usability across global communities. |
0 commit comments