Skip to content
This repository has been archived by the owner on Aug 4, 2022. It is now read-only.

Commit

Permalink
Bug 1613801 - Don't include brand name in the window title on Mac. r=…
Browse files Browse the repository at this point in the history
…fluent-reviewers,flod,Gijs

Differential Revision: https://phabricator.services.mozilla.com/D62391
  • Loading branch information
Zibi Braniecki committed Feb 17, 2020
1 parent 29f983b commit 1dc9143
Show file tree
Hide file tree
Showing 3 changed files with 61 additions and 17 deletions.
6 changes: 4 additions & 2 deletions browser/base/content/tabbrowser.js
Original file line number Diff line number Diff line change
Expand Up @@ -973,10 +973,12 @@

if (title) {
return {
id: "browser-main-window-content-title",
id:
mode == "private"
? "browser-main-window-content-title-private"
: "browser-main-window-content-title-default",
args: {
title,
mode,
},
};
}
Expand Down
41 changes: 26 additions & 15 deletions browser/locales/en-US/browser/browser.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -18,21 +18,32 @@ browser-main-window-title = { $mode ->
*[default] { -brand-full-name }
}
# This is the default window title in case there is a content
# title to be displayed.
#
# Depending on the $mode, the string will look like this (in en-US):
#
# "default" - "Example Title - Mozilla Firefox"
# "private" - "Example Title - Mozilla Firefox (Private Browsing)"
#
# Variables
# $mode (String) - "private" in case of a private browsing mode, "default" otherwise.
# $title (String) - Content title string.
browser-main-window-content-title = { $mode ->
[private] { $title } - { -brand-full-name } (Private Browsing)
*[default] { $title } - { -brand-full-name }
}
## This is the default window title in case there is content
## title to be displayed.
##
## On macOS the title doesn't include the brand name, on all other
## platforms it does.
##
## For example, in private mode on Windows, the title will be:
## "Example Title - Mozilla Firefox (Private Browsing)"
##
## while on macOS in default mode it will be:
## "Example Title"
##
## Variables
## $title (String) - Content title string.

browser-main-window-content-title-default = { PLATFORM() ->
[macos] { $title }
*[other] { $title } - { -brand-full-name }
}
browser-main-window-content-title-private = { PLATFORM() ->
[macos] { $title } - (Private Browsing)
*[other] { $title } - { -brand-full-name } (Private Browsing)
}
##

urlbar-identity-button =
.aria-label = View site information
Expand Down
31 changes: 31 additions & 0 deletions python/l10n/fluent_migrations/bug_1613801_window_title_mac.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# coding=utf8

# Any copyright is dedicated to the Public Domain.
# http://creativecommons.org/publicdomain/zero/1.0/

from __future__ import absolute_import
import fluent.syntax.ast as FTL
from fluent.migrate.helpers import transforms_from


def migrate(ctx):
"""Bug 1613801 - Don't include brand name in the window title on Mac., part {index}."""

ctx.add_transforms(
'browser/browser/browser.ftl',
'browser/browser/browser.ftl',
transforms_from(
"""
browser-main-window-content-title-default = { PLATFORM() ->
[macos] { $title }
*[other] { $title } - { -brand-full-name }
}
browser-main-window-content-title-private = { PLATFORM() ->
[macos] { $title } - {COPY(from_path, "mainWindow.titlePrivateBrowsingSuffix", trim:"True")}
*[other] { $title } - { -brand-full-name } {COPY(from_path, "mainWindow.titlePrivateBrowsingSuffix", trim:"True")}
}
""", from_path="browser/chrome/browser/browser.dtd")
)


0 comments on commit 1dc9143

Please sign in to comment.