Bug 1928738: Change the localized name of the default profile. r=niklas,fluent-reviewers,flod

Differential Revision: https://phabricator.services.mozilla.com/D227759
This commit is contained in:
Jared Hirsch
2024-11-09 03:02:38 +00:00
parent 9d1167a19e
commit a88a8a7c29
2 changed files with 15 additions and 6 deletions

View File

@@ -858,10 +858,14 @@ class SelectableProfileServiceClass {
* @returns {SelectableProfile} The newly created profile object.
*/
async #createProfile(existingProfilePath) {
let nextProfileNumber =
1 + Math.max(0, ...(await this.getAllProfiles()).map(p => p.id));
let [defaultName] = lazy.profilesLocalization.formatMessagesSync([
let nextProfileNumber = Math.max(
0,
...(await this.getAllProfiles()).map(p => p.id)
);
let [defaultName, originalName] =
lazy.profilesLocalization.formatMessagesSync([
{ id: "default-profile-name", args: { number: nextProfileNumber } },
{ id: "original-profile-name" },
]);
let window = Services.wm.getMostRecentBrowserWindow();
@@ -869,7 +873,9 @@ class SelectableProfileServiceClass {
let randomIndex = Math.floor(Math.random() * this.#defaultAvatars.length);
let profileData = {
name: defaultName.value,
// The original toolkit profile is added first and is assigned a
// different name.
name: nextProfileNumber == 0 ? originalName.value : defaultName.value,
avatar: this.#defaultAvatars[randomIndex],
themeId: "default-theme@mozilla.org",
themeFg: isDark ? "rgb(255,255,255)" : "rgb(21,20,26)",

View File

@@ -14,6 +14,9 @@ profile-window-create-profile = Create a profile
# $number (number) - The number of the profile
default-profile-name = Profile { $number }
# The word 'original' is used in the sense that it is the initial or starting profile when you install Firefox.
original-profile-name = Original profile
edit-profile-page-title = Edit profile
edit-profile-page-header = Edit your profile
edit-profile-page-profile-name-label = Profile name