0

mahi: Update various mahi strings

Move internal strings to public repo and add placeholder strings to
ash_strings or chromeos_strings grd files.

Change-Id: Ie9160337cd1f0b74730f686639407e56ad48ded4
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5650791
Commit-Queue: Kevin Radtke <kradtke@chromium.org>
Reviewed-by: Andre Le <leandre@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1320768}
This commit is contained in:
Kevin Radtke
2024-06-28 02:10:26 +00:00
committed by Chromium LUCI CQ
parent 701c1abd55
commit 381c5cf6f0
20 changed files with 65 additions and 63 deletions

@ -5274,6 +5274,9 @@ No devices connected.
<message name="IDS_ASH_MAHI_REFRESH_BANNER_LABEL_TEXT" desc="Text for the refresh banner shown above the mahi panel.">
Refresh <ph name="CONTENT_TITLE">$1<ex>test content title</ex></ph>
</message>
<message name="IDS_ASH_MAHI_REFRESH_BANNER_BUTTON_ACCESSIBLE_NAME" desc="Tooltip for the Mahi refresh contents button.">
Refresh content
</message>
<message name="IDS_ASH_MAHI_RESPONSE_STATUS_INAPPROPRIATE_LABEL_TEXT" desc="Text of the service response that suggests the previous Mahi request is inappropriate">
Cant help with this. Try another request.
</message>
@ -5298,6 +5301,24 @@ No devices connected.
<message name="IDS_ASH_MAHI_EDUCATIONAL_NUDGE_BODY" desc="Body for the educational nudge used to discover the Mahi feature">
Use Help me read to quickly summarize content or ask questions
</message>
<message name="IDS_ASH_MAHI_CONTENT_SOURCE_BUTTON_ACCESSIBLE_NAME" desc="Tooltip for the Mahi content source button.">
Content source information
</message>
<message name="IDS_ASH_MAHI_PANEL_GO_TO_SUMMARY_BUTTON_ACCESSIBLE_NAME" desc="Tooltip for the button that takes the user to the Mahi summary page.">
Back to summary
</message>
<message name="IDS_ASH_MAHI_PANEL_GO_TO_QUESTION_AND_ANSWER_BUTTON_ACCESSIBLE_NAME" desc="Tooltip for the button that takes the user to the Mahi question and answer page.">
Back to question
</message>
<message name="IDS_ASH_MAHI_PANEL_INPUT_PLACEHOLDER_TEXT" desc="Placeholder text for the Mahi panel input textfield.">
Ask a question.
</message>
<message name="IDS_ASH_MAHI_PANEL_INPUT_TEXTFIELD_SEND_BUTTON_ACCESSIBLE_NAME" desc="Tooltip for the Mahi panel input textfield send button.">
Send
</message>
<message name="IDS_ASH_MAHI_PANEL_CLOSE_BUTTON_ACCESSIBLE_NAME" desc="Tooltip for the Mahi panel close button.">
Close
</message>
<!-- Magic boost -->
<message name="IDS_ASH_MAGIC_BOOST_DISCLAIMER_ACCEPT_BUTTON" desc="Text shown as the accept button in the Magic Boost disclaimer view.">

@ -0,0 +1 @@
76936ed420cf301a24659ab2635835741458ba92

@ -0,0 +1 @@
6f2c3059087e8149e114636492a63dd7977b9926

@ -0,0 +1 @@
baeece70604a8309afb7ea7e68e35a1427dc87b7

@ -0,0 +1 @@
e40f4f4e90c9ebd89e81b07d951327e427d40d89

@ -0,0 +1 @@
2c353c15f0ba606cd39307fdc64d50ca4ba876b9

@ -0,0 +1 @@
971ef3a137a2e11fe15bac8acb552735f074b20c

@ -0,0 +1 @@
a1c737db9da51eabfde425f3f15b0098ae54b42e

@ -0,0 +1 @@
62d79de63bcb788542cd3ac7df6992b2c6637147

@ -9,6 +9,7 @@
#include "ash/public/cpp/image_util.h"
#include "ash/public/cpp/new_window_delegate.h"
#include "ash/strings/grit/ash_strings.h"
#include "ash/style/style_util.h"
#include "ash/style/typography.h"
#include "ash/system/mahi/mahi_constants.h"
@ -18,6 +19,7 @@
#include "base/memory/weak_ptr.h"
#include "chromeos/components/mahi/public/cpp/mahi_manager.h"
#include "chromeos/components/mahi/public/cpp/mahi_media_app_content_manager.h"
#include "ui/base/l10n/l10n_util.h"
#include "ui/base/metadata/metadata_impl_macros.h"
#include "ui/base/models/image_model.h"
#include "ui/chromeos/styles/cros_tokens_color_mappings.h"
@ -70,9 +72,9 @@ void MahiContentSourceButton::RefreshContentSourceInfo() {
mahi_manager->GetContentIcon(), mahi_constants::kContentIconSize)));
SetText(mahi_manager->GetContentTitle());
// TODO(b/331127382): Determine an appropriate a11y string.
if (GetViewAccessibility().GetCachedName().empty()) {
GetViewAccessibility().SetName(u"Content source info");
GetViewAccessibility().SetName(l10n_util::GetStringUTF16(
IDS_ASH_MAHI_CONTENT_SOURCE_BUTTON_ACCESSIBLE_NAME));
}
}

@ -243,7 +243,6 @@ class GoToSummaryOutlinesButton : public IconButton,
public:
// NOTE: `controller` outlives `GoToSummaryOutlinesButton` so it is safe to
// use `base::Unretained()` here.
// TODO(b/319264190): Replace the a11y string.
explicit GoToSummaryOutlinesButton(MahiUiController* ui_controller)
: IconButton(
/*callback=*/base::BindRepeating(
@ -257,7 +256,9 @@ class GoToSummaryOutlinesButton : public IconButton,
base::Unretained(ui_controller)),
IconButton::Type::kSmallFloating,
&kEcheArrowBackIcon,
/*accessible_name=*/u"Back to summary",
/*accessible_name=*/
l10n_util::GetStringUTF16(
IDS_ASH_MAHI_PANEL_GO_TO_SUMMARY_BUTTON_ACCESSIBLE_NAME),
/*is_togglable=*/false,
/*has_border=*/false),
MahiUiController::Delegate(ui_controller) {}
@ -299,7 +300,6 @@ class GoToQuestionAndAnswerButton : public IconButton,
public:
// NOTE: `controller` outlives `GoToQuestionAndAnswerButton` so it is safe to
// use `base::Unretained()` here.
// TODO(b/319264190): Replace the a11y string.
explicit GoToQuestionAndAnswerButton(MahiUiController* ui_controller)
: IconButton(
/*callback=*/base::BindRepeating(
@ -314,7 +314,9 @@ class GoToQuestionAndAnswerButton : public IconButton,
base::Unretained(ui_controller)),
IconButton::Type::kSmallFloating,
&kQuickSettingsRightArrowIcon,
/*accessible_name=*/u"Back to Q&A view",
/*accessible_name=*/
l10n_util::GetStringUTF16(
IDS_ASH_MAHI_PANEL_GO_TO_QUESTION_AND_ANSWER_BUTTON_ACCESSIBLE_NAME),
/*is_togglable=*/false,
/*has_border=*/false),
MahiUiController::Delegate(ui_controller) {}
@ -653,8 +655,8 @@ MahiPanelView::MahiPanelView(MahiUiController* ui_controller)
.SetBackgroundEnabled(false)
.SetBorder(
views::CreateEmptyBorder(kInputTextfieldPadding))
// TODO(b/319264190): Replace string.
.SetPlaceholderText(u"Ask a question.")
.SetPlaceholderText(l10n_util::GetStringUTF16(
IDS_ASH_MAHI_PANEL_INPUT_PLACEHOLDER_TEXT))
.SetFontList(
TypographyProvider::Get()->ResolveTypographyToken(
TypographyToken::kCrosAnnotation1))
@ -678,8 +680,8 @@ MahiPanelView::MahiPanelView(MahiUiController* ui_controller)
.SetVectorIcon(&vector_icons::kSendIcon)
.SetCallback(base::BindRepeating(&MahiPanelView::OnSendButtonPressed,
weak_ptr_factory_.GetWeakPtr()))
// TODO(b/319264190): Replace string.
.SetAccessibleName(u"Send")
.SetAccessibleName(l10n_util::GetStringUTF16(
IDS_ASH_MAHI_PANEL_INPUT_TEXTFIELD_SEND_BUTTON_ACCESSIBLE_NAME))
.Build());
question_textfield_->RemoveHoverEffect();
@ -780,9 +782,8 @@ std::unique_ptr<views::View> MahiPanelView::CreateHeaderRow() {
IconButton::Builder()
.SetType(IconButton::Type::kMediumFloating)
.SetVectorIcon(&kMediumOrLargeCloseButtonIcon)
// TODO(b/319264190): Replace the string used here with
// the correct string ID.
.SetAccessibleName(u"Close button")
.SetAccessibleName(l10n_util::GetStringUTF16(
IDS_ASH_MAHI_PANEL_CLOSE_BUTTON_ACCESSIBLE_NAME))
.Build())
.SetID(mahi_constants::ViewId::kCloseButton)
.SetCallback(

@ -209,8 +209,8 @@ std::unique_ptr<IconButton> RefreshBannerView::CreateRefreshButton() {
base::Unretained(ui_controller_)))
.SetVectorIcon(&vector_icons::kReloadChromeRefreshIcon)
.SetType(IconButton::Type::kSmallProminentFloating)
// TODO(b/347134443): Replace the a11y string.
.SetAccessibleName(u"Refresh contents")
.SetAccessibleName(l10n_util::GetStringUTF16(
IDS_ASH_MAHI_REFRESH_BANNER_BUTTON_ACCESSIBLE_NAME))
.Build();
icon_button->SetIconColor(cros_tokens::kCrosSysSystemOnPrimaryContainer);
views::FocusRing::Get(icon_button.get())

@ -5,13 +5,6 @@
#ifndef CHROME_BROWSER_UI_CHROMEOS_MAGIC_BOOST_MAGIC_BOOST_CONSTANTS_H_
#define CHROME_BROWSER_UI_CHROMEOS_MAGIC_BOOST_MAGIC_BOOST_CONSTANTS_H_
#include "build/branding_buildflags.h"
#include "chromeos/strings/grit/chromeos_strings.h"
#if BUILDFLAG(GOOGLE_CHROME_BRANDING)
#include "chrome/app/theme/google_chrome/chromeos/strings/grit/chromeos_chrome_internal_strings.h"
#endif // BUILDFLAG(GOOGLE_CHROME_BRANDING)
namespace chromeos::magic_boost {
// The view ids for Magic Boost related views.
@ -20,13 +13,6 @@ enum ViewId {
OptInCardPrimaryButton,
};
// TODO(b/331127382): Finalize the Mahi menu title.
#if BUILDFLAG(GOOGLE_CHROME_BRANDING)
inline constexpr int kMahiMenuTitleStringId = IDS_MAHI_MENU_TITLE;
#else
inline constexpr int kMahiMenuTitleStringId = IDS_MAHI_MENU_TITLE_SHORT;
#endif // BUILDFLAG(GOOGLE_CHROME_BRANDING)
} // namespace chromeos::magic_boost
#endif // CHROME_BROWSER_UI_CHROMEOS_MAGIC_BOOST_MAGIC_BOOST_CONSTANTS_H_

@ -11,7 +11,6 @@
#include "base/functional/bind.h"
#include "base/memory/weak_ptr.h"
#include "base/metrics/histogram_functions.h"
#include "build/branding_buildflags.h"
#include "chrome/browser/chromeos/mahi/mahi_web_contents_manager.h"
#include "chrome/browser/ui/views/mahi/mahi_menu_constants.h"
#include "chromeos/components/mahi/public/cpp/mahi_util.h"
@ -35,10 +34,6 @@
#include "ui/views/view_shadow.h"
#include "ui/views/widget/widget.h"
#if BUILDFLAG(GOOGLE_CHROME_BRANDING)
#include "chrome/app/theme/google_chrome/chromeos/strings/grit/chromeos_chrome_internal_strings.h"
#endif // BUILDFLAG(GOOGLE_CHROME_BRANDING)
namespace chromeos::mahi {
namespace {
@ -47,15 +42,6 @@ constexpr int kButtonIconSize = 16;
constexpr int kButtonIconLabelSpacing = 8;
constexpr auto kButtonBorderInsets = gfx::Insets::VH(12, 16);
// TODO(b/331127382): Finalize the Mahi condensed menu button text.
std::u16string GetMahiCondensedMenuButtonText() {
#if BUILDFLAG(GOOGLE_CHROME_BRANDING)
return l10n_util::GetStringUTF16(IDS_MAHI_CONDENSED_MENU_BUTTON_LABEL);
#else
return l10n_util::GetStringUTF16(IDS_MAHI_CONDENSED_MENU_BUTTON_LABEL_SHORT);
#endif // BUILDFLAG(GOOGLE_CHROME_BRANDING)
}
// View for the button which makes up most of the condensed Mahi menu.
class MahiCondensedMenuButton : public views::LabelButton {
METADATA_HEADER(MahiCondensedMenuButton, views::LabelButton)
@ -64,7 +50,8 @@ class MahiCondensedMenuButton : public views::LabelButton {
MahiCondensedMenuButton() {
SetCallback(base::BindRepeating(&MahiCondensedMenuButton::OnButtonClicked,
weak_ptr_factory_.GetWeakPtr()));
SetText(GetMahiCondensedMenuButtonText());
SetText(
l10n_util::GetStringUTF16(IDS_ASH_MAHI_CONDENSED_MENU_BUTTON_LABEL));
SetLabelStyle(views::style::STYLE_BODY_3_EMPHASIS);
SetImageModel(views::Button::ButtonState::STATE_NORMAL,
ui::ImageModel::FromVectorIcon(

@ -95,10 +95,6 @@ void StyleMenuButton(views::LabelButton* button, const gfx::VectorIcon& icon) {
kButtonPadding));
}
std::u16string GetMahiMenuTitle() {
return l10n_util::GetStringUTF16(magic_boost::kMahiMenuTitleStringId);
}
} // namespace
// Controller for the `textfield_` owned by `MahiMenuView`. Enables the
@ -172,11 +168,10 @@ MahiMenuView::MahiMenuView(Surface surface)
views::FlexSpecification(views::MinimumFlexSizeRule::kPreferred,
views::MaximumFlexSizeRule::kUnbounded)));
// TODO(b/318733118): Finish building the menu UI.
auto* header_label =
header_left_container->AddChildView(std::make_unique<views::Label>(
GetMahiMenuTitle(), views::style::CONTEXT_DIALOG_TITLE,
views::style::STYLE_HEADLINE_5));
l10n_util::GetStringUTF16(IDS_ASH_MAHI_MENU_TITLE),
views::style::CONTEXT_DIALOG_TITLE, views::style::STYLE_HEADLINE_5));
header_label->SetEnabledColorId(ui::kColorSysOnSurface);
header_label->SetHorizontalAlignment(gfx::HorizontalAlignment::ALIGN_LEFT);

@ -367,7 +367,7 @@
Enter a prompt
</message>
<message name="IDS_EDITOR_MENU_SETTINGS_TOOLTIP" desc="Tooltip text for the settings button in the Editor Menu.">
Help me write settings
Settings
</message>
<message name="IDS_EDITOR_MENU_FREEFORM_TEXTFIELD_ARROW_BUTTON_TOOLTIP" desc="Tooltip text for the arrow button in the freeform textfield in the Editor Menu.">
Submit
@ -377,9 +377,8 @@
</message>
<!-- Mahi -->
<!-- TODO(b/331127382): Finalize Mahi strings and mark them translateable. -->
<message name="IDS_MAHI_EXPERIMENT_BADGE_ACCESSIBLE_NAME" desc="Accessible name of the badge to indicate that it is an experimental feature." translateable="false">
AI-powered experimental feature
Experiment
</message>
<message name="IDS_MAHI_FEEDBACK_PLACEHOLDER" desc="Placeholder text displayed in the feedback text box">
Feedback for mahi feature
@ -393,20 +392,14 @@
<message name="IDS_MAHI_MENU_INPUT_TEXTHOLDER" desc="The textholder for the input textfield inside the Mahi menu" translateable="false">
Ask question, e.g. "What is this page about?"
</message>
<message name="IDS_MAHI_MENU_TITLE_SHORT" desc="A short version of the title text of the Mahi menu" translateable="false">
Mahi Menu
</message>
<message name="IDS_MAHI_CONDENSED_MENU_BUTTON_LABEL_SHORT" desc="A short version of the label that appears on the condensed Mahi menu button" translateable="false">
Open panel
</message>
<message name="IDS_MAHI_PANEL_SUMMARY_SECTION_NAME" desc="The name for the summary section that lies within the Mahi panel">
Summary
</message>
<message name="IDS_MAHI_PANEL_OUTLINES_SECTION_NAME" desc="The name for the outlines section that lies within the Mahi panel">
Outlines
</message>
<message name="IDS_MAHI_MENU_INPUT_SEND_BUTTON_ACCESSIBLE_NAME" desc="Accessible name of the badge to indicate that it is an experimental feature." translateable="false">
Send button
<message name="IDS_MAHI_MENU_INPUT_SEND_BUTTON_ACCESSIBLE_NAME" desc="Accessible name of the badge to indicate that it is an experimental feature.">
Send
</message>
<!-- Magic Boost -->
@ -428,6 +421,12 @@
<message name="IDS_ASH_MAGIC_BOOST_OPT_IN_CARD_ACCEPT_BUTTON" desc="Text shown for the secondary button of the Magic Boost opt-in card">
Try it
</message>
<message name="IDS_ASH_MAHI_MENU_TITLE" desc="Title text of the Mahi menu.">
Help me read
</message>
<message name="IDS_ASH_MAHI_CONDENSED_MENU_BUTTON_LABEL" desc="The label that appears on the condensed Mahi menu button">
Help me read this page
</message>
<!-- Multitask Menu -->
<message name="IDS_MULTITASK_MENU_HALF_BUTTON_NAME" desc="Title of the half button on the multitask menu." meaning="Splits the associated window into half snapped state.">

@ -0,0 +1 @@
76936ed420cf301a24659ab2635835741458ba92

@ -0,0 +1 @@
1969d2bb6f2cb6f3b90e9c88bf5be15cd8159c6f

@ -1 +1 @@
449b20ab64973e0d1babaecd3a128f62958fefe6
f7c6f90ebe42e2ca89227c3eaf5ca4240c62ceae

@ -0,0 +1 @@
36d408ace912130cc18cd193273fbe8723f0ea1f