Commit ca9446ad authored by My Nguyen's avatar My Nguyen Committed by Commit Bot

Update ChromeVox string for emoji suggestions

Bug: 1113612
Change-Id: I831b447955cc147c80cb9dac9da4414933d787ce
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2358716Reviewed-by: default avatarDarren Shen <shend@chromium.org>
Commit-Queue: My Nguyen <myy@chromium.org>
Cr-Commit-Position: refs/heads/master@{#798533}
parent 1359ecd0
......@@ -5688,6 +5688,15 @@ You can manage this account’s settings by installing the Family Link app on yo
<message name="IDS_SUGGESTION_ENTER_KEY" desc="This string is the enter key annotation to educate users how to accept a personal information suggestion.">
Enter
</message>
<message name="IDS_SUGGESTION_EMOJI_SUGGESTED" desc="String announced by screenreader when emoji suggestion pops up.">
Emoji suggested. Press up or down to navigate and enter to insert.
</message>
<message name="IDS_SUGGESTION_EMOJI_CHOSEN" desc="String announced by screenreader when users selected an emoji in the pop-up.">
<ph name="EMOJI_NAME">$1<ex>Party popper</ex></ph>. <ph name="EMOJI_INDEX">$2<ex>5</ex></ph> of <ph name="EMOJI_COUNT">$3<ex>5</ex></ph>.
</message>
<message name="IDS_SUGGESTION_DISMISSED" desc="String announced by screenreader when suggestion pop-up disappears.">
Suggestion dismissed
</message>
<!-- Strings for Custom Tab UI -->
<message name="IDS_CUSTOM_TABS_ACTION_MENU_ACCESSIBLE_NAME" desc="Accessible name for the overflow menu of the Chrome Custom Tab toolbar.">
......
2f8b8b4390763a991e2c1178f57b5750257c74f8
\ No newline at end of file
5d2f70d718fddea280e54e37fa6f267ac92cbdda
\ No newline at end of file
2f8b8b4390763a991e2c1178f57b5750257c74f8
\ No newline at end of file
......@@ -18,6 +18,7 @@
#include "base/task/thread_pool.h"
#include "chrome/browser/profiles/profile_manager.h"
#include "chrome/browser/ui/ash/keyboard/chrome_keyboard_controller_client.h"
#include "chrome/grit/generated_resources.h"
#include "chromeos/constants/chromeos_features.h"
#include "chromeos/constants/chromeos_pref_names.h"
#include "chromeos/services/ime/constants.h"
......@@ -36,11 +37,6 @@ const char kSpaceChar = ' ';
constexpr char kEmojiMapFilePathTemplateName[] = "/emoji/emoji-map%s.csv";
const int kMaxSuggestionIndex = 31;
const int kMaxSuggestionSize = kMaxSuggestionIndex + 1;
const char kShowEmojiSuggestionMessage[] =
"Emoji suggested. Press up or down to choose an emoji. Press enter to "
"insert.";
const char kDismissEmojiSuggestionMessage[] = "Emoji suggestion dismissed.";
const char kAnnounceCandidateTemplate[] = "%s. %zu of %zu";
const int kNoneHighlighted = -1;
std::string ReadEmojiDataFromFile() {
......@@ -240,7 +236,8 @@ void EmojiSuggester::ShowSuggestion(const std::string& text) {
candidates_ = emoji_map_.at(text);
properties_.visible = true;
properties_.candidates = candidates_;
properties_.announce_string = kShowEmojiSuggestionMessage;
properties_.announce_string =
l10n_util::GetStringUTF8(IDS_SUGGESTION_EMOJI_SUGGESTED);
properties_.show_setting_link =
GetPrefValue(kEmojiSuggesterShowSettingCount) <
kEmojiSuggesterShowSettingMaxCount;
......@@ -252,9 +249,9 @@ void EmojiSuggester::ShowSuggestion(const std::string& text) {
buttons_.clear();
for (size_t i = 0; i < candidates_.size(); i++) {
suggestion_button_.index = i;
suggestion_button_.announce_string = base::StringPrintf(
kAnnounceCandidateTemplate, base::UTF16ToUTF8(candidates_[i]).c_str(),
i + 1, candidates_.size());
suggestion_button_.announce_string = l10n_util::GetStringFUTF8(
IDS_SUGGESTION_EMOJI_CHOSEN, candidates_[i], base::FormatNumber(i + 1),
base::FormatNumber(candidates_.size()));
buttons_.push_back(suggestion_button_);
}
if (properties_.show_setting_link) {
......@@ -294,7 +291,8 @@ bool EmojiSuggester::AcceptSuggestion(size_t index) {
void EmojiSuggester::DismissSuggestion() {
std::string error;
properties_.visible = false;
properties_.announce_string = kDismissEmojiSuggestionMessage;
properties_.announce_string =
l10n_util::GetStringUTF8(IDS_SUGGESTION_DISMISSED);
suggestion_handler_->SetAssistiveWindowProperties(context_id_, properties_,
&error);
if (!error.empty()) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment