0

birch: Localize strings in the per-suggestion-chip context menu

This is the menu you get when you right-click on a chip.

Bug: b:342667577
Test: manually verified strings are correct in UI
Change-Id: Iba414abd9de42b6e5899b2d0a0af63c8a7b9a852
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5698093
Reviewed-by: Toni Barzic <tbarzic@chromium.org>
Commit-Queue: James Cook <jamescook@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1326536}
This commit is contained in:
James Cook
2024-07-12 03:40:35 +00:00
committed by Chromium LUCI CQ
parent 728e439a7a
commit 3079edabbf
11 changed files with 69 additions and 23 deletions

@ -8440,6 +8440,33 @@ To shut down the device, press and hold the power button on the device again.
<message name="IDS_ASH_BIRCH_MENU_RESET" desc="Context menu item that resets all suggestion types to their default (on) in informed restore/overview UI">
Reset
</message>
<message name="IDS_ASH_BIRCH_HIDE_THIS_SUGGESTION" desc="Context menu item that hides the current suggestion in informed restore/overview UI">
Hide this suggestion
</message>
<message name="IDS_ASH_BIRCH_HIDE_WEATHER_SUGGESTION" desc="Context menu item that hides the weather suggestion in informed restore/overview UI">
Hide weather suggestion
</message>
<message name="IDS_ASH_BIRCH_HIDE_CALENDAR_SUGGESTIONS" desc="Context menu item that hides Google Calendar suggestions in informed restore/overview UI">
Hide all Google Calendar suggestions
</message>
<message name="IDS_ASH_BIRCH_HIDE_DRIVE_SUGGESTIONS" desc="Context menu item that hides Google Drive suggestions in informed restore/overview UI">
Hide all Google Drive suggestions
</message>
<message name="IDS_ASH_BIRCH_HIDE_CHROME_SUGGESTIONS" desc="Context menu item that hides Chrome browser tab suggestions in informed restore/overview UI">
Hide all Chrome browser suggestions
</message>
<message name="IDS_ASH_BIRCH_HIDE_MEDIA_SUGGESTIONS" desc="Context menu item that hides audio/video media suggestions in informed restore/overview UI">
Hide all media suggestions
</message>
<message name="IDS_ASH_BIRCH_CUSTOMIZE_SUGGESTIONS" desc="Context menu item that opens the submenu to customize suggestions in informed restore/overview UI">
Customize suggestions
</message>
<message name="IDS_ASH_BIRCH_TOGGLE_TEMPERATURE_UNITS" desc="Context menu item that toggles temperature units (F vs. C) for the weather suggestion in informed restore/overview UI">
Toggle temperature units (F vs. C)
</message>
<message name="IDS_ASH_BIRCH_SEND_FEEDBACK" desc="Context menu item that sends feedback about suggestions in informed restore/overview UI">
Send feedback
</message>
</messages>
</release>
</grit>

@ -0,0 +1 @@
b618b2c6ed3ba0e26caa64d465f519bae9a2b39b

@ -0,0 +1 @@
3c61528ca36ef267fe229a22d56481c38375398d

@ -0,0 +1 @@
010d65e55dc1696d5360085edbdb59909000f037

@ -0,0 +1 @@
bd75467924478567048cc6a5a637a7afd5912727

@ -0,0 +1 @@
2b7926b79cbca540caa7c4e07f6eca471c1497d5

@ -0,0 +1 @@
709cc98f4e9037b2bdacffebaf116a180ba90e32

@ -0,0 +1 @@
b618b2c6ed3ba0e26caa64d465f519bae9a2b39b

@ -0,0 +1 @@
b618b2c6ed3ba0e26caa64d465f519bae9a2b39b

@ -0,0 +1 @@
b618b2c6ed3ba0e26caa64d465f519bae9a2b39b

@ -5,7 +5,9 @@
#include "ash/wm/overview/birch/birch_chip_context_menu_model.h"
#include "ash/resources/vector_icons/vector_icons.h"
#include "ash/strings/grit/ash_strings.h"
#include "ash/wm/overview/overview_utils.h"
#include "ui/base/l10n/l10n_util.h"
#include "ui/base/models/menu_separator_types.h"
#include "ui/views/controls/menu/menu_types.h"
@ -19,54 +21,62 @@ BirchChipContextMenuModel::BirchChipContextMenuModel(
delegate,
BirchBarContextMenuModel::Type::kExpandedBarMenu)) {
auto add_hide_suggestion_item = [&]() {
AddItemWithIcon(base::to_underlying(CommandId::kHideSuggestion),
u"Hide this suggestion",
CreateIconForMenuItem(kSystemTrayDoNotDisturbIcon));
AddItemWithIcon(
base::to_underlying(CommandId::kHideSuggestion),
l10n_util::GetStringUTF16(IDS_ASH_BIRCH_HIDE_THIS_SUGGESTION),
CreateIconForMenuItem(kSystemTrayDoNotDisturbIcon));
};
switch (chip_type) {
case BirchSuggestionType::kWeather:
AddItemWithIcon(base::to_underlying(CommandId::kHideWeatherSuggestions),
u"Hide Weather suggestion",
CreateIconForMenuItem(kForbidIcon));
AddItemWithIcon(
base::to_underlying(CommandId::kHideWeatherSuggestions),
l10n_util::GetStringUTF16(IDS_ASH_BIRCH_HIDE_WEATHER_SUGGESTION),
CreateIconForMenuItem(kForbidIcon));
break;
case BirchSuggestionType::kCalendar:
add_hide_suggestion_item();
AddItemWithIcon(base::to_underlying(CommandId::kHideCalendarSuggestions),
u"Hide all Google Calendar suggestions",
CreateIconForMenuItem(kForbidIcon));
AddItemWithIcon(
base::to_underlying(CommandId::kHideCalendarSuggestions),
l10n_util::GetStringUTF16(IDS_ASH_BIRCH_HIDE_CALENDAR_SUGGESTIONS),
CreateIconForMenuItem(kForbidIcon));
break;
case BirchSuggestionType::kDrive:
add_hide_suggestion_item();
AddItemWithIcon(base::to_underlying(CommandId::kHideDriveSuggestions),
u"Hide all Google Drive suggestions",
CreateIconForMenuItem(kForbidIcon));
AddItemWithIcon(
base::to_underlying(CommandId::kHideDriveSuggestions),
l10n_util::GetStringUTF16(IDS_ASH_BIRCH_HIDE_DRIVE_SUGGESTIONS),
CreateIconForMenuItem(kForbidIcon));
break;
case BirchSuggestionType::kChromeTab:
add_hide_suggestion_item();
AddItemWithIcon(base::to_underlying(CommandId::kHideChromeTabSuggestions),
u"Hide all Chrome suggestions",
CreateIconForMenuItem(kForbidIcon));
AddItemWithIcon(
base::to_underlying(CommandId::kHideChromeTabSuggestions),
l10n_util::GetStringUTF16(IDS_ASH_BIRCH_HIDE_CHROME_SUGGESTIONS),
CreateIconForMenuItem(kForbidIcon));
break;
case BirchSuggestionType::kMedia:
add_hide_suggestion_item();
AddItemWithIcon(base::to_underlying(CommandId::kHideMediaSuggestions),
u"Hide all media suggestions",
CreateIconForMenuItem(kForbidIcon));
AddItemWithIcon(
base::to_underlying(CommandId::kHideMediaSuggestions),
l10n_util::GetStringUTF16(IDS_ASH_BIRCH_HIDE_MEDIA_SUGGESTIONS),
CreateIconForMenuItem(kForbidIcon));
break;
default:
break;
}
AddSubMenuWithIcon(base::to_underlying(CommandId::kCustomizeSuggestions),
u"Customize suggestions", sub_menu_model_.get(),
CreateIconForMenuItem(kPencilIcon));
AddSubMenuWithIcon(
base::to_underlying(CommandId::kCustomizeSuggestions),
l10n_util::GetStringUTF16(IDS_ASH_BIRCH_CUSTOMIZE_SUGGESTIONS),
sub_menu_model_.get(), CreateIconForMenuItem(kPencilIcon));
if (chip_type == BirchSuggestionType::kWeather) {
AddItem(base::to_underlying(CommandId::kToggleTemperatureUnits),
u"Toggle temperature units (F vs C)");
l10n_util::GetStringUTF16(IDS_ASH_BIRCH_TOGGLE_TEMPERATURE_UNITS));
}
AddSeparator(ui::MenuSeparatorType::NORMAL_SEPARATOR);
AddItemWithIcon(base::to_underlying(CommandId::kFeedback), u"Send Feedback",
AddItemWithIcon(base::to_underlying(CommandId::kFeedback),
l10n_util::GetStringUTF16(IDS_ASH_BIRCH_SEND_FEEDBACK),
CreateIconForMenuItem(kFeedbackIcon));
}