Commit 289e5a21 authored by Peter Boström's avatar Peter Boström Committed by Commit Bot

Use sentence case for JS app-modal bubble titles

Covers widget dialog title sentence case for app_modal_strings.grdp.

This reverts the dialog titles to pre-titlecase "www.google.com says"
since this no longer looks wonky when there's no titlecase version of
it.

Bug: chromium:810111
Change-Id: I5f72d704629dfc1da1522c4a34707c5864a44947
Reviewed-on: https://chromium-review.googlesource.com/917467
Commit-Queue: Peter Boström <pbos@chromium.org>
Reviewed-by: default avatarAvi Drissman <avi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#536911}
parent 6adfd83f
......@@ -16,99 +16,84 @@ TEST(JavaScriptDialogManagerTest, GetTitle) {
struct Case {
const char* parent_url;
const char* alerting_url;
const char* expected_titlecase;
const char* expected_no_titlecase;
const char* expected;
const char* expected_android;
} cases[] = {
// Standard main frame alert.
{"http://foo.com/", "http://foo.com/", "From foo.com", "From foo.com",
"From foo.com"},
{"http://foo.com/", "http://foo.com/", "foo.com says", "foo.com says"},
// Subframe alert from the same origin.
{"http://foo.com/1", "http://foo.com/2", "From foo.com", "From foo.com",
"From foo.com"},
{"http://foo.com/1", "http://foo.com/2", "foo.com says", "foo.com says"},
// Subframe alert from a different origin.
{"http://foo.com/", "http://bar.com/", "From an Embedded Page at bar.com",
"From an embedded page at bar.com", "From an embedded page at bar.com"},
{"http://foo.com/", "http://bar.com/", "An embedded page at bar.com says",
"An embedded page at bar.com says"},
// file:
// - main frame:
{"file:///path/to/page.html", "file:///path/to/page.html",
"From This Page", "From this page", "From this page"},
"This page says", "This page says"},
// - subframe:
{"http://foo.com/", "file:///path/to/page.html",
"From an Embedded Page on This Page",
"From an embedded page on this page",
"From an embedded page on this page"},
"An embedded page on this page says",
"An embedded page on this page says"},
// ftp:
// - main frame:
{"ftp://foo.com/path/to/page.html", "ftp://foo.com/path/to/page.html",
"From foo.com", "From foo.com", "From ftp://foo.com"},
"foo.com says", "ftp://foo.com says"},
// - subframe:
{"http://foo.com/", "ftp://foo.com/path/to/page.html",
"From an Embedded Page at foo.com", "From an embedded page at foo.com",
"From an embedded page at ftp://foo.com"},
"An embedded page at foo.com says",
"An embedded page at ftp://foo.com says"},
// data:
// - main frame:
{"data:blahblah", "data:blahblah", "From This Page", "From this page",
"From this page"},
{"data:blahblah", "data:blahblah", "This page says", "This page says"},
// - subframe:
{"http://foo.com/", "data:blahblah", "From an Embedded Page on This Page",
"From an embedded page on this page",
"From an embedded page on this page"},
{"http://foo.com/", "data:blahblah", "An embedded page on this page says",
"An embedded page on this page says"},
// javascript:
// - main frame:
{"javascript:abc", "javascript:abc", "From This Page", "From this page",
"From this page"},
{"javascript:abc", "javascript:abc", "This page says", "This page says"},
// - subframe:
{"http://foo.com/", "javascript:abc",
"From an Embedded Page on This Page",
"From an embedded page on this page",
"From an embedded page on this page"},
"An embedded page on this page says",
"An embedded page on this page says"},
// about:
// - main frame:
{"about:blank", "about:blank", "From This Page", "From this page",
"From this page"},
{"about:blank", "about:blank", "This page says", "This page says"},
// - subframe:
{"http://foo.com/", "about:blank", "From an Embedded Page on This Page",
"From an embedded page on this page",
"From an embedded page on this page"},
{"http://foo.com/", "about:blank", "An embedded page on this page says",
"An embedded page on this page says"},
// blob:
// - main frame:
{"blob:http://foo.com/66666666-6666-6666-6666-666666666666",
"blob:http://foo.com/66666666-6666-6666-6666-666666666666",
"From foo.com", "From foo.com", "From foo.com"},
"foo.com says", "foo.com says"},
// - subframe:
{"http://bar.com/",
"blob:http://foo.com/66666666-6666-6666-6666-666666666666",
"From an Embedded Page at foo.com", "From an embedded page at foo.com",
"From an embedded page at foo.com"},
"An embedded page at foo.com says", "An embedded page at foo.com says"},
// filesystem:
// - main frame:
{"filesystem:http://foo.com/bar.html",
"filesystem:http://foo.com/bar.html", "From foo.com", "From foo.com",
"From foo.com"},
"filesystem:http://foo.com/bar.html", "foo.com says", "foo.com says"},
// - subframe:
{"http://bar.com/", "filesystem:http://foo.com/bar.html",
"From an Embedded Page at foo.com", "From an embedded page at foo.com",
"From an embedded page at foo.com"},
"An embedded page at foo.com says", "An embedded page at foo.com says"},
};
for (const auto& test_case : cases) {
base::string16 result = JavaScriptDialogManager::GetTitleImpl(
GURL(test_case.parent_url), GURL(test_case.alerting_url));
#if defined(OS_MACOSX)
EXPECT_EQ(test_case.expected_titlecase, base::UTF16ToUTF8(result));
#elif defined(OS_ANDROID)
#if defined(OS_ANDROID)
EXPECT_EQ(test_case.expected_android, base::UTF16ToUTF8(result));
#else
EXPECT_EQ(test_case.expected_no_titlecase, base::UTF16ToUTF8(result));
EXPECT_EQ(test_case.expected, base::UTF16ToUTF8(result));
#endif
}
}
......
......@@ -2,49 +2,27 @@
<grit-part>
<!-- JavaScript Dialog Box strings -->
<if expr="not use_titlecase">
<message name="IDS_JAVASCRIPT_MESSAGEBOX_TITLE" desc="Title for JavaScript prompt and confirm originating from a webpage">
From <ph name="SITE">$1<ex>http://www.google.com</ex></ph>
</message>
<message name="IDS_JAVASCRIPT_MESSAGEBOX_TITLE_IFRAME" desc="Title for JavaScript prompt and confirm originating from an iframe inside the webpage">
From an embedded page at <ph name="SITE">$1<ex>http://www.google.com</ex></ph>
</message>
<message name="IDS_JAVASCRIPT_MESSAGEBOX_TITLE_NONSTANDARD_URL" desc="Title for JavaScript prompt and confirm originating from a webpage with a non-standard URL such as |data:|">
From this page
</message>
<message name="IDS_JAVASCRIPT_MESSAGEBOX_TITLE_NONSTANDARD_URL_IFRAME" desc="Title for JavaScript prompt and confirm originating from an iframe inside the webpage with a non-standard URL such as |data:|">
From an embedded page on this page
</message>
</if>
<if expr="use_titlecase">
<message name="IDS_JAVASCRIPT_MESSAGEBOX_TITLE" desc="Title for JavaScript prompt and confirm originating from a webpage">
From <ph name="SITE">$1<ex>http://www.google.com</ex></ph>
</message>
<message name="IDS_JAVASCRIPT_MESSAGEBOX_TITLE_IFRAME" desc="Title for JavaScript prompt and confirm originating from an iframe inside the webpage">
From an Embedded Page at <ph name="SITE">$1<ex>http://www.google.com</ex></ph>
</message>
<message name="IDS_JAVASCRIPT_MESSAGEBOX_TITLE_NONSTANDARD_URL" desc="Title for JavaScript prompt and confirm originating from a webpage with a non-standard URL such as |data:|">
From This Page
</message>
<message name="IDS_JAVASCRIPT_MESSAGEBOX_TITLE_NONSTANDARD_URL_IFRAME" desc="Title for JavaScript prompt and confirm originating from an iframe inside the webpage with a non-standard URL such as |data:|">
From an Embedded Page on This Page
</message>
</if>
<message name="IDS_JAVASCRIPT_MESSAGEBOX_TITLE" desc="Title for JavaScript prompt and confirm originating from a webpage">
<ph name="SITE">$1<ex>http://www.google.com</ex></ph> says
</message>
<message name="IDS_JAVASCRIPT_MESSAGEBOX_TITLE_IFRAME" desc="Title for JavaScript prompt and confirm originating from an iframe inside the webpage">
An embedded page at <ph name="SITE">$1<ex>http://www.google.com</ex></ph> says
</message>
<message name="IDS_JAVASCRIPT_MESSAGEBOX_TITLE_NONSTANDARD_URL" desc="Title for JavaScript prompt and confirm originating from a webpage with a non-standard URL such as |data:|">
This page says
</message>
<message name="IDS_JAVASCRIPT_MESSAGEBOX_TITLE_NONSTANDARD_URL_IFRAME" desc="Title for JavaScript prompt and confirm originating from an iframe inside the webpage with a non-standard URL such as |data:|">
An embedded page on this page says
</message>
<message name="IDS_JAVASCRIPT_MESSAGEBOX_SUPPRESS_OPTION" desc="Optional UI shown on the message box, in the form of a checkbox, allowing the user to suppress additional message boxes from the page.">
Prevent this page from creating additional dialogs
</message>
<!-- "Before Unload" Dialog Box strings -->
<if expr="not use_titlecase">
<message name="IDS_BEFOREUNLOAD_MESSAGEBOX_TITLE" desc="Title for the 'before unload' dialog.">
Do you want to leave this site?
</message>
</if>
<if expr="use_titlecase">
<message name="IDS_BEFOREUNLOAD_MESSAGEBOX_TITLE" desc="Title for the 'before unload' dialog.">
Do You Want to Leave This Site?
</message>
</if>
<message name="IDS_BEFOREUNLOAD_MESSAGEBOX_TITLE" desc="Title for the 'before unload' dialog.">
Do you want to leave this site?
</message>
<message name="IDS_BEFOREUNLOAD_MESSAGEBOX_MESSAGE" desc="Text shown as the message of the 'before unload' dialog.">
Changes you made may not be saved.
</message>
......@@ -53,16 +31,9 @@
</message>
<!-- "Before Reload" Dialog Box strings (same as "Before Unload" but when reloading rather than unloading the page -->
<if expr="not use_titlecase">
<message name="IDS_BEFORERELOAD_MESSAGEBOX_TITLE" desc="Title for the 'before unload' dialog for reloads.">
Do you want to reload this site?
</message>
</if>
<if expr="use_titlecase">
<message name="IDS_BEFORERELOAD_MESSAGEBOX_TITLE" desc="Title for the 'before unload' dialog for reloads.">
Do You Want to Reload This Site?
</message>
</if>
<message name="IDS_BEFORERELOAD_MESSAGEBOX_TITLE" desc="Title for the 'before unload' dialog for reloads.">
Do you want to reload this site?
</message>
<message name="IDS_BEFORERELOAD_MESSAGEBOX_OK_BUTTON_LABEL" desc="The text on the button which reloads the page.">
Reload
</message>
......
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