forked from mozilla-mobile/focus-android
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add gradle tasks for l10n tasks. (mozilla-mobile#140)
(Eventually this could be refactored to be a gradle plugin that we can use for future apps)
- Loading branch information
Showing
6 changed files
with
166 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -40,5 +40,5 @@ captures/ | |
*.jks | ||
|
||
# Local checkout of localization files | ||
l10n/ | ||
l10n-repo/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# This Source Code Form is subject to the terms of the Mozilla Public | ||
# License, v. 2.0. If a copy of the MPL was not distributed with this | ||
# file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
|
||
# Create a separate commit for every locale. | ||
|
||
parent_path=$( cd "$(dirname "${BASH_SOURCE[0]}")" ; pwd -P ) | ||
cd "$parent_path/../../l10n-repo" | ||
|
||
git add locales/templates/app.pot | ||
git commit -m "template update: app.pot" | ||
|
||
cd locales | ||
|
||
locale_list=$(find . -mindepth 1 -maxdepth 1 -type d \( ! -iname ".*" \) | sed 's|^\./||g' | sort) | ||
for locale in ${locale_list}; | ||
do | ||
# Exclude templates | ||
if [ "${locale}" != "templates" ] | ||
then | ||
git add ${locale}/app.po | ||
git commit -m "${locale}: Update app.po" | ||
fi | ||
done | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# This Source Code Form is subject to the terms of the Mozilla Public | ||
# License, v. 2.0. If a copy of the MPL was not distributed with this | ||
# file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
|
||
# a2po has problems with the folder format of Pontoon and creates resource folders | ||
# like values-es-MX. Android expects values-es-rMX. This script tries to find those | ||
# folders and fixes them. | ||
|
||
parent_path=$( cd "$(dirname "${BASH_SOURCE[0]}")" ; pwd -P ) | ||
|
||
cd "$parent_path/../../app/src/main/res/" | ||
|
||
|
||
folder_list=$(find . -maxdepth 1 -type d -iname "values-*-*") | ||
for folder in ${folder_list}; | ||
do | ||
country=$(echo ${folder} | cut -d'-' -f3) | ||
len=${#country} | ||
|
||
if [ "$len" -eq "2" ]; then | ||
prefix=$(echo ${folder} | cut -d'-' -f1,2) | ||
|
||
fixed_folder="${prefix}-r${country}" | ||
|
||
echo "Fixing ${folder} -> ${fixed_folder}" | ||
|
||
if [ -f $fixed_folder ] ; then | ||
rm -rf "${fixed_folder}" | ||
fi | ||
|
||
mv "$folder" "${fixed_folder}" | ||
fi | ||
done | ||
|