-
Notifications
You must be signed in to change notification settings - Fork 711
Localization
Firefox Focus for Android is getting localized on Pontoon.
For converting between Android XML files and Gettext PO files (to be consumed by Pontoon) we use a local, slightly modified version of android2po (See tools/l10n/android2po
).
New strings are flagged with the strings-approved label. These strings should be added to app/src/main/res/values/strings.xml - include localization notes if necessary for clarity. Remove the strings-approved
label once the strings have been added.
-
Python, Pip and Git need to be installed.
You can optionally set up a virtualenv for running all these scripts in:
virtualenv <new_env> source <new_env>/bin/activate
Remember to exit the virtualenv when you've finished with everything.
deactivate
-
Install the dependencies.
pip install -r tools/l10n/android2po/requirements.txt
-
You should have a fork of the focus-android-l10n repo in order to make a PR.
-
Export the string changes into a branch against the focus-android-l10n repo.
sh tools/l10n/export-strings.sh
This will clone the l10n Focus repo into the Focus directory if it doesn't already exist, update to the most recent commit, and create a new branch with the string changes per locale in separate commits. The l10n strings repo will be located at $topsrcdir/l10n-repo, and the new branch will be of the format
export-YYYY-MM-DD
. -
Add your fork as a remote if it doesn't already exist.
git remote add <username> [email protected]:<username>/focus-android-l10n.git
-
Push the branch to your forked repo and make a PR against the mozilla-l10n/focus-android-l10n repo.
git push <username> <export-branch>
-
Fetch the latest changes from the L10N repository and remove all local modifications with the
stringsCleanUpdate
gradle task:./gradlew stringsCleanUpdate
-
Run the
stringsImport
gradle task to generate the Android XML files../gradlew stringsImport
-
Verify the changes and then commit and push the updated XML files to the app repository.