Commit a8eae41b authored by Jordy Greenblatt's avatar Jordy Greenblatt Committed by Commit Bot

[CrOS MultiDevice]: Beta versions of all strings in settings ui main page

Change-Id: I0389ed2168472e524a126d263bd30a52602cdb7e
Reviewed-on: https://chromium-review.googlesource.com/1102880
Commit-Queue: Jordy Greenblatt <jordynass@chromium.org>
Reviewed-by: default avatarSteven Bennetts <stevenjb@chromium.org>
Reviewed-by: default avatarKyle Horimoto <khorimoto@chromium.org>
Cr-Commit-Position: refs/heads/master@{#568141}
parent c6c7cdfc
......@@ -4113,11 +4113,26 @@
Better Together (Beta)
</message>
<message name="IDS_SETTINGS_MULTIDEVICE_SETUP_SUMMARY" desc="Description of the idea that the user can get a better experience on their Chromebook by connecting it to their phone." translateable="false">
Your Chromebook works better with your phone. (Beta)
Your Chromebook works better with your phone. (Beta) &lt;a target="_blank" href="<ph name="URL">$1<ex>https://google.com/</ex></ph>"&gt;Learn more.&lt;/a&gt;
</message>
<message name="IDS_SETTINGS_MULTIDEVICE_VERIFICATION_TEXT" desc="Text to tell user that their Chromebook needs to verify that it can connect with their phone." translateable="false">
Waiting for verification. (Beta) &lt;a target="_blank" href="<ph name="URL">$1<ex>https://google.com/</ex></ph>"&gt;Learn more.&lt;/a&gt;
</message>
<message name="IDS_SETTINGS_MULTIDEVICE_COULD_NOT_CONNECT" desc="Text to tell user that their Chromebook could not connect to their phone while it was trying to set up multidevice features." translateable="false">
Could not connect to phone. (Beta) &lt;a target="_blank" href="<ph name="URL">$1<ex>https://google.com/</ex></ph>"&gt;Learn more.&lt;/a&gt;
</message>
<message name="IDS_SETTINGS_MULTIDEVICE_SETUP_BUTTON" desc="Label of the button that opens a menu to the user that allows them to set up a connection between the user's phone and their Chromebook to give them access to special features.">
Set up
</message>
<message name="IDS_SETTINGS_MULTIDEVICE_VERIFY_BUTTON" desc="Label for the button to get the Chromebook to verify that it can connect with their phone." translateable="false">
Verify
</message>
<message name="IDS_SETTINGS_MULTIDEVICE_ENABLED" desc="Text to tell user multidevice features are enabled">
Enabled
</message>
<message name="IDS_SETTINGS_MULTIDEVICE_DISABLED" desc="Text to tell user multidevice features are disabled">
Disabled
</message>
<message name="IDS_SETTINGS_MULTIDEVICE_SMS_CONNECT" desc="Name of a feature. This feature lets the user read and reply to text messages from their Chromebook. New text messages will appear as notifications.">
SMS Connect
</message>
......
......@@ -13,14 +13,8 @@
<div class="settings-box two-line first">
<div class="start">
[[getLabelText_(mode)]]
<div class="secondary" id="multideviceSummary">
[[getSubLabelText_(mode)]]
<template is="dom-if"
if="[[shouldShowLearnMoreLink_(mode)]]" restamp>
<a href="chrome://foo-bar-multidevice-help-page" target="_blank">
$i18n{learnMore}.
</a>
</template>
<div class="secondary" id="multideviceSummary"
inner-h-t-m-l="[[getSubLabelInnerHtml_(mode)]]">
</div>
</div>
<div class="separator"></div>
......
......@@ -37,6 +37,15 @@ Polymer({
type: Number,
value: settings.MultiDeviceSettingsMode.NO_HOST_SET,
},
// TODO(jordynass): Set this variable once the information is retrieved from
// multidevice setup service.
/**
* @type {boolean|undefined}
* If a host has been verified, this is true if that host is and enabled and
* false if it is disabled. Otherwise it is undefined.
*/
hostEnabled: Boolean,
},
/**
......@@ -51,22 +60,20 @@ Polymer({
},
/**
* @return {string} Translated sublabel.
* @return {string} Translated sublabel with a "learn more" link.
* @private
*/
getSubLabelText_: function() {
getSubLabelInnerHtml_: function() {
switch (this.mode) {
case settings.MultiDeviceSettingsMode.NO_HOST_SET:
return this.i18n('multideviceSetupSummary');
return this.i18nAdvanced('multideviceSetupSummary');
case settings.MultiDeviceSettingsMode.HOST_SET_WAITING_FOR_SERVER:
// TODO(jordynass): Replace this with the real "Retry" string
return 'Retry Placeholder';
return this.i18nAdvanced('multideviceCouldNotConnect');
case settings.MultiDeviceSettingsMode.HOST_SET_WAITING_FOR_VERIFICATION:
// TODO(jordynass): Replace this with the real "Verify" string
return 'Verification Placeholder';
return this.i18nAdvanced('multideviceVerificationText');
default:
// TODO(jordynass): Replace this with the i18n versions
return 'Enabled/Disabled';
return this.hostEnabled ? this.i18n('multideviceEnabled') :
this.i18n('multideviceDisabled');
}
},
......@@ -79,24 +86,14 @@ Polymer({
case settings.MultiDeviceSettingsMode.NO_HOST_SET:
return this.i18n('multideviceSetupButton');
case settings.MultiDeviceSettingsMode.HOST_SET_WAITING_FOR_SERVER:
// TODO(jordynass): Replace this with the real "Retry" string
return 'Retry Placeholder';
return this.i18n('retry');
case settings.MultiDeviceSettingsMode.HOST_SET_WAITING_FOR_VERIFICATION:
// TODO(jordynass): Replace this with the real "Verify" string
return 'Verification Placeholder';
return this.i18n('multideviceVerifyButton');
default:
return null;
}
},
/**
* @return {boolean}
* @private
*/
shouldShowLearnMoreLink_: function() {
return this.mode != settings.MultiDeviceSettingsMode.HOST_SET_VERIFIED;
},
/**
* @return {boolean}
* @private
......
......@@ -2468,9 +2468,11 @@ void AddMultideviceStrings(content::WebUIDataSource* html_source) {
LocalizedString localized_strings[] = {
{"multidevicePageTitle", IDS_SETTINGS_MULTIDEVICE},
{"multideviceSetupButton", IDS_SETTINGS_MULTIDEVICE_SETUP_BUTTON},
{"multideviceVerifyButton", IDS_SETTINGS_MULTIDEVICE_VERIFY_BUTTON},
{"multideviceSetupItemHeading",
IDS_SETTINGS_MULTIDEVICE_SETUP_ITEM_HEADING},
{"multideviceSetupSummary", IDS_SETTINGS_MULTIDEVICE_SETUP_SUMMARY},
{"multideviceEnabled", IDS_SETTINGS_MULTIDEVICE_ENABLED},
{"multideviceDisabled", IDS_SETTINGS_MULTIDEVICE_DISABLED},
{"smsConnect", IDS_SETTINGS_MULTIDEVICE_SMS_CONNECT},
{"smsConnectSummary", IDS_SETTINGS_MULTIDEVICE_SMS_CONNECT_SUMMARY},
};
......@@ -2481,6 +2483,21 @@ void AddMultideviceStrings(content::WebUIDataSource* html_source) {
"enableMultideviceSettings",
base::FeatureList::IsEnabled(
chromeos::features::kEnableUnifiedMultiDeviceSettings));
html_source->AddString(
"multideviceVerificationText",
l10n_util::GetStringFUTF16(
IDS_SETTINGS_MULTIDEVICE_VERIFICATION_TEXT,
GetHelpUrlWithBoard(chrome::kMultiDeviceLearnMoreURL)));
html_source->AddString(
"multideviceCouldNotConnect",
l10n_util::GetStringFUTF16(
IDS_SETTINGS_MULTIDEVICE_COULD_NOT_CONNECT,
GetHelpUrlWithBoard(chrome::kMultiDeviceLearnMoreURL)));
html_source->AddString(
"multideviceSetupSummary",
l10n_util::GetStringFUTF16(
IDS_SETTINGS_MULTIDEVICE_SETUP_SUMMARY,
GetHelpUrlWithBoard(chrome::kMultiDeviceLearnMoreURL)));
}
#endif
......
......@@ -265,6 +265,9 @@ const char kGoogleNameserversLearnMoreURL[] =
const char kInstantTetheringLearnMoreURL[] =
"https://support.google.com/chromebook?p=instant_tethering";
const char kMultiDeviceLearnMoreURL[] =
"https://support.google.com/chromebook?p=multidevice-placeholder";
const char kLanguageSettingsLearnMoreUrl[] =
"https://support.google.com/chromebook/answer/1059490";
......
......@@ -218,6 +218,9 @@ extern const char kGoogleNameserversLearnMoreURL[];
// The URL for the "learn more" link for Instant Tethering.
extern const char kInstantTetheringLearnMoreURL[];
// The URL for the "Learn more" link in the connected devices.
extern const char kMultiDeviceLearnMoreURL[];
// The URL for the "Learn more" link in the language settings.
extern const char kLanguageSettingsLearnMoreUrl[];
......
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