Use build paths in translation tor-browser and base-browser repos.
In tpo/translation!118 (merged) we decided to place the mullvad browser strings in en-US/toolkit/toolkit/global/mullvad-browser.ftl
rather than en-US/mullvad-browser.ftl
.
For the tor-browser
and base-browser
branches, we currently place the files in en-US/tor-browser.ftl
and en-US/base-browser.ftl
. And we add some logic in tor-browser-build
to copy this to toolkit/toolkit/global/
instead.
As part of completing mullvad-browser#324 and simplifying tor-browser-build
, we should unify our approach and also copy the tor-browser.ftl
and base-browser.ftl
files to en-US/toolkit/toolkit/global/
.
I suggest doing this in the 14.5 cycle. We need to make several changes.
tor-browser
translation CI
We need to change the CI script in the tor-browser
repository to be able to pass on the full path to the @tor-browser-translation-bot's translation
repository.
NOTE: I'll leave the torbutton
.properties
and .dtd
files as they are (directly under en-US/
) because they have their own legacy logic in tor-browser-build
anyway. And we're hoping to remove these last few files anyway.
NOTE: I'm not sure about torbrowser_strings.xml
. In principle, we could copy the file to en-US/app/src/main/res/values/torbrowser_strings.xml
, but I'm not sure there is much benefit.
translation
repository
Once our new CI is ready, we will need to move the Fluent files for all locales in the base-browser
and tor-browser
branches. I'm not sure how to best do this on Weblate. @emmapeel have you ever done this before, could you find out?
I would guess you need to change the "file mask" for the project. But looking in the Weblate code, I'm not sure there is a mechanism to automatically move everything. My guess would be
- Prevent users from contributing to the component.
- Force all pending translations on Weblate to be written to the
translation
repository. - In the
translation
repository copy all files to the new location. - In weblate change the file mask to be the new location.
- Allow contributions again.
- Delete the old files in the
translation
repository.
I could test this out with a test instance of Weblate if need be.
tor-browser-build
repository
Since the translation
repository now has the files at a new location, we will need to change the tor-browser-build
script to use the new location instead. We would need to do this for all the builds that use these files: 13.5 legacy, 14.0 stable, 14.5 alpha and nightly.
brand.ftl
and brand.properties
Currently, in the tor-browser
branch, we place the brand.ftl
and brand.properties
file under en-US/branding/brand.ftl
and en-US/brand.properties
. In tor-browser-build
we copy these to toolkit/torbutton
. Moreover, all of our builds use the same brand files.
In the mullvad-browser
branch, we have all:
- en-US/browser/branding/mb-alpha/brand.ftl
- en-US/browser/branding/mb-alpha/brand.properties
- en-US/browser/branding/mb-nightly/brand.ftl
- en-US/browser/branding/mb-nightly/brand.properties
- en-US/browser/branding/mb-release/brand.ftl
- en-US/browser/branding/mb-release/brand.properties
And these are copied to browser/branding
in tor-browser-build
. Even though each build has a separate file, the content is the same for each.
I'm not sure how best to unify our approach in tor-browser
and mullvad-browser
. I can think of two approaches.
1. keep in the branding directory.
- In the browser repository, we only have
brand.ftl
andbrand.properties
undertb-release
andmb-release
. - For the
-alpha
and-nightly
repositories, we change their.jar.mn
to point to the-release
files instead.
I'm not sure the second step works:
[localization] @AB_CD@.jar:
branding (../../mb-release/locales/%*.ftl)
@AB_CD@.jar:
% locale branding @AB_CD@ %locale/branding/
locale/branding/brand.properties (../../mb-release/locales/%brand.properties)
2. keep in the browser directory.
In both browser repositories clear browser/branding/<release>/locales/
like we do in tor-browser
.
Move the files under browser/locales/en-US/branding/
instead and add to browser/locales/jar.mn
:
[localization] @AB_CD@.jar:
branding (%branding/**/*.ftl)
@AB_CD@.jar:
% locale branding @AB_CD@ %locale/branding/
locale/branding/brand.properties (en-US/brand.properties)
I think this is probably the simpler approach.