0

birch: Localize strings in suggestion type context menu

Localize the strings for the primary birch right-click menu.

Bug: b:342667577
Test: manually verified strings are correct in UI
Change-Id: Idbbb6a68c84d715086e2475699e4261238f705d6
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5698007
Reviewed-by: Toni Barzic <tbarzic@chromium.org>
Commit-Queue: James Cook <jamescook@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1326476}
This commit is contained in:
James Cook
2024-07-12 00:08:01 +00:00
committed by Chromium LUCI CQ
parent 9f17bb9c0e
commit 14b2f81bf8
11 changed files with 54 additions and 11 deletions

@ -8413,6 +8413,33 @@ To shut down the device, press and hold the power button on the device again.
<message name="IDS_ASH_BIRCH_LOST_MEDIA_VIDEO_CONFERENCE_TAB_SUBTITLE" desc="The subtitle for a suggestion chip for a video conference tab that is currently ongoing. Note: The 'Ongoing' is supposed to indicate the status of the tab, not the identity of the tab. 'Switch to tab' is an action/verb that switches to the tab if the item is pressed.">
Ongoing &#x00B7; Switch to tab
</message>
<message name="IDS_ASH_BIRCH_MENU_SHOW_SUGGESTIONS" desc="Context menu item that toggles the list of suggestion actions in informed restore/overview UI">
Show suggestions
</message>
<message name="IDS_ASH_BIRCH_MENU_WEATHER" desc="Context menu item that toggles a suggestion button with the weather in informed restore/overview UI">
Weather
</message>
<message name="IDS_ASH_BIRCH_MENU_WEATHER_NOT_AVAILABLE" desc="Context menu item used in informed restore/overview UI when weather suggestions are not available because of privacy settings">
Weather (not available)
</message>
<message name="IDS_ASH_BIRCH_MENU_WEATHER_NOT_AVAILABLE_TOOLTIP" desc="Context menu tooltip used in informed restore/overview UI when weather suggestions are not available because of privacy settings">
Weather isn't available because location access is turned off. You can change this in settings.
</message>
<message name="IDS_ASH_BIRCH_MENU_CALENDAR" desc="Context menu item that toggles Google Calendar suggestions in informed restore/overview UI">
Google Calendar
</message>
<message name="IDS_ASH_BIRCH_MENU_DRIVE" desc="Context menu item that toggles Google Drive suggestions in informed restore/overview UI">
Google Drive
</message>
<message name="IDS_ASH_BIRCH_MENU_CHROME_BROWSER" desc="Context menu item that toggles Chrome browser tab suggestions in informed restore/overview UI">
Chrome browser
</message>
<message name="IDS_ASH_BIRCH_MENU_MEDIA" desc="Context menu item that toggles audio/video media tab suggestions in informed restore/overview UI">
Media
</message>
<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>
</messages>
</release>
</grit>

@ -0,0 +1 @@
49669db9ce8770312ae7a1a9869010b388ea2302

@ -0,0 +1 @@
49669db9ce8770312ae7a1a9869010b388ea2302

@ -0,0 +1 @@
49669db9ce8770312ae7a1a9869010b388ea2302

@ -0,0 +1 @@
49669db9ce8770312ae7a1a9869010b388ea2302

@ -0,0 +1 @@
49669db9ce8770312ae7a1a9869010b388ea2302

@ -0,0 +1 @@
49669db9ce8770312ae7a1a9869010b388ea2302

@ -0,0 +1 @@
49669db9ce8770312ae7a1a9869010b388ea2302

@ -0,0 +1 @@
e4ce8183a3c168e8315c3e54b39b6f96db95fdbe

@ -0,0 +1 @@
e4ce8183a3c168e8315c3e54b39b6f96db95fdbe

@ -5,9 +5,11 @@
#include "ash/wm/overview/birch/birch_bar_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 "base/types/cxx23_to_underlying.h"
#include "chromeos/ash/components/geolocation/simple_geolocation_provider.h"
#include "ui/base/l10n/l10n_util.h"
#include "ui/base/models/menu_separator_types.h"
#include "ui/views/controls/menu/menu_types.h"
@ -29,33 +31,38 @@ BirchBarContextMenuModel::BirchBarContextMenuModel(
: ui::SimpleMenuModel(delegate) {
// Show suggestions option is in both expanded and collapsed menu.
AddItem(base::to_underlying(CommandId::kShowSuggestions),
u"Show suggestions");
l10n_util::GetStringUTF16(IDS_ASH_BIRCH_MENU_SHOW_SUGGESTIONS));
// Expanded menu also has customizing suggestions options.
if (type == Type::kExpandedBarMenu) {
AddSeparator(ui::MenuSeparatorType::NORMAL_SEPARATOR);
bool enabled = IsWeatherAllowedByGeolocation();
AddItem(base::to_underlying(CommandId::kWeatherSuggestions),
enabled ? u"Weather" : u"Weather (not available)");
std::u16string weather_label =
enabled ? l10n_util::GetStringUTF16(IDS_ASH_BIRCH_MENU_WEATHER)
: l10n_util::GetStringUTF16(
IDS_ASH_BIRCH_MENU_WEATHER_NOT_AVAILABLE);
AddItem(base::to_underlying(CommandId::kWeatherSuggestions), weather_label);
auto weather_index = GetIndexOfCommandId(
base::to_underlying(CommandId::kWeatherSuggestions));
SetEnabledAt(weather_index.value(), enabled);
if (!enabled) {
// TODO(b/328486578): Localize string.
SetMinorText(weather_index.value(),
u"Weather isn't available because location access is "
u"turned off. You can change this in settings.");
l10n_util::GetStringUTF16(
IDS_ASH_BIRCH_MENU_WEATHER_NOT_AVAILABLE_TOOLTIP));
}
AddItem(base::to_underlying(CommandId::kCalendarSuggestions),
u"Google Calendar");
AddItem(base::to_underlying(CommandId::kDriveSuggestions), u"Google Drive");
l10n_util::GetStringUTF16(IDS_ASH_BIRCH_MENU_CALENDAR));
AddItem(base::to_underlying(CommandId::kDriveSuggestions),
l10n_util::GetStringUTF16(IDS_ASH_BIRCH_MENU_DRIVE));
AddItem(base::to_underlying(CommandId::kChromeTabSuggestions),
u"Chrome browser");
AddItem(base::to_underlying(CommandId::kMediaSuggestions), u"Media");
l10n_util::GetStringUTF16(IDS_ASH_BIRCH_MENU_CHROME_BROWSER));
AddItem(base::to_underlying(CommandId::kMediaSuggestions),
l10n_util::GetStringUTF16(IDS_ASH_BIRCH_MENU_MEDIA));
AddSeparator(ui::MenuSeparatorType::NORMAL_SEPARATOR);
AddItemWithIcon(base::to_underlying(CommandId::kReset), u"Reset",
AddItemWithIcon(base::to_underlying(CommandId::kReset),
l10n_util::GetStringUTF16(IDS_ASH_BIRCH_MENU_RESET),
CreateIconForMenuItem(kResetIcon));
}
}