Skip to content

Commit 49e40d0

Browse files
huitkdogi
andauthored
create 20250425-string-translation-guide.md (#3605)
Co-authored-by: dogi <[email protected]>
1 parent f54b1e9 commit 49e40d0

File tree

5 files changed

+42
-0
lines changed

5 files changed

+42
-0
lines changed
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
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+
![eng-translation](images/en-translation2.png)
26+
![es-translation](images/es-translation2.png)
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+
![string-translation](images/string-translate.png)
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.

pages/blogs/blog-list.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# Blogs
22

3+
[String Translation Guide](20250425-string-translation-guide.md) on April 22 by huitk `(Guide to Transalting Strings for myPlanet)`
34
[Navigating the Codebase](20240820-navigating-codebase.md) on August 20, 2024 by strawberrybread `(How to Navigate the Codebase for Issue Resolution)`
45
[Roboscripts](20240820-roboscript.md) on August 20, 2024 by strawberrybread `(Guide to Roboscripts)`
56
[Reading Error Logs](20240819-error-log.md) on August 19, 2024 by rlam20 `(Reading the error logs to resolve crashes)`
268 KB
Loading
283 KB
Loading
136 KB
Loading

0 commit comments

Comments
 (0)