helium: move all hardcoded strings to grd for i18n (#1655)

fixes #1553
This commit is contained in:
jj authored and GitHub committed 2026-05-10 20:44:03 +00:00
1 parent e830f2cf55
commit 1884190d95
12 files changed
+79 -21

No files matched your search

+30
View File
@@ -35,6 +35,30 @@
"context": "Label for a performance settings toggle that controls whether performance intervention notifications should be shown and link to learn more about performance issue alerts.",
"message": "Get notifications that suggest ways to improve detected performance issues."
},
{
"name": "IDS_IMPORT_FULL_DISK_ACCESS_DIALOG_TITLE",
"source": "chrome/app/generated_resources.grd",
"context": "Title for the dialog shown when Full Disk Access is needed to import from Safari.",
"message": "Full Disk Access required"
},
{
"name": "IDS_IMPORT_FULL_DISK_ACCESS_DIALOG_MESSAGE",
"source": "chrome/app/generated_resources.grd",
"context": "Message for the dialog shown when Full Disk Access is needed to import bookmarks from Safari.",
"message": "Helium needs Full Disk Access to import your Bookmarks from Safari."
},
{
"name": "IDS_IMPORT_FULL_DISK_ACCESS_DIALOG_LINK",
"source": "chrome/app/generated_resources.grd",
"context": "Help link text in the dialog shown when Full Disk Access is needed to import from Safari.",
"message": "Learn how to grant Full Disk Access from your System Preferences."
},
{
"name": "IDS_IMPORT_FULL_DISK_ACCESS_DIALOG_OPEN_SETTINGS",
"source": "chrome/app/generated_resources.grd",
"context": "Accept button text for opening System Preferences from the Full Disk Access import dialog.",
"message": "Open System Preferences"
},
{
"name": "IDS_IMPORTED_FROM_BOOKMARK_FOLDER",
"source": "chrome/app/generated_resources.grd",
@@ -119,6 +143,12 @@
"context": "ARIA label of the text input for overriding the Helium services server",
"message": "Custom origin URL for Helium services"
},
{
"name": "IDS_SETTINGS_HELIUM_SERVICES_OVERRIDE_INVALID_ORIGIN",
"source": "chrome/app/settings_strings.grdp",
"context": "Validation error shown when the custom Helium services origin is invalid.",
"message": "Invalid origin"
},
{
"name": "IDS_APPMENU_TOOLTIP_HELIUM_SERVICES_UPDATE",
"source": "chrome/app/chromium_strings.grd",
+28 -5
View File
@@ -1873,21 +1873,21 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
+FullDiskAccessConfirmDialogDelegate::~FullDiskAccessConfirmDialogDelegate() =
+ default;
+
+// TODO: figure out l10n
+std::u16string FullDiskAccessConfirmDialogDelegate::GetTitle() {
+ return u"Full Disk Access required";
+ return l10n_util::GetStringUTF16(IDS_IMPORT_FULL_DISK_ACCESS_DIALOG_TITLE);
+}
+
+std::u16string FullDiskAccessConfirmDialogDelegate::GetDialogMessage() {
+ return u"Helium needs Full Disk Access to import your Bookmarks from Safari.";
+ return l10n_util::GetStringUTF16(IDS_IMPORT_FULL_DISK_ACCESS_DIALOG_MESSAGE);
+}
+
+std::u16string FullDiskAccessConfirmDialogDelegate::GetLinkText() const {
+ return u"Learn how to grant Full Disk Access from your System Preferences.";
+ return l10n_util::GetStringUTF16(IDS_IMPORT_FULL_DISK_ACCESS_DIALOG_LINK);
+}
+
+std::u16string FullDiskAccessConfirmDialogDelegate::GetAcceptButtonTitle() {
+ return u"Open System Preferences";
+ return l10n_util::GetStringUTF16(
+ IDS_IMPORT_FULL_DISK_ACCESS_DIALOG_OPEN_SETTINGS);
+}
+
+void FullDiskAccessConfirmDialogDelegate::OnAccepted() {
@@ -3255,3 +3255,26 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
+};
+
+#endif // BRAVE_UTILITY_IMPORTER_CHROME_IMPORTER_H_
--- a/chrome/app/generated_resources.grd
+++ b/chrome/app/generated_resources.grd
@@ -11594,6 +11594,20 @@ Check your passwords anytime in <ph name
<message name="IDS_IMPORT_FROM_SAFARI" desc="browser combo box: Safari">
Safari
</message>
+ <if expr="is_macosx">
+ <message name="IDS_IMPORT_FULL_DISK_ACCESS_DIALOG_TITLE" desc="Title for the dialog shown when Full Disk Access is needed to import from Safari.">
+ Full Disk Access required
+ </message>
+ <message name="IDS_IMPORT_FULL_DISK_ACCESS_DIALOG_MESSAGE" desc="Message for the dialog shown when Full Disk Access is needed to import bookmarks from Safari.">
+ Helium needs Full Disk Access to import your Bookmarks from Safari.
+ </message>
+ <message name="IDS_IMPORT_FULL_DISK_ACCESS_DIALOG_LINK" desc="Help link text in the dialog shown when Full Disk Access is needed to import from Safari.">
+ Learn how to grant Full Disk Access from your System Preferences.
+ </message>
+ <message name="IDS_IMPORT_FULL_DISK_ACCESS_DIALOG_OPEN_SETTINGS" desc="Accept button text for opening System Preferences from the Full Disk Access import dialog.">
+ Open System Preferences
+ </message>
+ </if>
<message name="IDS_IMPORT_FROM_BOOKMARKS_HTML_FILE" desc="browser combo box: Bookmarks HTML File">
Bookmarks HTML File
</message>
+2 -2
View File
@@ -1,6 +1,6 @@
--- a/chrome/app/generated_resources.grd
+++ b/chrome/app/generated_resources.grd
@@ -12031,6 +12031,9 @@ Check your passwords anytime in <ph name
@@ -12045,6 +12045,9 @@ Check your passwords anytime in <ph name
<message name="IDS_TAB_CXMENU_CLOSETABSBELOW" desc="The label of the 'Close Tabs Below' Tab context menu item.">
Close tabs below
</message>
@@ -10,7 +10,7 @@
<message name="IDS_TAB_CXMENU_CLOSEALLTABS" desc="The label of the 'Close All Tabs' Tab context menu item.">
Close all tabs
</message>
@@ -12150,6 +12153,9 @@ Check your passwords anytime in <ph name
@@ -12164,6 +12167,9 @@ Check your passwords anytime in <ph name
<message name="IDS_TAB_CXMENU_CLOSETABSBELOW" desc="In Title Case: The label of the 'Close Tabs Below' Tab context menu item.">
Close Tabs Below
</message>
@@ -1,6 +1,6 @@
--- a/chrome/app/generated_resources.grd
+++ b/chrome/app/generated_resources.grd
@@ -12013,6 +12013,9 @@ Check your passwords anytime in <ph name
@@ -12027,6 +12027,9 @@ Check your passwords anytime in <ph name
<message name="IDS_TAB_CXMENU_DUPLICATE" desc="The label of the 'Duplicate' Tab context menu item.">
Duplicate
</message>
@@ -10,7 +10,7 @@
<message name="IDS_TAB_CXMENU_CLOSETAB" desc="The label of the tab context menu item for closing one or more tabs.">
Close
</message>
@@ -12129,6 +12132,9 @@ Check your passwords anytime in <ph name
@@ -12143,6 +12146,9 @@ Check your passwords anytime in <ph name
<message name="IDS_TAB_CXMENU_DUPLICATE" desc="In Title Case: The label of the 'Duplicate' Tab context menu item.">
Duplicate
</message>
@@ -16,7 +16,7 @@
#include "components/safe_browsing/core/common/features.h"
#include "components/safe_browsing/core/common/hashprefix_realtime/hash_realtime_utils.h"
#include "components/saved_tab_groups/public/features.h"
@@ -2889,14 +2887,9 @@ void AddSearchStrings(content::WebUIData
@@ -2891,14 +2889,9 @@ void AddSearchStrings(content::WebUIData
html_source->AddString("searchExplanationLearnMoreURL",
chrome::kOmniboxLearnMoreURL);
+8 -3
View File
@@ -1,6 +1,6 @@
--- a/chrome/app/settings_strings.grdp
+++ b/chrome/app/settings_strings.grdp
@@ -1950,6 +1950,40 @@
@@ -1950,6 +1950,43 @@
<message name="IDS_SETTINGS_SECURITY_DESCRIPTION" desc="Description of the controls available on the security settings page">
Safe Browsing (protection from dangerous sites) and other security settings
</message>
@@ -37,13 +37,16 @@
+ <message name="IDS_SETTINGS_HELIUM_SERVICES_OVERRIDE_ARIA_LABEL" desc="ARIA label of the text input for overriding the Helium services server">
+ Custom origin URL for Helium services
+ </message>
+ <message name="IDS_SETTINGS_HELIUM_SERVICES_OVERRIDE_INVALID_ORIGIN" desc="Validation error shown when the custom Helium services origin is invalid.">
+ Invalid origin
+ </message>
+
<message name="IDS_SETTINGS_ADVANCED_PROTECTION_PROGRAM" desc="Name of the link which takes users
to the Google Advanced Protection Program external webpage">
Google Advanced Protection Program
--- a/chrome/browser/ui/webui/settings/settings_localized_strings_provider.cc
+++ b/chrome/browser/ui/webui/settings/settings_localized_strings_provider.cc
@@ -2230,6 +2230,23 @@ void AddPrivacyStrings(content::WebUIDat
@@ -2230,6 +2230,25 @@ void AddPrivacyStrings(content::WebUIDat
{"siteSettingsSublabel", IDS_SETTINGS_PERMISSIONS_DESCRIPTION},
{"securityPageTitle", IDS_SETTINGS_SECURITY},
{"securityPageDescription", IDS_SETTINGS_SECURITY_DESCRIPTION},
@@ -64,6 +67,8 @@
+ IDS_SETTINGS_HELIUM_SERVICES_OVERRIDE_DESCRIPTION_WARNING},
+ {"heliumOriginOverrideLabel",
+ IDS_SETTINGS_HELIUM_SERVICES_OVERRIDE_ARIA_LABEL},
+ {"heliumOriginOverrideInvalidOrigin",
+ IDS_SETTINGS_HELIUM_SERVICES_OVERRIDE_INVALID_ORIGIN},
{"advancedProtectionProgramTitle",
IDS_SETTINGS_ADVANCED_PROTECTION_PROGRAM},
{"advancedProtectionProgramDesc",
@@ -259,7 +264,7 @@
+ maxlength="128"
+ aria-label="$i18n{heliumOriginOverrideLabel}"
+ auto-validate
+ error-message="Invalid origin"
+ error-message="$i18n{heliumOriginOverrideInvalidOrigin}"
+ spellcheck="false">
+ </cr-input>
+ </div>
@@ -25,7 +25,7 @@
Update Chromium
--- a/chrome/app/generated_resources.grd
+++ b/chrome/app/generated_resources.grd
@@ -13438,6 +13438,9 @@ Check your passwords anytime in <ph name
@@ -13452,6 +13452,9 @@ Check your passwords anytime in <ph name
<message name="IDS_APP_MENU_BUTTON_UPDATE" desc="Short label next to app-menu button when an update is available.">
Update
</message>
@@ -1,6 +1,6 @@
--- a/chrome/app/settings_strings.grdp
+++ b/chrome/app/settings_strings.grdp
@@ -2520,6 +2520,9 @@
@@ -2523,6 +2523,9 @@
<message name="IDS_SETTINGS_SEARCH_ENGINES_ADD_SITE_SEARCH" desc="Title for a dialog that allows adding a new site search engine.">
Add site search
</message>
@@ -32,7 +32,7 @@
{"advancedPageTitle", IDS_SETTINGS_ADVANCED},
{"back", IDS_ACCNAME_BACK},
{"basicPageTitle", IDS_SETTINGS_BASIC},
@@ -2922,6 +2923,8 @@ void AddSearchEnginesStrings(content::We
@@ -2924,6 +2925,8 @@ void AddSearchEnginesStrings(content::We
IDS_SETTINGS_SEARCH_ENGINES_PAGE_EXPLANATION},
{"searchEnginesAddSiteSearch",
IDS_SETTINGS_SEARCH_ENGINES_ADD_SITE_SEARCH},
@@ -1,6 +1,6 @@
--- a/chrome/app/settings_strings.grdp
+++ b/chrome/app/settings_strings.grdp
@@ -4001,6 +4001,21 @@
@@ -4004,6 +4004,21 @@
<message name="IDS_SETTINGS_PICK_AN_AVATAR" desc="Title of the edit avatar selection section on the manage profile page.">
Pick an avatar
</message>
@@ -10,7 +10,7 @@
<message name="IDS_SETTINGS_ENABLE_DO_NOT_TRACK_DIALOG_LEARN_MORE_ACCESSIBILITY_LABEL" desc="The accessibility label for a link to learn more about Do Not Track">
Learn more about Do Not Track
</message>
@@ -3439,6 +3442,9 @@
@@ -3442,6 +3445,9 @@
<message name="IDS_SETTINGS_TRACKING_PROTECTION_SITES_ALLOWED_COOKIES_DESCRIPTION" desc="Description of the section on the Tracking Protection settings page that lets users manage which sites are allowed to use third-party cookies. Explains how to use a wildcard to create an exception for an entire domain.">
Affects the sites listed here. Inserting “[*.]” before a domain name creates an exception for the entire domain. For example, adding “[*.]google.com” means that third-party cookies can also be active for mail.google.com, because it’s part of google.com.
</message>
@@ -31,7 +31,7 @@
{"doNotTrackDialogLearnMoreA11yLabel",
IDS_SETTINGS_ENABLE_DO_NOT_TRACK_DIALOG_LEARN_MORE_ACCESSIBILITY_LABEL},
// TODO(crbug.com/40122957): This string is no longer used. Remove.
@@ -3040,7 +3040,7 @@ void AddSiteSettingsStrings(content::Web
@@ -3042,7 +3042,7 @@ void AddSiteSettingsStrings(content::Web
{"trackingProtectionSitesAllowedCookiesTitle",
IDS_SETTINGS_TRACKING_PROTECTION_SITES_ALLOWED_COOKIES_TITLE},
{"trackingProtectionSitesAllowedCookiesDescription",
@@ -325,7 +325,7 @@
{IDC_SHOW_BOOKMARK_MANAGER, ui::EF_COMMAND_DOWN | ui::EF_ALT_DOWN,
--- a/chrome/app/generated_resources.grd
+++ b/chrome/app/generated_resources.grd
@@ -19313,6 +19313,9 @@ Please help our engineers fix this probl
@@ -19327,6 +19327,9 @@ Please help our engineers fix this probl
<message name="IDS_LINK_COPIED_TOAST_BODY" desc="Text on a toast notification that is shown when a link is successfully copied.">
Link copied
</message>
@@ -87,7 +87,7 @@
};
--- a/chrome/app/generated_resources.grd
+++ b/chrome/app/generated_resources.grd
@@ -13749,6 +13749,9 @@ Check your passwords anytime in <ph name
@@ -13763,6 +13763,9 @@ Check your passwords anytime in <ph name
<message name="IDS_EXTENSIONS_INSTALL_LOCATION_SHARED_MODULE" desc="The text explaining the the installation of the extension was because of extensions that depend on this shared module">
Installed because of dependent extension(s).
</message>