0

Use editor strings.

Bug: b/334738457
Change-Id: I84a5848bd95a2ecd61ce0056ab9a3bc65a03d06e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5465149
Reviewed-by: Michelle Chen <michellegc@google.com>
Commit-Queue: Darren Shen <shend@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1289810}
This commit is contained in:
Darren Shen
2024-04-19 08:46:23 +00:00
committed by Chromium LUCI CQ
parent a60ad4a5c9
commit 0ff96aee02
2 changed files with 37 additions and 9 deletions

@ -7153,9 +7153,6 @@ New install
<message name="IDS_PICKER_LOCAL_FILES_CATEGORY_LABEL" translateable="false" desc="Label of the Picker list item which can be clicked to show local file results.">
My Files
</message>
<message name="IDS_PICKER_EDITOR_CATEGORY_LABEL" translateable="false" desc="Label of the Picker list item which can be clicked to show editor results.">
Editor
</message>
<message name="IDS_PICKER_DATES_TIMES_CATEGORY_LABEL" translateable="false" desc="Label of the Picker list item which can be clicked to show date and time results.">
Dates &amp; Times
</message>

@ -11,17 +11,30 @@
#include "ash/public/cpp/picker/picker_category.h"
#include "ash/strings/grit/ash_strings.h"
#include "base/notreached.h"
#include "build/branding_buildflags.h"
#include "chromeos/strings/grit/chromeos_strings.h"
#include "ui/base/l10n/l10n_util.h"
#if BUILDFLAG(GOOGLE_CHROME_BRANDING)
#include "chromeos/ash/resources/internal/strings/grit/ash_internal_strings.h"
#endif // BUILDFLAG(GOOGLE_CHROME_BRANDING)
namespace ash {
std::u16string GetLabelForPickerCategory(PickerCategory category) {
switch (category) {
case PickerCategory::kEditorWrite:
return l10n_util::GetStringUTF16(IDS_PICKER_EDITOR_CATEGORY_LABEL);
#if BUILDFLAG(GOOGLE_CHROME_BRANDING)
return l10n_util::GetStringUTF16(IDS_EDITOR_MENU_WRITE_CARD_TITLE);
#else
return u"";
#endif // BUILDFLAG(GOOGLE_CHROME_BRANDING)
case PickerCategory::kEditorRewrite:
return l10n_util::GetStringUTF16(IDS_PICKER_EDITOR_CATEGORY_LABEL);
#if BUILDFLAG(GOOGLE_CHROME_BRANDING)
return l10n_util::GetStringUTF16(IDS_EDITOR_MENU_REWRITE_CARD_TITLE);
#else
return u"";
#endif // BUILDFLAG(GOOGLE_CHROME_BRANDING)
case PickerCategory::kLinks:
return l10n_util::GetStringUTF16(IDS_PICKER_LINKS_CATEGORY_LABEL);
case PickerCategory::kExpressions:
@ -89,11 +102,19 @@ std::u16string GetSectionTitleForPickerCategoryType(
PickerCategoryType category_type) {
switch (category_type) {
case PickerCategoryType::kEditorWrite:
#if BUILDFLAG(GOOGLE_CHROME_BRANDING)
return l10n_util::GetStringUTF16(
IDS_PICKER_EDITOR_CATEGORY_TYPE_SECTION_TITLE);
IDS_PICKER_EDITOR_WRITE_CATEGORY_TYPE_SECTION_TITLE);
#else
return u"";
#endif // BUILDFLAG(GOOGLE_CHROME_BRANDING)
case PickerCategoryType::kEditorRewrite:
#if BUILDFLAG(GOOGLE_CHROME_BRANDING)
return l10n_util::GetStringUTF16(
IDS_PICKER_EDITOR_CATEGORY_TYPE_SECTION_TITLE);
IDS_PICKER_EDITOR_REWRITE_CATEGORY_TYPE_SECTION_TITLE);
#else
return u"";
#endif // BUILDFLAG(GOOGLE_CHROME_BRANDING)
case PickerCategoryType::kGeneral:
return l10n_util::GetStringUTF16(
IDS_PICKER_GENERAL_CATEGORY_TYPE_SECTION_TITLE);
@ -132,9 +153,19 @@ std::u16string GetSectionTitleForPickerSectionType(
case PickerSectionType::kExamples:
return u"Examples";
case PickerSectionType::kEditorWrite:
return u"Editor";
#if BUILDFLAG(GOOGLE_CHROME_BRANDING)
return l10n_util::GetStringUTF16(
IDS_PICKER_EDITOR_WRITE_CATEGORY_TYPE_SECTION_TITLE);
#else
return u"";
#endif // BUILDFLAG(GOOGLE_CHROME_BRANDING)
case PickerSectionType::kEditorRewrite:
return u"Editor";
#if BUILDFLAG(GOOGLE_CHROME_BRANDING)
return l10n_util::GetStringUTF16(
IDS_PICKER_EDITOR_REWRITE_CATEGORY_TYPE_SECTION_TITLE);
#else
return u"";
#endif // BUILDFLAG(GOOGLE_CHROME_BRANDING)
}
}