Thanks. I’ll document this somewhere.

Aaron Train
Sr. QE Engineer
Mozilla Corporation
https://quality.mozilla.org

> On Apr 14, 2015, at 11:45 AM, Stefan Arentz <[email protected]> wrote:
> 
> Hi Aaron, good question. (Cc to the lists)
> 
> No. The repository does not contain any localizations so they are merged in 
> as part of the build process on the CI server.
> 
>  The CI server runs the following pre-build script:
> 
> 
> export PATH=/usr/local/bin:$PATH
> cd firefox-ios
> carthage checkout --no-use-binaries
> 
> svn co --non-interactive --trust-server-cert  
> https://svn.mozilla.org/projects/l10n-misc/trunk/firefox-ios 
> <https://svn.mozilla.org/projects/l10n-misc/trunk/firefox-ios> 
> ../firefox-ios-l10n
> scripts/xliff-cleanup.py ../firefox-ios-l10n/*/*.xliff
> scripts/xliff-to-strings.py ../firefox-ios-l10n .
> scripts/strings-import.py
> 
> 
> You can do that manually or just throw it in a shell script that you keep 
> around.
> 
> Note that the above probably does not work incremental. It expects a clean 
> checkout.
> 
>  S.
> 
> 
> On Tue, Apr 14, 2015 at 10:59 AM, Aaron Train <[email protected] 
> <mailto:[email protected]>> wrote:
> Thanks. For clarification, does this mean builds built from master with 
> Client target now bundle translations during build? If I change my device 
> language will Fennec use those translations now or is anything else required? 
> 
> Aaron Train
> Sr. QE Engineer
> Mozilla Corporation
> https://quality.mozilla.org <https://quality.mozilla.org/>
>> On Apr 14, 2015, at 9:21 AM, Stefan Arentz <[email protected] 
>> <mailto:[email protected]>> wrote:
>> 
>> 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
>>  
>> <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 "&#21462;&#28040;&#36899;&#32218;". 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.
>> 
>> _______________________________________________
>> mobile-firefox-dev mailing list
>> [email protected] <mailto:[email protected]>
>> https://mail.mozilla.org/listinfo/mobile-firefox-dev 
>> <https://mail.mozilla.org/listinfo/mobile-firefox-dev>
> 
> 

_______________________________________________
mobile-firefox-dev mailing list
[email protected]
https://mail.mozilla.org/listinfo/mobile-firefox-dev

Reply via email to