0

mahi: Add mahi panel strings to ash_strings

Bug: b:331127382
Change-Id: If4af67d2ebfb812de357dc64403a9531c0615e34
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5641593
Reviewed-by: Andre Le <leandre@chromium.org>
Commit-Queue: Kevin Radtke <kradtke@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1317687}
This commit is contained in:
Kevin Radtke
2024-06-20 23:34:48 +00:00
committed by Chromium LUCI CQ
parent d118024c6b
commit de3b19c4a3
7 changed files with 15 additions and 36 deletions

@ -5250,21 +5250,19 @@ No devices connected.
</message>
<!-- Mahi -->
<!-- TODO(b/331127382): Finalize internal Mahi strings, move them here and mark them translateable. -->
<!-- TODO(b/331127382): Mark the strings below translateable if they are final strings -->
<message name="IDS_ASH_MAHI_PANEL_TITLE" translateable="false" desc="Title text shown on the header of the Mahi panel.">
Mahi Panel
<message name="IDS_ASH_MAHI_PANEL_TITLE" desc="Title text shown on the header of the Mahi panel.">
Help me read
</message>
<message name="IDS_ASH_MAHI_PANEL_DISCLAIMER" translateable="false" desc="Text for the disclaimer label in the Mahi panel">
Disclaimer: this is only used for experimental.
<message name="IDS_ASH_MAHI_PANEL_DISCLAIMER" desc="Text for the disclaimer label in the Mahi panel">
Quality may vary when using generative AI.
</message>
<message name="IDS_ASH_MAHI_LEARN_MORE_LINK_LABEL_TEXT" desc="Text for the learn more link that user can navigate to learn more about the project information">
Learn more
</message>
<message name="IDS_ASH_MAHI_THUMBS_UP_FEEDBACK_BUTTON_ACCESSIBLE_NAME" translateable="false" desc="The tooltip of the thumbs up feedback button in the mahi panel">
<message name="IDS_ASH_MAHI_THUMBS_UP_FEEDBACK_BUTTON_ACCESSIBLE_NAME" desc="The tooltip of the thumbs up feedback button in the mahi panel">
Good output
</message>
<message name="IDS_ASH_MAHI_THUMBS_DOWN_FEEDBACK_BUTTON_ACCESSIBLE_NAME" translateable="false" desc="The accessible name of the thumbs down feedback button in the mahi panel">
<message name="IDS_ASH_MAHI_THUMBS_DOWN_FEEDBACK_BUTTON_ACCESSIBLE_NAME" desc="The accessible name of the thumbs down feedback button in the mahi panel">
Bad output
</message>
<message name="IDS_ASH_MAHI_REFRESH_BANNER_LABEL_TEXT" desc="Text for the refresh banner shown above the mahi panel.">

@ -0,0 +1 @@
a59735ac5d7a27d8df013d24eb2854cc16450254

@ -0,0 +1 @@
a59735ac5d7a27d8df013d24eb2854cc16450254

@ -0,0 +1 @@
bce1df45a053e93c67f7ffab0763a49dc26480a1

@ -0,0 +1 @@
1bd9773a4dca9eb187722c32667953158476cc94

@ -33,7 +33,6 @@
#include "base/memory/weak_ptr.h"
#include "base/metrics/histogram_functions.h"
#include "base/time/time.h"
#include "build/branding_buildflags.h"
#include "chromeos/components/magic_boost/public/cpp/views/experiment_badge.h"
#include "chromeos/components/mahi/public/cpp/mahi_manager.h"
#include "components/vector_icons/vector_icons.h"
@ -71,10 +70,6 @@
#include "ui/views/widget/widget.h"
#include "url/gurl.h"
#if BUILDFLAG(GOOGLE_CHROME_BRANDING)
#include "chromeos/ash/resources/internal/strings/grit/ash_internal_strings.h"
#endif // BUILDFLAG(GOOGLE_CHROME_BRANDING)
namespace ash {
namespace {
@ -146,23 +141,6 @@ void InstallTextfieldFocusRing(views::View* question_textfield,
kAskQuestionContainerCornerRadius);
}
// TODO(b/331127382): Finalize Mahi panel strings.
std::u16string GetMahiPanelTitle() {
#if BUILDFLAG(GOOGLE_CHROME_BRANDING)
return l10n_util::GetStringUTF16(IDS_MAHI_PANEL_TITLE);
#else
return l10n_util::GetStringUTF16(IDS_ASH_MAHI_PANEL_TITLE);
#endif // BUILDFLAG(GOOGLE_CHROME_BRANDING)
}
std::u16string GetMahiPanelDisclaimer() {
#if BUILDFLAG(GOOGLE_CHROME_BRANDING)
return l10n_util::GetStringUTF16(IDS_MAHI_PANEL_DISCLAIMER);
#else
return l10n_util::GetStringUTF16(IDS_ASH_MAHI_PANEL_DISCLAIMER);
#endif // BUILDFLAG(GOOGLE_CHROME_BRANDING)
}
// FeedbackButton --------------------------------------------------------------
// Types of feedback button.
@ -713,7 +691,8 @@ MahiPanelView::MahiPanelView(MahiUiController* ui_controller)
.SetMainAxisAlignment(views::BoxLayout::MainAxisAlignment::kCenter)
.SetBetweenChildSpacing(kFooterSpacing)
.AddChildren(
views::Builder<views::Label>().SetText(GetMahiPanelDisclaimer()),
views::Builder<views::Label>().SetText(
l10n_util::GetStringUTF16(IDS_ASH_MAHI_PANEL_DISCLAIMER)),
views::Builder<views::Link>()
.SetText(l10n_util::GetStringUTF16(
IDS_ASH_MAHI_LEARN_MORE_LINK_LABEL_TEXT))
@ -787,9 +766,7 @@ std::unique_ptr<views::View> MahiPanelView::CreateHeaderRow() {
.SetID(mahi_constants::ViewId::kGoToSummaryOutlinesButton),
// The Panel's title label
views::Builder<views::Label>()
// TODO(b/319264190): Replace the string used here with the
// correct string ID.
.SetText(GetMahiPanelTitle())
.SetText(l10n_util::GetStringUTF16(IDS_ASH_MAHI_PANEL_TITLE))
.SetHorizontalAlignment(gfx::HorizontalAlignment::ALIGN_LEFT)
.SetFontList(TypographyProvider::Get()->ResolveTypographyToken(
TypographyToken::kCrosTitle1))
@ -805,9 +782,9 @@ std::unique_ptr<views::View> MahiPanelView::CreateHeaderRow() {
.SetVectorIcon(&kMediumOrLargeCloseButtonIcon)
// TODO(b/319264190): Replace the string used here with
// the correct string ID.
.SetAccessibleName(u"Close button")
.Build())
.SetID(mahi_constants::ViewId::kCloseButton)
.SetAccessibleName(u"Close button")
.SetCallback(
base::BindRepeating(&MahiPanelView::OnCloseButtonPressed,
weak_ptr_factory_.GetWeakPtr()))

@ -109,7 +109,7 @@ TEST_F(MahiPanelViewPixelTest, MainPanel) {
views::test::RunScheduledLayout(widget());
EXPECT_TRUE(GetPixelDiffer()->CompareUiComponentsOnPrimaryScreen(
"panel_view", /*revision_number=*/3, panel_view()));
"panel_view", /*revision_number=*/4, panel_view()));
}
TEST_F(MahiPanelViewPixelTest, ContentSourceButton) {