Skip to content

Commit 854f4cd

Browse files
committed
Use a submodule to pull locales from Transifex
Previously we would manually copy over locale files from a separately synced Transifex repo. This formalizes that arrangement by making that Transifex repo a submodule and pulling in its translations at build time. This change also makes compare-locales.sh operate on an XPI rather than the repo directory, and check a file after building, when we expect all the locales to be incorporated. Fixes EFForg#2313.
1 parent ba5bf5d commit 854f4cd

File tree

144 files changed

+46
-7222
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

144 files changed

+46
-7222
lines changed

.gitmodules

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,7 @@
55
path = https-everywhere-checker
66
url = https://github.com/jsha/https-everywhere-checker.git
77
branch = coverage
8+
[submodule "translations"]
9+
path = translations
10+
url = https://git.torproject.org/translation.git
11+
branch = https_everywhere

makexpi.sh

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,21 @@ if [ -n "$1" ] && [ "$2" != "--no-recurse" ] ; then
3737
# Use the version of the build script that was current when that
3838
# tag/release/branch was made.
3939
./makexpi.sh $1 --no-recurse || exit 1
40+
41+
# Check that all the string present in the English entities file are present in
42+
# each other locale we use. A missing entity causes a nasty error at startup.
43+
# Note that we only make this check when doing tagged builds, since otherwise
44+
# the check would fail anytime someone adds a new string in the entities file,
45+
# before it is included in Transifex. Once the new string is in the master
46+
# branch, Transifex will automatically fill it in with the default English
47+
# value in all the other locales.
48+
if bash utils/compare-locales.sh pkg/$XPI_NAME.xpi >&2
49+
then
50+
echo Validation of included locales completed. >&2
51+
else
52+
die "Validation of locales failed."
53+
fi
54+
4055
# The fact that the above works even when the thing you are building predates
4156
# support for --no-recurse in this script is (1) non-intuitive; (2) crazy; and (3)
4257
# involves two pristine checkouts of $1 within each other
@@ -100,6 +115,7 @@ fi
100115
[ -d pkg ] || mkdir pkg
101116
[ -e pkg/xpi-eff ] && rm -rf pkg/xpi-eff
102117
cp -a src/ pkg/xpi-eff/
118+
cp -a translations/ pkg/xpi-eff/chrome/locale/
103119
rm -r pkg/xpi-eff/chrome/content/rules
104120
[ -e pkg/xpi-amo ] && rm -rf pkg/xpi-amo
105121
cp -a pkg/xpi-eff/ pkg/xpi-amo/

src/chrome/locale/README.txt

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
We handle translations through Transifex, using the Tor Project's
2+
account. If you'd like to improve a translation, please visit
3+
https://www.transifex.com/otf/torproject/translate and sign up as a
4+
translator. The results will be automatically pushed to the https_everywhere
5+
branch of https://git.torproject.org/translation.git, which is included as
6+
a submodule here.
7+
8+
If you'd like to update the translations in your locally checked-out repo, run:
9+
10+
cd translations/
11+
git pull origin https_everywhere
12+
13+
If you'd like to add a new string for translation, add it to the `en` locale.
14+
Once your change has been merged to master, it will show up in Transifex as
15+
available for translation.

src/chrome/locale/ar/https-everywhere.dtd

Lines changed: 0 additions & 49 deletions
This file was deleted.

src/chrome/locale/ar/https-everywhere.properties

Lines changed: 0 additions & 8 deletions
This file was deleted.

src/chrome/locale/ar/ssl-observatory.dtd

Lines changed: 0 additions & 98 deletions
This file was deleted.

src/chrome/locale/bg/https-everywhere.dtd

Lines changed: 0 additions & 49 deletions
This file was deleted.

src/chrome/locale/bg/https-everywhere.properties

Lines changed: 0 additions & 8 deletions
This file was deleted.

0 commit comments

Comments
 (0)