Use translated placeholder strings for search field.
Bug: b:359716212 Change-Id: Ica562f750dd4414d92b7fc03640b1bd4e00e6799 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5786279 Auto-Submit: Darren Shen <shend@chromium.org> Commit-Queue: Darren Shen <shend@chromium.org> Reviewed-by: Michelle Chen <michellegc@google.com> Cr-Commit-Position: refs/heads/main@{#1341475}
This commit is contained in:

committed by
Chromium LUCI CQ

parent
5307bc9fe1
commit
767163a897
@ -7441,6 +7441,18 @@ New install
|
||||
desc="This string appears as the placeholder text in a search field. This placeholder only appears when the search field is empty. It lets the user know that it only searches items from the their clipboard. 'Clipboard' is a product name and the correct localized version of the product name should be used.">
|
||||
Search Clipboard
|
||||
</message>
|
||||
<message name="IDS_PICKER_SEARCH_FIELD_NO_SELECTION_PLACEHOLDER_TEXT"
|
||||
desc="This string appears as the placeholder text in a search field. This placeholder only appears when the search field is empty. It lets the user know that they can type in this search field to search for links or files to insert into the document.">
|
||||
Search to insert
|
||||
</message>
|
||||
<message name="IDS_PICKER_SEARCH_FIELD_HAS_SELECTION_PLACEHOLDER_TEXT"
|
||||
desc="This string appears as the placeholder text in a search field. This placeholder only appears when the search field is empty. It lets the user know that they can type in this search field to search for ways to edit some text in the document.">
|
||||
Search to edit text
|
||||
</message>
|
||||
<message name="IDS_PICKER_SEARCH_FIELD_NO_FOCUS_PLACEHOLDER_TEXT"
|
||||
desc="This string appears as the placeholder text in a search field. This placeholder only appears when the search field is empty. It lets the user know that they can type in this search field to search for links or files to open in a new window.">
|
||||
Search to open
|
||||
</message>
|
||||
<message name="IDS_PICKER_GENERAL_CATEGORY_TYPE_SECTION_TITLE"
|
||||
desc="This string appears as the heading text of a section. The section contains several selectable menu items that are related to inserting or opening content, such as links, emojis, or files.">
|
||||
Content
|
||||
|
@ -0,0 +1 @@
|
||||
a3b99ff4db45a8f05ed3da3d54a45f34b57326b1
|
@ -0,0 +1 @@
|
||||
48d183490969efef8299d8668c7216bae034e392
|
@ -0,0 +1 @@
|
||||
379f1acc16b87d0fc8cd851d92f8023294b062d6
|
@ -204,17 +204,17 @@ std::u16string GetSearchFieldPlaceholderText(PickerModeType mode,
|
||||
switch (mode) {
|
||||
case PickerModeType::kUnfocused:
|
||||
return l10n_util::GetStringUTF16(
|
||||
IDS_PICKER_SEARCH_FIELD_UNFOCUSED_PLACEHOLDER_TEXT);
|
||||
IDS_PICKER_SEARCH_FIELD_NO_FOCUS_PLACEHOLDER_TEXT);
|
||||
case PickerModeType::kNoSelection:
|
||||
return l10n_util::GetStringUTF16(
|
||||
is_editor_available
|
||||
? IDS_PICKER_SEARCH_FIELD_NO_SELECTION_WITH_EDITOR_PLACEHOLDER_TEXT
|
||||
: IDS_PICKER_SEARCH_FIELD_NO_SELECTION_WITHOUT_EDITOR_PLACEHOLDER_TEXT);
|
||||
: IDS_PICKER_SEARCH_FIELD_NO_SELECTION_PLACEHOLDER_TEXT);
|
||||
case PickerModeType::kHasSelection:
|
||||
return l10n_util::GetStringUTF16(
|
||||
is_editor_available
|
||||
? IDS_PICKER_SEARCH_FIELD_HAS_SELECTION_WITH_EDITOR_PLACEHOLDER_TEXT
|
||||
: IDS_PICKER_SEARCH_FIELD_HAS_SELECTION_WITHOUT_EDITOR_PLACEHOLDER_TEXT);
|
||||
: IDS_PICKER_SEARCH_FIELD_HAS_SELECTION_PLACEHOLDER_TEXT);
|
||||
default:
|
||||
NOTREACHED_NORETURN();
|
||||
}
|
||||
|
@ -383,7 +383,7 @@ TEST_F(PickerViewTest, SearchPlaceholderMatchesUnfocusedMode) {
|
||||
.textfield_for_testing()
|
||||
.GetPlaceholderText(),
|
||||
l10n_util::GetStringUTF16(
|
||||
IDS_PICKER_SEARCH_FIELD_UNFOCUSED_PLACEHOLDER_TEXT));
|
||||
IDS_PICKER_SEARCH_FIELD_NO_FOCUS_PLACEHOLDER_TEXT));
|
||||
}
|
||||
|
||||
TEST_F(PickerViewTest, SearchPlaceholderMatchesNoSelectionModeWithEditor) {
|
||||
@ -411,12 +411,11 @@ TEST_F(PickerViewTest, SearchPlaceholderMatchesNoSelectionModeWithoutEditor) {
|
||||
widget->Show();
|
||||
|
||||
PickerView* picker_view = GetPickerViewFromWidget(*widget);
|
||||
EXPECT_EQ(
|
||||
picker_view->search_field_view_for_testing()
|
||||
.textfield_for_testing()
|
||||
.GetPlaceholderText(),
|
||||
l10n_util::GetStringUTF16(
|
||||
IDS_PICKER_SEARCH_FIELD_NO_SELECTION_WITHOUT_EDITOR_PLACEHOLDER_TEXT));
|
||||
EXPECT_EQ(picker_view->search_field_view_for_testing()
|
||||
.textfield_for_testing()
|
||||
.GetPlaceholderText(),
|
||||
l10n_util::GetStringUTF16(
|
||||
IDS_PICKER_SEARCH_FIELD_NO_SELECTION_PLACEHOLDER_TEXT));
|
||||
}
|
||||
|
||||
TEST_F(PickerViewTest, SearchPlaceholderMatchesHasSelectionModeWithEditor) {
|
||||
@ -444,12 +443,11 @@ TEST_F(PickerViewTest, SearchPlaceholderMatchesHasSelectionModeWithoutEditor) {
|
||||
widget->Show();
|
||||
|
||||
PickerView* picker_view = GetPickerViewFromWidget(*widget);
|
||||
EXPECT_EQ(
|
||||
picker_view->search_field_view_for_testing()
|
||||
.textfield_for_testing()
|
||||
.GetPlaceholderText(),
|
||||
l10n_util::GetStringUTF16(
|
||||
IDS_PICKER_SEARCH_FIELD_HAS_SELECTION_WITHOUT_EDITOR_PLACEHOLDER_TEXT));
|
||||
EXPECT_EQ(picker_view->search_field_view_for_testing()
|
||||
.textfield_for_testing()
|
||||
.GetPlaceholderText(),
|
||||
l10n_util::GetStringUTF16(
|
||||
IDS_PICKER_SEARCH_FIELD_HAS_SELECTION_PLACEHOLDER_TEXT));
|
||||
}
|
||||
#endif
|
||||
|
||||
|
Reference in New Issue
Block a user