commit dd69bd06e757a8c8ff57b262607809d1ed3c637d
parent 37681103ded813519cc396ce2809eb54023a8d89
Author: Reem H <42309026+reemhamz@users.noreply.github.com>
Date: Thu, 2 Oct 2025 02:32:53 +0000
Bug 1988917 - Add localization strings for Weather Opt-in. r=home-newtab-reviewers,fluent-reviewers,npypchenko,bolsson
Differential Revision: https://phabricator.services.mozilla.com/D265049
Diffstat:
3 files changed, 23 insertions(+), 9 deletions(-)
diff --git a/browser/extensions/newtab/content-src/components/Weather/Weather.jsx b/browser/extensions/newtab/content-src/components/Weather/Weather.jsx
@@ -376,7 +376,10 @@ export class _Weather extends React.PureComponent {
</span>
</div>
<div className="weatherCityRow">
- <span className="weatherCity">New York City</span>
+ <span
+ className="weatherCity"
+ data-l10n-id="newtab-weather-static-city"
+ ></span>
</div>
</div>
</div>
@@ -462,18 +465,18 @@ export class _Weather extends React.PureComponent {
<dialog open={true}>
<span className="weatherOptInImg"></span>
<div className="weatherOptInContent">
- <h3>Do you want to see the weather for your location?</h3>
+ <h3 data-l10n-id="newtab-weather-opt-in-see-weather"></h3>
<moz-button-group className="button-group">
<moz-button
size="small"
type="default"
- label="Not now"
+ data-l10n-id="newtab-weather-opt-in-not-now"
onClick={this.handleRejectOptIn}
/>
<moz-button
size="small"
type="default"
- label="Yes"
+ data-l10n-id="newtab-weather-opt-in-yes"
onClick={this.handleAcceptOptIn}
/>
</moz-button-group>
diff --git a/browser/extensions/newtab/data/content/activity-stream.bundle.js b/browser/extensions/newtab/data/content/activity-stream.bundle.js
@@ -11933,8 +11933,9 @@ class _Weather extends (external_React_default()).PureComponent {
}, "22\xB0", Prefs.values["weather.temperatureUnits"])), /*#__PURE__*/external_React_default().createElement("div", {
className: "weatherCityRow"
}, /*#__PURE__*/external_React_default().createElement("span", {
- className: "weatherCity"
- }, "New York City")))) : /*#__PURE__*/external_React_default().createElement("a", {
+ className: "weatherCity",
+ "data-l10n-id": "newtab-weather-static-city"
+ })))) : /*#__PURE__*/external_React_default().createElement("a", {
"data-l10n-id": "newtab-weather-see-forecast",
"data-l10n-args": "{\"provider\": \"AccuWeather\xAE\"}",
href: WEATHER_SUGGESTION.forecast.url,
@@ -11973,17 +11974,19 @@ class _Weather extends (external_React_default()).PureComponent {
className: "weatherOptInImg"
}), /*#__PURE__*/external_React_default().createElement("div", {
className: "weatherOptInContent"
- }, /*#__PURE__*/external_React_default().createElement("h3", null, "Do you want to see the weather for your location?"), /*#__PURE__*/external_React_default().createElement("moz-button-group", {
+ }, /*#__PURE__*/external_React_default().createElement("h3", {
+ "data-l10n-id": "newtab-weather-opt-in-see-weather"
+ }), /*#__PURE__*/external_React_default().createElement("moz-button-group", {
className: "button-group"
}, /*#__PURE__*/external_React_default().createElement("moz-button", {
size: "small",
type: "default",
- label: "Not now",
+ "data-l10n-id": "newtab-weather-opt-in-not-now",
onClick: this.handleRejectOptIn
}), /*#__PURE__*/external_React_default().createElement("moz-button", {
size: "small",
type: "default",
- label: "Yes",
+ "data-l10n-id": "newtab-weather-opt-in-yes",
onClick: this.handleAcceptOptIn
}))))));
}
diff --git a/browser/locales/en-US/browser/newtab/newtab.ftl b/browser/locales/en-US/browser/newtab/newtab.ftl
@@ -409,8 +409,16 @@ newtab-weather-menu-change-temperature-units-fahrenheit = Switch to Fahrenheit
newtab-weather-menu-change-temperature-units-celsius = Switch to Celsius
newtab-weather-menu-hide-weather = Hide weather on New Tab
newtab-weather-menu-learn-more = Learn more
+newtab-weather-menu-detect-my-location = Detect my location
# This message is shown if user is working offline
newtab-weather-error-not-available = Weather data is not available right now.
+newtab-weather-opt-in-see-weather = Do you want to see the weather for your location?
+newtab-weather-opt-in-not-now =
+ .label = Not now
+newtab-weather-opt-in-yes =
+ .label = Yes
+# We'll be showing static (fake) weather data if the user has not opted in to using their location
+newtab-weather-static-city = New York City
## Topic Labels