Skip to content

Commit 16fb461

Browse files
authored
add 20241021-smoother-translate.md (#3456)
1 parent af5b160 commit 16fb461

File tree

5 files changed

+77
-0
lines changed

5 files changed

+77
-0
lines changed
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
# A Guide to find and translate texts to supported languages
2+
3+
October 21, 2024 • [Kuljeet1998](https://github.com/Kuljeet1998/)
4+
5+
## Introduction
6+
7+
Language translation plays a crucial role in enhancing the user experience on myPlanet, which is used in diverse regions like Mexico, Nepal, Kenya, Ghana, and Somalia. To ensure effective navigation and comprehension, myPlanet supports multiple languages, including English, Arabic, Spanish, French, Nepali, and Somali. Providing complete translation throughout the app allows users to fully engage with its features, enabling them to maximize the app's potential and benefit from its resources.
8+
9+
10+
## Finding non-translated texts: Tips & Tricks
11+
12+
1. **While testing the app**:
13+
14+
- When testing the app’s overall flow, ensure you check all tabs and features in different languages, as some may be overlooked.
15+
- If you find any untranslated sections, create an issue and resolve it. (Easy 2 points).
16+
17+
2. **While reviewing PRs**:
18+
19+
- You might encounter untranslated text when reviewing PRs.
20+
- Expand all the modified files.
21+
- Pay close attention to any text that remains in English and isn’t referenced from `@strings/...`
22+
23+
![Files changed](images/20241021-review-pr.png)
24+
25+
3. **While solving a different issue**:
26+
27+
- You might encounter untranslated text when you are solving an issue assigned to you.
28+
- While working on different issues, you tend to explore the codebase more. This is when you might come across more untranslated texts.
29+
- Pay close attention to any text that remains in English and isn’t referenced from `@strings/...`
30+
- If you find it - easy 2 points!
31+
32+
33+
## Leveraging ChatGPT to translate the texts
34+
35+
1. **Prompt to train texts in the supported languages**:
36+
37+
- Type in:
38+
```
39+
Translate the following text in these languages:
40+
1. English
41+
2. Arabic
42+
3. Espanol
43+
4. francias
44+
5. nepali
45+
6. somalian
46+
```
47+
- Simply enter the text to be translated in double quotes (e.g., "mark all as read").
48+
- Watch the magic happen!
49+
50+
![ChatGPT snapshot](images/20241021-translate-text-chatgpt-snapshot.png)
51+
52+
TIP:
53+
Rename this ChatGPT tab for easier access (e.g., !! TRANSLATE !!).
54+
55+
![ChatGPT tab](images/20241021-translate-tab-chatgpt.png)
56+
57+
58+
59+
## Make the changes in codebase
60+
61+
1. **Add the translated texts to respective files**:
62+
- Copy and paste the translated text into the appropriate XML files.
63+
- For example, add `<string name="mark_all_as_read">Marcar todo como leído</string>` to `es/strings.xml`.
64+
- Replace the source text `"Mark all as read"` with `"@string/mark_all_as_read"`.
65+
- Repeat this process for the XML files of all supported languages.
66+
67+
2. **Build and test**:
68+
- Build the app.
69+
- Go to the screen where the changes should appear.
70+
- Switch between languages to verify that everything works as expected.
71+
72+
3. **Commit, Push, Create PR**:
73+
- Stage all changes.
74+
- Commit with an appropriate message.
75+
- Push to GitHub.
76+
- Create a pull request.

pages/blogs/blog-list.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@
55
[Reading Error Logs](20240819-error-log.md) on August 19, 2024 by rlam20 `(Reading the error logs to resolve crashes)`
66
[Language Support in Android](20240816-language.md) on August 16, 2024, by rlam20 `(How to support different languages in Android)`
77
[Android Debugger](20240805-android-debugger.md) on August 5, 2024 by ewhang5 `(Utilizing the Android Studio Debugger to Solve Bugs)`
8+
[Translating Texts: A Quick Guide](20241021-smoother-translate.md) on October 21, 2024 by Kuljeet1998 `(How to translate texts into all languages)`
387 KB
Loading
10.2 KB
Loading
185 KB
Loading

0 commit comments

Comments
 (0)