Commit 28e8bac0 authored by James Cook's avatar James Cook Committed by Commit Bot

Add translation context for on/off strings in ash UI and settings

The "desc" attribute is not sufficient to provide context to the
translators because identical strings will be collapsed in the
translation console.

Add additional string constants, eliminate the shared "toggleOn"
and "toggleOff" strings, and provide the "meaning" attribute in
the GRD file to disambiguate.

See bugs for details, or
https://www.chromium.org/developers/design-documents/ui-localization

Bug: 1031145
Bug: b/145301624
Change-Id: I3daf288f5a8a0dbf9ebd65575e7ff77144880ac2
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1986862Reviewed-by: default avatarSteven Bennetts <stevenjb@chromium.org>
Commit-Queue: James Cook <jamescook@chromium.org>
Cr-Commit-Position: refs/heads/master@{#728293}
parent c5581c0e
......@@ -261,10 +261,10 @@ This file contains the strings for ash.
<message name="IDS_ASH_STATUS_TRAY_NIGHT_LIGHT_SETTINGS_TOOLTIP" desc="The tooltip text used for the button in the status tray to show the Night Light feature (which controls the color temperature of the screen) settings.">
Show Night Light settings
</message>
<message name="IDS_ASH_STATUS_TRAY_NIGHT_LIGHT_OFF_STATE" desc="The label for the Off state of the Night Light feature.">
<message name="IDS_ASH_STATUS_TRAY_NIGHT_LIGHT_OFF_STATE" desc="Button label for the Night Light feature." meaning="Night Light feature is off.">
Off
</message>
<message name="IDS_ASH_STATUS_TRAY_NIGHT_LIGHT_ON_STATE" desc="The label for the On state of the Night Light feature.">
<message name="IDS_ASH_STATUS_TRAY_NIGHT_LIGHT_ON_STATE" desc="Button label for the Night Light feature." meaning="Night Light feature is on.">
On
</message>
<message name="IDS_ASH_STATUS_TRAY_CAST" desc="The label used as the header in the cast popup.">
......@@ -350,10 +350,10 @@ This file contains the strings for ash.
<message name="IDS_ASH_STATUS_TRAY_BLUETOOTH_DISABLED" desc="The label used in the tray popup to notify that bluetooth is disabled.">
Bluetooth disabled
</message>
<message name="IDS_ASH_STATUS_TRAY_BLUETOOTH_ENABLED_SHORT" desc="The short label used in the tray popup to notify that bluetooth is enabled.">
<message name="IDS_ASH_STATUS_TRAY_BLUETOOTH_ENABLED_SHORT" desc="Bluetooth button label in the status tray popup." meaning="Bluetooth is enabled.">
On
</message>
<message name="IDS_ASH_STATUS_TRAY_BLUETOOTH_DISABLED_SHORT" desc="The short label used in the tray popup to notify that bluetooth is disabled.">
<message name="IDS_ASH_STATUS_TRAY_BLUETOOTH_DISABLED_SHORT" desc="Bluetooth button label in the status tray popup." meaning="Bluetooth is disabled.">
Off
</message>
<message name="IDS_ASH_STATUS_TRAY_BLUETOOTH_DISCOVERING" desc="The label used in the tray popup to show bluetooth is discovering devices.">
......@@ -1463,10 +1463,10 @@ This file contains the strings for ash.
<message name="IDS_ASH_STATUS_TRAY_VPN_TOOLTIP" desc="The tooltip text used for the button that shows VPN settings.">
Show VPN settings
</message>
<message name="IDS_ASH_STATUS_TRAY_VPN_DISCONNECTED_SHORT" desc="The short label used in system tray bubble to display vpn is disconnected.">
<message name="IDS_ASH_STATUS_TRAY_VPN_DISCONNECTED_SHORT" desc="VPN button label in the system tray bubble." meaning="VPN is disconnected.">
Off
</message>
<message name="IDS_ASH_STATUS_TRAY_VPN_CONNECTED_SHORT" desc="The short label used in system tray bubble to display vpn is connected.">
<message name="IDS_ASH_STATUS_TRAY_VPN_CONNECTED_SHORT" desc="VPN button label in the system tray bubble." meaning="VPN is connected.">
On
</message>
<message name="IDS_ASH_STATUS_TRAY_NETWORK_WIFI_ENABLED" desc="The label used in the tray popup to notify that Wi-Fi is turned on.">
......
cf9ee8e889eae278244569a0fc759e2c8bda9ada
\ No newline at end of file
cb322526d27c186b29ab0eecb64f8c4f0e0e9be0
\ No newline at end of file
07bfb9e59ab2c015f939d85cb0c6299629f12c59
\ No newline at end of file
fcd805742f139847fa769fa5647cd304fb134c67
\ No newline at end of file
da25c17885214e3d69ae80081dd43a1d1ae5432f
\ No newline at end of file
433b28f931598a3f57a177221c2aea43392fdfff
\ No newline at end of file
......@@ -882,10 +882,10 @@
</message>
</if>
<if expr="chromeos">
<message name="IDS_SETTINGS_DEVICE_OFF" desc="In Settings pages, the label when a bluetooth, wifi, or mobile device is off (disabled).">
<message name="IDS_SETTINGS_DEVICE_OFF" desc="In Settings pages, the label when a bluetooth, wifi, or mobile device is off (disabled)." meaning="Device is disabled.">
Off
</message>
<message name="IDS_SETTINGS_DEVICE_ON" desc="In Settings pages, the label when a bluetooth, wifi, or mobile device is on (enabled).">
<message name="IDS_SETTINGS_DEVICE_ON" desc="In Settings pages, the label when a bluetooth, wifi, or mobile device is on (enabled)." meaning="Device is enabled.">
On
</message>
<message name="IDS_SETTINGS_RESTART" desc="Text for a button that will restart ChromeOS.">
......@@ -904,12 +904,6 @@
<message name="IDS_SETTINGS_EDIT" desc="Label used on a menu item or button, used in different contexts to edit an item.">
Edit
</message>
<message name="IDS_SETTINGS_TOGGLE_ON" desc="Label used on a main settings toggle that is on.">
On
</message>
<message name="IDS_SETTINGS_TOGGLE_OFF" desc="Label used on a main settings toggle that is off.">
Off
</message>
<message name="IDS_SETTINGS_NOT_VALID" desc="Text indicating that an input is not valid.">
Not valid
</message>
......@@ -3189,6 +3183,12 @@
<message name="IDS_SETTINGS_SEARCH_GOOGLE_ASSISTANT_DISABLED" desc="Sub label for the Google Assistant button when Assistant is disabled.">
Disabled
</message>
<message name="IDS_SETTINGS_SEARCH_GOOGLE_ASSISTANT_ON" desc="Row label in Google Assistant settings." meaning="Google Assistant is off.">
On
</message>
<message name="IDS_SETTINGS_SEARCH_GOOGLE_ASSISTANT_OFF" desc="Row label in Google Assistant settings." meaning="Google Assistant is on.">
Off
</message>
</if>
<!-- Search Engines Page -->
......@@ -3258,7 +3258,7 @@
<message name="IDS_SETTINGS_GOOGLE_ASSISTANT_ENABLE_HOTWORD_WITHOUT_DSP_ALWAYS_ON" desc="Always-on label for hotword-enable dropdown without DSP support.">
Always on
</message>
<message name="IDS_SETTINGS_GOOGLE_ASSISTANT_ENABLE_HOTWORD_WITHOUT_DSP_OFF" desc="Off label for hotword-enable dropdown without DSP support.">
<message name="IDS_SETTINGS_GOOGLE_ASSISTANT_ENABLE_HOTWORD_WITHOUT_DSP_OFF" desc="Off label for hotword-enable dropdown without DSP support." meaning="Ok Google hotwording is disabled.">
Off
</message>
<message name="IDS_SETTINGS_GOOGLE_ASSISTANT_VOICE_SETTINGS" desc="Title for the Assistant voice settings.">
......@@ -4832,6 +4832,12 @@
<message name="IDS_SETTINGS_DISPLAY_UNIFIED_DESKTOP" desc="In Device Settings > Displays, the label for the control for the unified desktop feature.">
Allow windows to span displays
</message>
<message name="IDS_SETTINGS_DISPLAY_UNIFIED_DESKTOP_ON" desc="Label for the state for the unified desktop feature." meaning="Windows are allowed to span displays.">
On
</message>
<message name="IDS_SETTINGS_DISPLAY_UNIFIED_DESKTOP_OFF" desc="Label for the state for the unified desktop feature." meaning="Windows are not allowed to span displays.">
Off
</message>
<message name="IDS_SETTINGS_DISPLAY_SCREEN" desc="In Device Settings > Displays, the label for the dropdown menu for changing the dispay type.">
Screen
</message>
......
72f5b7711d2a500d528d493bc862cb981fb5bf82
\ No newline at end of file
18c311fcb4db9c51e63541e2a9018e9f285802c6
\ No newline at end of file
e96191c0f96f5697eadb1eecebb5df99aca50e21
\ No newline at end of file
c4daf69b887c51d12c2e743250affde99f195add
\ No newline at end of file
......@@ -461,15 +461,6 @@ Polymer({
return !!(list && list.length);
},
/**
* @private
* @param {boolean} toggleValue
* @return {string}
*/
getOnOffLabel_: function(toggleValue) {
return toggleValue ? this.i18n('toggleOn') : this.i18n('toggleOff');
},
/** @private */
hasPasswords_: function() {
return this.savedPasswords.length > 0;
......
......@@ -604,7 +604,9 @@ Polymer({
* @private
*/
getUnifiedDesktopText_: function(unifiedDesktopMode) {
return this.i18n(unifiedDesktopMode ? 'toggleOn' : 'toggleOff');
return this.i18n(
unifiedDesktopMode ? 'displayUnifiedDesktopOn' :
'displayUnifiedDesktopOff');
},
/**
......
......@@ -131,7 +131,8 @@ Polymer({
* @private
*/
getAssistantOnOffLabel_: function(toggleValue) {
return this.i18n(toggleValue ? 'toggleOn' : 'toggleOff');
return this.i18n(
toggleValue ? 'searchGoogleAssistantOn' : 'searchGoogleAssistantOff');
},
/** @private */
......
......@@ -190,8 +190,6 @@ void AddCommonStrings(content::WebUIDataSource* html_source, Profile* profile) {
{"settings", IDS_SETTINGS_SETTINGS},
{"settingsAltPageTitle", IDS_SETTINGS_ALT_PAGE_TITLE},
{"subpageArrowRoleDescription", IDS_SETTINGS_SUBPAGE_BUTTON},
{"toggleOn", IDS_SETTINGS_TOGGLE_ON},
{"toggleOff", IDS_SETTINGS_TOGGLE_OFF},
{"notValid", IDS_SETTINGS_NOT_VALID},
{"notValidWebAddress", IDS_SETTINGS_NOT_VALID_WEB_ADDRESS},
{"notValidWebAddressForContentType",
......@@ -1043,6 +1041,8 @@ void AddDeviceStrings(content::WebUIDataSource* html_source) {
{"displayNightLightTempSliderMinLabel",
IDS_SETTINGS_DISPLAY_NIGHT_LIGHT_TEMP_SLIDER_MIN_LABEL},
{"displayUnifiedDesktop", IDS_SETTINGS_DISPLAY_UNIFIED_DESKTOP},
{"displayUnifiedDesktopOn", IDS_SETTINGS_DISPLAY_UNIFIED_DESKTOP_ON},
{"displayUnifiedDesktopOff", IDS_SETTINGS_DISPLAY_UNIFIED_DESKTOP_OFF},
{"displayResolutionTitle", IDS_SETTINGS_DISPLAY_RESOLUTION_TITLE},
{"displayResolutionText", IDS_SETTINGS_DISPLAY_RESOLUTION_TEXT},
{"displayResolutionTextBest", IDS_SETTINGS_DISPLAY_RESOLUTION_TEXT_BEST},
......@@ -2638,6 +2638,8 @@ void AddSearchStrings(content::WebUIDataSource* html_source, Profile* profile) {
IDS_SETTINGS_SEARCH_GOOGLE_ASSISTANT_ENABLED},
{"searchGoogleAssistantDisabled",
IDS_SETTINGS_SEARCH_GOOGLE_ASSISTANT_DISABLED},
{"searchGoogleAssistantOn", IDS_SETTINGS_SEARCH_GOOGLE_ASSISTANT_ON},
{"searchGoogleAssistantOff", IDS_SETTINGS_SEARCH_GOOGLE_ASSISTANT_OFF},
#endif
};
AddLocalizedStringsBulk(html_source, kLocalizedStrings);
......
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