Bug 1906902 – Add l10n strings for topic selection r=home-newtab-reviewers,fluent-reviewers,bolsson,thecount

Differential Revision: https://phabricator.services.mozilla.com/D217770
This commit is contained in:
Amy Churchwell 2024-07-31 19:50:13 +00:00
parent 2f49d88821
commit 6704326694
3 changed files with 46 additions and 49 deletions

View File

@ -7,21 +7,6 @@ import { useDispatch, useSelector } from "react-redux";
import { ModalOverlayWrapper } from "content-src/components/ModalOverlay/ModalOverlay";
import { actionCreators as ac, actionTypes as at } from "common/Actions.mjs";
// TODO: move strings to newtab.ftl once strings have been approved
const TOPIC_LABELS = {
"newtab-topic-business": "Business",
"newtab-topic-arts": "Entertainment",
"newtab-topic-food": "Food",
"newtab-topic-health": "Health",
"newtab-topic-finance": "Money",
"newtab-topic-government": "Politics",
"newtab-topic-sports": "Sports",
"newtab-topic-tech": "Tech",
"newtab-topic-travel": "Travel",
"newtab-topic-education": "Science",
"newtab-topic-society": "Life Hacks",
};
const EMOJI_LABELS = {
business: "💼",
arts: "🎭",
@ -242,11 +227,11 @@ function TopicSelection() {
title="dismiss"
onClick={handleUserClose}
/>
<h1 className="title">Select topics you care about</h1>
<p className="subtitle">
Tell us what you are interested in and well recommend you great
stories!
</p>
<h1 className="title" data-l10n-id="newtab-topic-selection-title" />
<p
className="subtitle"
data-l10n-id="newtab-topic-selection-subtitle"
/>
<div className="topic-list" ref={checkboxWrapperRef}>
{topics.map((topic, i) => {
const checked = topicsToSelect.includes(topic);
@ -266,17 +251,19 @@ function TopicSelection() {
<span className="topic-icon">{EMOJI_LABELS[`${topic}`]}</span>
<span className="topic-checked" />
</div>
<span className="topic-item-label">
{TOPIC_LABELS[`newtab-topic-${topic}`]}
</span>
<span
className="topic-item-label"
data-l10n-id={`newtab-topic-label-${topic}`}
/>
</label>
);
})}
</div>
<div className="modal-footer">
<a href="https://support.mozilla.org/en-US/kb/pocket-recommendations-firefox-new-tab">
How we protect your data and privacy
</a>
<a
href="https://support.mozilla.org/en-US/kb/pocket-recommendations-firefox-new-tab"
data-l10n-id="newtab-topic-selection-privacy-link"
/>
<moz-button-group className="button-group">
<moz-button
id={isFirstRun ? "first-run" : ""}
@ -285,6 +272,11 @@ function TopicSelection() {
/>
<moz-button
label={isFirstRun ? "Save topics" : "Save"}
data-l10n-id="newtab-topic-selection-cancel-button"
onClick={handleModalClose}
/>
<moz-button
data-l10n-id="newtab-topic-selection-save-button"
type="primary"
onClick={handleSubmit}
/>

View File

@ -10644,21 +10644,6 @@ function Notifications_Notifications({
// TODO: move strings to newtab.ftl once strings have been approved
const TOPIC_LABELS = {
"newtab-topic-business": "Business",
"newtab-topic-arts": "Entertainment",
"newtab-topic-food": "Food",
"newtab-topic-health": "Health",
"newtab-topic-finance": "Money",
"newtab-topic-government": "Politics",
"newtab-topic-sports": "Sports",
"newtab-topic-tech": "Tech",
"newtab-topic-travel": "Travel",
"newtab-topic-education": "Science",
"newtab-topic-society": "Life Hacks"
};
const EMOJI_LABELS = {
business: "💼",
arts: "🎭",
@ -10822,10 +10807,12 @@ function TopicSelection() {
title: "dismiss",
onClick: handleUserClose
}), /*#__PURE__*/external_React_default().createElement("h1", {
className: "title"
}, "Select topics you care about"), /*#__PURE__*/external_React_default().createElement("p", {
className: "subtitle"
}, "Tell us what you are interested in and we\u2019ll recommend you great stories!"), /*#__PURE__*/external_React_default().createElement("div", {
className: "title",
"data-l10n-id": "newtab-topic-selection-title"
}), /*#__PURE__*/external_React_default().createElement("p", {
className: "subtitle",
"data-l10n-id": "newtab-topic-selection-subtitle"
}), /*#__PURE__*/external_React_default().createElement("div", {
className: "topic-list",
ref: checkboxWrapperRef
}, topics.map((topic, i) => {
@ -10849,13 +10836,15 @@ function TopicSelection() {
}, EMOJI_LABELS[`${topic}`]), /*#__PURE__*/external_React_default().createElement("span", {
className: "topic-checked"
})), /*#__PURE__*/external_React_default().createElement("span", {
className: "topic-item-label"
}, TOPIC_LABELS[`newtab-topic-${topic}`]));
className: "topic-item-label",
"data-l10n-id": `newtab-topic-label-${topic}`
}));
})), /*#__PURE__*/external_React_default().createElement("div", {
className: "modal-footer"
}, /*#__PURE__*/external_React_default().createElement("a", {
href: "https://support.mozilla.org/en-US/kb/pocket-recommendations-firefox-new-tab"
}, "How we protect your data and privacy"), /*#__PURE__*/external_React_default().createElement("moz-button-group", {
href: "https://support.mozilla.org/en-US/kb/pocket-recommendations-firefox-new-tab",
"data-l10n-id": "newtab-topic-selection-privacy-link"
}), /*#__PURE__*/external_React_default().createElement("moz-button-group", {
className: "button-group"
}, /*#__PURE__*/external_React_default().createElement("moz-button", {
id: isFirstRun ? "first-run" : "",
@ -10863,6 +10852,10 @@ function TopicSelection() {
onClick: handleUserClose
}), /*#__PURE__*/external_React_default().createElement("moz-button", {
label: isFirstRun ? "Save topics" : "Save",
"data-l10n-id": "newtab-topic-selection-cancel-button",
onClick: handleModalClose
}), /*#__PURE__*/external_React_default().createElement("moz-button", {
"data-l10n-id": "newtab-topic-selection-save-button",
type: "primary",
onClick: handleSubmit
})))));

View File

@ -412,3 +412,15 @@ newtab-topic-label-society = Life Hacks
newtab-topic-label-sports = Sports
newtab-topic-label-tech = Tech
newtab-topic-label-travel = Travel
## Topic Selection Modal
# “fine-tune” refers to the process of making small adjustments to something to get
# the best or desired experience or performance.
newtab-topic-selection-title = Select topics to fine-tune your feed
# “tailored” refers to process of (a tailor) making (clothes) to fit individual customers.
# In other words, “Our expert curators prioritize stories to fit your selected interests”
newtab-topic-selection-subtitle = Choose two or more topics. Our expert curators prioritize stories tailored to your interests. Update anytime.
newtab-topic-selection-save-button = Save
newtab-topic-selection-cancel-button = Cancel
newtab-topic-selection-privacy-link = Learn how we protect your data and privacy