Adding string resources - ankidroid/Anki-Android GitHub Wiki
Translation
Here is a documentation on adding string resources , which will get translated either by crowdin or by pontoon.
Steps are:
-
Inside /res/values you'll see a number of folders.
-
Add the string to the first file in those folders.
-
To choose correct directory you can refer here: https://github.com/ankidroid/Anki-Android/wiki/Translating-AnkiDroid#logic-of-the-separation-in-different-files
-
The basic format is demonstrated here : https://github.com/ankidroid/Anki-Android/wiki/Code-style#string-key-resources-must-be-all-lowercase-using-underscore-to-separate-words
- For example, if you're adding to core, use the following file in the screenshot. path:src/main/res/values
-
-
You can then reference it as getString(R.string.id) in the Activity class you want.
-
It has an automated process to generate the other files.