(Semi-)Automatically merge translation resources across tor browser releases (desktop)
When I had my time offline the week before last I wrote a script to which takes a tor-browser
or firefox-android
translation file (.dtd
, .properties
, .ftl
, or android .xml
), and a new and an old branch name, and merges the versions found in both branches together with a comment added for strings that will be dropped at the next release. Here is the initial draft of the script if you want a quick look: combine-translation-versions.py
We could use the output as the en-US
source files for weblate, combining both the strings needed for the next release as well as for the current stable release. The idea being that in tor-browser we can stop trying to maintain all the old strings in the current development branch that are still needed for the current stable release. And we can avoid having to manual clean ups of old strings, like in #42221 (closed).
E.g., if we have tor-browser.ftl
in tor-browser-xxx-13.5 with the content
string1 = String 1
new-string = New String
string2 = String 2
and in tor-browser-xxx-13.0 with the content
old-string = Old String
string1 = String 1
string2 = String 2
the script would output
string1 = String 1
new-string = New String
string2 = String 2
## Will be unused in Tor Browser 13.5!
old-string = Old String
The reason I add the comment is to provide a little notification to weblate translators in the "Source string description" to let them know that a string has a short lifetime. Weblate doesn't support descriptions for .dtd
though so it won't work for that format.
@emmapeel and @pierov what do you think? And where would we want to run this script?
I guess we basically want to merge the translations files from both the branch used for current nightly and current stable. I'm not sure if this can be automatically pulled from tor-browser-build
in a convenient way, or whether we would need some manual input.