Skip to content

Bug 41372: Handle branding strings for tor-browser build.

Merge Info

Issues

Resolves

Related

Merging

Target Branches

  • main: esr128-14.5
  • maint-14.0: esr128-14.0
  • maint-13.5: esr115-13.5

Backporting

Timeline

  • No Backport (preferred): patchset for the next major stable
  • Immediate: patchset needed as soon as possible
  • Next Minor Stable Release: patchset that needs to be verified in nightly before backport
  • Eventually: patchset that needs to be verified in alpha before backport

(Optional) Justification

  • Emergency security update: patchset fixes CVEs, 0-days, etc
  • Censorship event: patchset enables censorship circumvention
  • Critical bug-fix: patchset fixes a bug in core-functionality
  • Consistency: patchset which would make development easier if it were in both the alpha and release branches; developer tools, build system changes, etc
  • Sponsor required: patchset required for sponsor
  • Other: please explain

Issue Tracking

Review

Request Reviewer

  • Request review from an applications developer depending on modified system:
    • NOTE: if the MR modifies multiple areas, please /cc all the relevant reviewers (since gitlab only allows 1 reviewer)
    • accessibility : henry
    • android : clairehurst, dan
    • build system : boklm
    • extensions : ma1
    • firefox internals (XUL/JS/XPCOM) : jwilde, ma1
    • fonts : pierov
    • frontend (implementation) : henry
    • frontend (review) : donuts, morgan
    • localization : henry, pierov
    • macOS : clairehurst, dan
    • nightly builds : boklm
    • rebases/release-prep : boklm, dan, ma1, morgan, pierov
    • security : jwilde, ma1
    • signing : boklm, morgan
    • updater : pierov
    • windows : jwilde, morgan
    • misc/other : morgan, pierov

Change Description

We add a script to convert the "merged" branding files in the translations repository into a branding file specific to this release.

NOTE: Depends on tor-browser!1381 (merged).

NOTE: This shouldn't need to be backported to the 13.5 or 14.0 branches. Both those releases should be fine to use the brand.ftl and brand.properties files directly. The only difference is that the unused string will be called -brand-short-name_alpha rather than -brand-short-name_alpha_UNUSED, etc, which should not have an impact.

NOTE: The brandShortName_alpha, brandShortName_nightly, brandFullName_alpha and brandFullName_nightly strings will need to be present in the brand.properties files for each built locale in the translations repository. Otherwise, I believe the alpha and nightly builds will start throwing some errors when in the non en-US locale because the strings are missing. I think Weblate will automatically fill these initial values with the en-US strings, but we should verify this, and could delay this merge request until then.

How Tested

I've not actually run the firefox/build script.

I have tested the rename-branding-strings.py script separately with different inputs. And I've tested my changes to the firefox/build script in my own terminal via copy-paste.

Tested the rename-branding-strings.py script with the input file brand.ftl with the content:

# For Tor Browser, we use a new file (different than the brand.ftl file
# that is used by Firefox) to avoid picking up the -brand-short-name values
# that Mozilla includes in the Firefox language packs.

-brand-shorter-name = Tor Browser
-brand-short-name = Tor Browser
-brand-full-name = Tor Browser
# This brand name can be used in messages where the product name needs to
# remain unchanged across different versions (Nightly, Beta, etc.).
-brand-product-name = Tor Browser
-vendor-short-name = Tor Project
# "Tor" is a trademark names, so should not be translated (not including the quote marks, which can be localized).
# "The Tor Project, Inc." is an organisation name.
trademarkInfo = “Tor” and the Tor logo are registered trademarks of The Tor Project, Inc.


## Alpha Release

-brand-short-name_alpha = Tor Browser Alpha
-brand-full-name_alpha = Tor Browser Alpha


## Nightly Release

-brand-short-name_nightly = Tor Browser Nightly
-brand-full-name_nightly = Tor Browser Nightly

Using the suffix '', this becomes:

# For Tor Browser, we use a new file (different than the brand.ftl file
# that is used by Firefox) to avoid picking up the -brand-short-name values
# that Mozilla includes in the Firefox language packs.

-brand-shorter-name = Tor Browser
-brand-short-name = Tor Browser
-brand-full-name = Tor Browser
# This brand name can be used in messages where the product name needs to
# remain unchanged across different versions (Nightly, Beta, etc.).
-brand-product-name = Tor Browser
-vendor-short-name = Tor Project
# "Tor" is a trademark names, so should not be translated (not including the quote marks, which can be localized).
# "The Tor Project, Inc." is an organisation name.
trademarkInfo = “Tor” and the Tor logo are registered trademarks of The Tor Project, Inc.


## Alpha Release

-brand-short-name_alpha_UNUSED = Tor Browser Alpha
-brand-full-name_alpha_UNUSED = Tor Browser Alpha


## Nightly Release

-brand-short-name_nightly_UNUSED = Tor Browser Nightly
-brand-full-name_nightly_UNUSED = Tor Browser Nightly

and with the suffix _alpha this becomes:

# For Tor Browser, we use a new file (different than the brand.ftl file
# that is used by Firefox) to avoid picking up the -brand-short-name values
# that Mozilla includes in the Firefox language packs.

-brand-shorter-name = Tor Browser
-brand-short-name_UNUSED = Tor Browser
-brand-full-name_UNUSED = Tor Browser
# This brand name can be used in messages where the product name needs to
# remain unchanged across different versions (Nightly, Beta, etc.).
-brand-product-name = Tor Browser
-vendor-short-name = Tor Project
# "Tor" is a trademark names, so should not be translated (not including the quote marks, which can be localized).
# "The Tor Project, Inc." is an organisation name.
trademarkInfo = “Tor” and the Tor logo are registered trademarks of The Tor Project, Inc.


## Alpha Release

-brand-short-name = Tor Browser Alpha
-brand-full-name = Tor Browser Alpha


## Nightly Release

-brand-short-name_nightly_UNUSED = Tor Browser Nightly
-brand-full-name_nightly_UNUSED = Tor Browser Nightly

Similarly, tested with brand.properties with the content:

# Copyright (c) 2022, The Tor Project, Inc.
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.

brandShorterName=Tor Browser
brandShortName=Tor Browser
brandFullName=Tor Browser

# Alpha Release
brandShortName_alpha=Tor Browser Alpha
# Alpha Release
brandFullName_alpha=Tor Browser Alpha

# Nightly Release
brandShortName_nightly=Tor Browser Nightly
# Nightly Release
brandFullName_nightly=Tor Browser Nightly

Using the suffix '', this becomes

# Copyright (c) 2022, The Tor Project, Inc.
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.

brandShorterName=Tor Browser
brandShortName=Tor Browser
brandFullName=Tor Browser

# Alpha Release
brandShortName_alpha_UNUSED=Tor Browser Alpha
# Alpha Release
brandFullName_alpha_UNUSED=Tor Browser Alpha

# Nightly Release
brandShortName_nightly_UNUSED=Tor Browser Nightly
# Nightly Release
brandFullName_nightly_UNUSED=Tor Browser Nightly

and with the suffix _alpha this becomes:

# Copyright (c) 2022, The Tor Project, Inc.
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.

brandShorterName=Tor Browser
brandShortName_UNUSED=Tor Browser
brandFullName_UNUSED=Tor Browser

# Alpha Release
brandShortName=Tor Browser Alpha
# Alpha Release
brandFullName=Tor Browser Alpha

# Nightly Release
brandShortName_nightly_UNUSED=Tor Browser Nightly
# Nightly Release
brandFullName_nightly_UNUSED=Tor Browser Nightly
Edited by henry

Merge request reports

Loading