Commit 9ce583fe authored by llin@chromium.org's avatar llin@chromium.org Committed by Commit Bot

Update the way of presenting language name.

The source language localized name might contain bracket already, for example:
Chinese (Traditional). Checked with UX team and update the way we
present language name to "[query] · [language name]".

Bug: b/144317438
Test: unit tests
Change-Id: Iab209a4eb0d2abdb5ce1b298f7528f751e39cfe2
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2013893
Commit-Queue: Li Lin <llin@chromium.org>
Reviewed-by: default avatarXiaohui Chen <xiaohuic@chromium.org>
Reviewed-by: default avatarXiyuan Xia <xiyuan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#734332}
parent 286f8628
...@@ -19,9 +19,7 @@ constexpr char kSourceTextPath[] = "translateResult.sourceText"; ...@@ -19,9 +19,7 @@ constexpr char kSourceTextPath[] = "translateResult.sourceText";
constexpr char kSourceLanguageLocalizedNamePath[] = constexpr char kSourceLanguageLocalizedNamePath[] =
"translateResult.sourceTextLanguageLocalizedName"; "translateResult.sourceTextLanguageLocalizedName";
constexpr char kTranslatedTextPath[] = "translateResult.translatedText"; constexpr char kTranslatedTextPath[] = "translateResult.translatedText";
// TODO(llin): The language localized name might contains bracket, for example constexpr char kSourceTextTemplate[] = "%s · %s";
// Chinese (Traditional). Update the template after UX is finalized.
constexpr char kSourceTextTemplate[] = "%s (%s)";
} // namespace } // namespace
......
...@@ -43,7 +43,7 @@ TEST_F(TranslationResultParserTest, Success) { ...@@ -43,7 +43,7 @@ TEST_F(TranslationResultParserTest, Success) {
EXPECT_TRUE(parser_->Parse(&result, &quick_answer)); EXPECT_TRUE(parser_->Parse(&result, &quick_answer));
EXPECT_EQ(ResultType::kTranslationResult, quick_answer.result_type); EXPECT_EQ(ResultType::kTranslationResult, quick_answer.result_type);
EXPECT_EQ("ox\\xC3\\xADgeno", quick_answer.primary_answer); EXPECT_EQ("ox\\xC3\\xADgeno", quick_answer.primary_answer);
EXPECT_EQ("oxygen (English)", quick_answer.secondary_answer); EXPECT_EQ("oxygen · English", quick_answer.secondary_answer);
} }
TEST_F(TranslationResultParserTest, MissingSourceText) { TEST_F(TranslationResultParserTest, MissingSourceText) {
......
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