Bug 1685133 - String changes due to newtab updates r=preferences-reviewers,prathiksha,fluent-reviewers,flod,ntim

Differential Revision: https://phabricator.services.mozilla.com/D100819
This commit is contained in:
Erica Wright 2021-01-08 07:34:44 +00:00
Родитель 8a8ce8a54f
Коммит eed886e7e2
9 изменённых файлов: 71 добавлений и 10 удалений

Просмотреть файл

@ -569,6 +569,25 @@ const PanelUI = {
);
}
// When these prefs are made the default, add this data-l10n-id directly to browser.xhtml.
if (
Services.prefs.getBoolPref(
"browser.newtabpage.activity-stream.customizationMenu.enabled"
) ||
Services.prefs.getBoolPref(
"browser.newtabpage.activity-stream.newNewtabExperience.enabled"
)
) {
this.libraryRecentHighlights.previousElementSibling.setAttribute(
"data-l10n-id",
"library-recent-activity-label"
);
} else {
this.libraryRecentHighlights.previousElementSibling.removeAttribute(
"data-l10n-id"
);
}
// Make the elements invisible synchronously, before the view is shown.
this.makeLibraryRecentHighlightsInvisible();

Просмотреть файл

@ -238,15 +238,25 @@ export class TopSiteForm extends React.PureComponent {
const onSubmit = previewMode
? this.onPreviewButtonClick
: this.onDoneButtonClick;
// When the newNewtabExperience is enabled by default, use only shortcut ids.
const addTopsitesHeaderL10nId =
this.props.newNewtabExperienceEnabled ||
this.props.customizationMenuEnabled
? "newtab-topsites-add-shortcut-header"
: "newtab-topsites-add-topsites-header";
const editTopsitesHeaderL10nId =
this.props.newNewtabExperienceEnabled ||
this.props.customizationMenuEnabled
? "newtab-topsites-edit-shortcut-header"
: "newtab-topsites-edit-topsites-header";
return (
<form className="topsite-form" onSubmit={onSubmit}>
<div className="form-input-container">
<h3
className="section-title grey-title"
data-l10n-id={
showAsAdd
? "newtab-topsites-add-topsites-header"
: "newtab-topsites-edit-topsites-header"
showAsAdd ? addTopsitesHeaderL10nId : editTopsitesHeaderL10nId
}
/>
<div className="fields-and-preview">

Просмотреть файл

@ -141,6 +141,8 @@ export class _TopSites extends React.PureComponent {
const extraMenuOptions = ["AddTopSite"];
const newNewtabExperienceEnabled =
props.Prefs.values["newNewtabExperience.enabled"];
const customizationMenuEnabled =
props.Prefs.values["customizationMenu.enabled"];
const colors = props.Prefs.values["newNewtabExperience.colors"];
if (props.Prefs.values["improvesearch.topSiteSearchShortcuts"]) {
@ -148,8 +150,7 @@ export class _TopSites extends React.PureComponent {
}
const canShowCustomizationMenu =
props.Prefs.values["newNewtabExperience.enabled"] ||
props.Prefs.values["customizationMenu.enabled"];
newNewtabExperienceEnabled || customizationMenuEnabled;
const hideTitle =
props.Prefs.values.hideTopSitesTitle || canShowCustomizationMenu;
@ -205,6 +206,7 @@ export class _TopSites extends React.PureComponent {
dispatch={this.props.dispatch}
{...editForm}
newNewtabExperienceEnabled={newNewtabExperienceEnabled}
customizationMenuEnabled={customizationMenuEnabled}
/>
</ModalOverlayWrapper>
</div>

Просмотреть файл

@ -8618,13 +8618,14 @@ class _TopSites extends react__WEBPACK_IMPORTED_MODULE_6___default.a.PureCompone
} = props.TopSites;
const extraMenuOptions = ["AddTopSite"];
const newNewtabExperienceEnabled = props.Prefs.values["newNewtabExperience.enabled"];
const customizationMenuEnabled = props.Prefs.values["customizationMenu.enabled"];
const colors = props.Prefs.values["newNewtabExperience.colors"];
if (props.Prefs.values["improvesearch.topSiteSearchShortcuts"]) {
extraMenuOptions.push("AddSearchShortcut");
}
const canShowCustomizationMenu = props.Prefs.values["newNewtabExperience.enabled"] || props.Prefs.values["customizationMenu.enabled"];
const canShowCustomizationMenu = newNewtabExperienceEnabled || customizationMenuEnabled;
const hideTitle = props.Prefs.values.hideTopSitesTitle || canShowCustomizationMenu; // `collapsed` should be sent to CollapsibleSection as undefined if
// `props.TopSites.pref` is not set to true.
@ -8674,7 +8675,8 @@ class _TopSites extends react__WEBPACK_IMPORTED_MODULE_6___default.a.PureCompone
onClose: this.onEditFormClose,
dispatch: this.props.dispatch
}, editForm, {
newNewtabExperienceEnabled: newNewtabExperienceEnabled
newNewtabExperienceEnabled: newNewtabExperienceEnabled,
customizationMenuEnabled: customizationMenuEnabled
})))), showSearchShortcutsForm && react__WEBPACK_IMPORTED_MODULE_6___default.a.createElement("div", {
className: "edit-search-shortcuts"
}, react__WEBPACK_IMPORTED_MODULE_6___default.a.createElement(_asrouter_components_ModalOverlay_ModalOverlay__WEBPACK_IMPORTED_MODULE_5__["ModalOverlayWrapper"], {
@ -15842,7 +15844,10 @@ class TopSiteForm_TopSiteForm extends external_React_default.a.PureComponent {
} // Handles the form submit so an enter press performs the correct action
const onSubmit = previewMode ? this.onPreviewButtonClick : this.onDoneButtonClick;
const onSubmit = previewMode ? this.onPreviewButtonClick : this.onDoneButtonClick; // When the newNewtabExperience is enabled by default, use only "newtab-topsites-add-shortcut-header".
const addTopsitesHeaderL10nId = this.props.newNewtabExperienceEnabled || this.props.customizationMenuEnabled ? "newtab-topsites-add-shortcut-header" : "newtab-topsites-add-topsites-header";
const editTopsitesHeaderL10nId = this.props.newNewtabExperienceEnabled || this.props.customizationMenuEnabled ? "newtab-topsites-edit-shortcut-header" : "newtab-topsites-edit-topsites-header";
return external_React_default.a.createElement("form", {
className: "topsite-form",
onSubmit: onSubmit
@ -15850,7 +15855,7 @@ class TopSiteForm_TopSiteForm extends external_React_default.a.PureComponent {
className: "form-input-container"
}, external_React_default.a.createElement("h3", {
className: "section-title grey-title",
"data-l10n-id": showAsAdd ? "newtab-topsites-add-topsites-header" : "newtab-topsites-edit-topsites-header"
"data-l10n-id": showAsAdd ? addTopsitesHeaderL10nId : editTopsitesHeaderL10nId
}), external_React_default.a.createElement("div", {
className: "fields-and-preview"
}, external_React_default.a.createElement("div", {

Просмотреть файл

@ -630,7 +630,7 @@
preference="browser.urlbar.suggest.bookmark"/>
<checkbox id="openpageSuggestion" data-l10n-id="addressbar-locbar-openpage-option"
preference="browser.urlbar.suggest.openpage"/>
<checkbox id="topSitesSuggestion" data-l10n-id="addressbar-locbar-topsites-option"
<checkbox id="topSitesSuggestion"
preference="browser.urlbar.suggest.topsites"/>
<checkbox id="enginesSuggestion" data-l10n-id="addressbar-locbar-engines-option"
preference="browser.urlbar.suggest.engines"/>

Просмотреть файл

@ -729,6 +729,24 @@ var gPrivacyPane = {
}
}
// When these prefs are made the default, add this data-l10n-id directly to privacy.inc.xhtml.
if (
Services.prefs.getBoolPref(
"browser.newtabpage.activity-stream.newNewtabExperience.enabled"
) ||
Services.prefs.getBoolPref(
"browser.newtabpage.activity-stream.customizationMenu.enabled"
)
) {
document
.getElementById("topSitesSuggestion")
.setAttribute("data-l10n-id", "addressbar-locbar-shortcuts-option");
} else {
document
.getElementById("topSitesSuggestion")
.setAttribute("data-l10n-id", "addressbar-locbar-topsites-option");
}
this.initSiteDataControls();
setEventListener(
"clearSiteDataButton",

Просмотреть файл

@ -585,6 +585,7 @@ library-bookmarks-bookmark-this-page =
.label = Bookmark This Page
library-bookmarks-bookmark-edit =
.label = Edit This Bookmark
library-recent-activity-label = Recent Activity
## More items

Просмотреть файл

@ -33,7 +33,9 @@ newtab-search-box-input =
newtab-topsites-add-search-engine-header = Add Search Engine
newtab-topsites-add-topsites-header = New Top Site
newtab-topsites-add-shortcut-header = New Shortcut
newtab-topsites-edit-topsites-header = Edit Top Site
newtab-topsites-edit-shortcut-header = Edit Shortcut
newtab-topsites-title-label = Title
newtab-topsites-title-input =
.placeholder = Enter a title

Просмотреть файл

@ -1112,6 +1112,10 @@ addressbar-locbar-bookmarks-option =
addressbar-locbar-openpage-option =
.label = Open tabs
.accesskey = O
# Shortcuts refers to the shortcut tiles on the new tab page, previously known as top sites. Translation should be consistent.
addressbar-locbar-shortcuts-option =
.label = Shortcuts
.accesskey = S
addressbar-locbar-topsites-option =
.label = Top sites
.accesskey = T