I just landed a bunch of Python scripts that take the localized XLIFF files
from the iOS L10N repository and merge them into the Firefox for iOS
project.
https://github.com/mozilla/firefox-ios/commit/9437e7d440176ffa1fadc965ec0526adf0c8431a
This was a pretty horrible thing to write because the Xcode project file is
undocumented and extremely buggy around L10N. Things were good for a while
on 6.1. and 6.2 but now with Xcode 6.3 there are many regressions in the
tooling. (The Developer Forums are full with messages of people who are
completely unable to export/import localizations, so I guess we are lucky)
I integrated these scripts in a pre-build script for our Nightly builds.
Which runs completely non-interactive on each commit. The Nightly builds of
Firefox for iOS are not super useful for everyone since these are really
just for our small group of developers and running automated tests. But, it
opens the door to do the same for our Aurora or automated TestFlight
builds: it will just take a script a few seconds without user interaction
vs an hour to get things right manually.
(You shall be replaced by a small shell script)
Next on my list is to automate exporting strings so that we can more easily
keep the SVN up to date when string changes happen. Most of that work is
done in xliff-export.py but before this is useable a few thigns need to
happen:
* The exported XLIFF documents contain <file> sections for things like unit
tests and info.plist files. These should be removed, as they have no useful
strings that we care about. (Just like the xliff-cleanup.py script does
this, so maybe we can just run that over the files. But see last item
below.)
* The exported filename paths are incorrect. They look like <file
original="Extensions/ShareTo/en.lproj/ShareTo.strings" ...> but should be
<file original="Extensions/ShareTo/ShareTo.strings" ...> - Not sure if this
is a change in Xcode behaviour or because of the way we import locales.
* If the exported files are processed with LXML (the Python library i use
for xml parsing), unicode characters are output in escaped format. So
"取消連線" becomes "取消連線". Maybe there is an option
in LXML to not do this when writing back a document. I have not found this.
Help appreciated.
I can't spend a lot of cycles on this right now because we have som many
other things to do. So feel free to hack on any of this. Otherwise I can do
a little bit here and there and probably have things ready by the end of
the week.
S.