0

Update Strings to Final Version for Battery Saver

Change-Id: I2bdf5d1d0889e79eaf8e194d7f051264df7f61b2
Bug: b:285201326
Test: ash_unittests
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4937770
Commit-Queue: Charles Dick <cwd@google.com>
Reviewed-by: Xiyuan Xia <xiyuan@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1209188}
This commit is contained in:
Michael Wojcicka
2023-10-13 01:00:55 +00:00
committed by Chromium LUCI CQ
parent 36fa8d8e44
commit 872d2f372e
13 changed files with 56 additions and 34 deletions

@ -2694,33 +2694,35 @@ Style notes:
About <ph name="time_left">$1<ex>40 minutes</ex></ph> left (<ph name="percentage">$2<ex>56%</ex></ph>%).
Connect your device to power.
</message>
<message name="IDS_ASH_STATUS_TRAY_LOW_BATTERY_MESSAGE_WITHOUT_TIME" translateable="false" desc="The label in the tray dialog to show the remaining battery power as a percent.">
About <ph name="percentage">$1<ex>56%</ex></ph>% left.
Connect your device to power.
</message>
<message name="IDS_ASH_BATTERY_SAVER_DISABLED_TOAST_TEXT" translateable="false" desc="The toast message when battery saver mode is disabled.">
Battery Saver has been turned off
</message>
<message name="IDS_ASH_BATTERY_SAVER_ENABLED_TOAST_TEXT" translateable="false" desc="The toast message when battery saver mode is enabled.">
Battery Saver has been turned on
</message>
<message name="IDS_ASH_STATUS_TRAY_LOW_BATTERY_BSM_TITLE" translateable="false" desc="The title for the notification displayed when device battery level is low, and battery saver mode is enabled.">
<message name="IDS_ASH_STATUS_TRAY_LOW_BATTERY_BSM_AUTOENABLED_TITLE" desc="The title for the notification displayed when device battery level is low, and battery saver was just enabled.">
Low battery. Battery Saver turned on.
</message>
<message name="IDS_ASH_STATUS_TRAY_LOW_BATTERY_BSM_MESSAGE" translateable="false" desc="The label in the tray dialog to show the remaining battery power as a percent, with additional text stating battery saver mode has been enabled.">
About <ph name="time_left">$1<ex>40 minutes</ex></ph> left (<ph name="percentage">$2<ex>56%</ex></ph>%).
<message name="IDS_ASH_STATUS_TRAY_LOW_BATTERY_BSM_AUTOENABLED_MESSAGE" desc="The notification body text stating features are limited because of battery saver, alongside the remaining battery percentage, and the estimated time remaining.">
<ph name="percentage">$1<ex>20%</ex></ph>% battery left (about <ph name="time_left">$2<ex>25 minutes</ex></ph>).
Some features are limited to increase battery life.
</message>
<message name="IDS_ASH_STATUS_TRAY_LOW_BATTERY_BSM_MESSAGE_WITHOUT_TIME" translateable="false" desc="The notification body text stating features are limited because of battery saver, alongside the remaining battery percentage.">
About <ph name="percentage">$1<ex>56%</ex></ph>% left.
<message name="IDS_ASH_STATUS_TRAY_LOW_BATTERY_BSM_AUTOENABLED_MESSAGE_WITHOUT_TIME" desc="The notification body text stating features are limited because of battery saver, alongside the remaining battery percentage.">
<ph name="percentage">$1<ex>20%</ex></ph>% battery left.
Some features are limited to increase battery life.
</message>
<message name="IDS_ASH_STATUS_TRAY_LOW_BATTERY_BSM_BUTTON_OPT_OUT" translateable="false" desc="The button text on the low power notification to disable battery saver.">
Turn off Battery Saver
<message name="IDS_ASH_STATUS_TRAY_LOW_BATTERY_BSM_GENERIC_MESSAGE" desc="The notification body text telling the user their battery is low using both percentage and time remaining estimates.">
<ph name="percentage">$1<ex>20%</ex></ph>% battery left (about <ph name="time_left">$2<ex>25 minutes</ex></ph>). Connect your device to power.
</message>
<message name="IDS_ASH_STATUS_TRAY_LOW_BATTERY_BSM_GENERIC_MESSAGE_WITHOUT_TIME" desc="The notification body text telling the user their battery is low via percentage.">
<ph name="percentage">$1<ex>20%</ex></ph>% battery left. Connect your device to power.
</message>
<message name="IDS_ASH_STATUS_TRAY_LOW_BATTERY_BSM_BUTTON_OPT_OUT" desc="The button text on the low power notification to disable battery saver.">
Turn off
</message>
<message name="IDS_ASH_STATUS_TRAY_LOW_BATTERY_BSM_BUTTON_OPT_IN" translateable="false" desc="The button text on the low power notification to enable battery saver.">
Turn on Battery Saver
</message>
<message name="IDS_ASH_BATTERY_SAVER_DISABLED_TOAST_TEXT" desc="The toast message that appears battery saver is disabled, typically through user interaction like charger plug-in or pressing the notification disable button.">
Battery Saver turned off
</message>
<message name="IDS_ASH_BATTERY_SAVER_ENABLED_TOAST_TEXT" desc="The toast message when battery saver is enabled. This typically appears when there is no notification ">
Battery Saver turned on
</message>
<message name="IDS_ASH_STATUS_TRAY_BATTERY_PERCENT_TITLE" desc="The title displayed in a battery status notification.">Battery status</message>
<message name="IDS_ASH_STATUS_TRAY_BATTERY_PERCENT" desc="The label in the tray dialog to show the remaining battery power as a percent.">
<ph name="percentage">{0,number,percent}<ex>56%</ex></ph> remaining
@ -2749,10 +2751,10 @@ Some features are limited to increase battery life.
<message name="IDS_ASH_STATUS_TRAY_BATTERY_PERCENT_CHARGING_ACCESSIBLE" desc="The message used by accessibility to show battery is being charged.">
Battery at <ph name="percentage">$1<ex>56</ex></ph>% and charging.
</message>
<message name="IDS_ASH_STATUS_TRAY_BATTERY_PERCENT_BSM_ON_ACCESSIBLE" translateable="false" desc="The message used by accessibility to show battery is discharging with battery saver enabled.">
<message name="IDS_ASH_STATUS_TRAY_BATTERY_PERCENT_BSM_ON_ACCESSIBLE" desc="The message used by accessibility to show battery is discharging with battery saver enabled.">
Battery at <ph name="percentage">$1<ex>56</ex></ph> percent. Battery Saver is on.
</message>
<message name="IDS_ASH_STATUS_TRAY_BATTERY_PERCENT_CHARGING_BSM_ON_ACCESSIBLE" translateable="false" desc="The message used by accessibility to show battery is being charged with battery saver enabled.">
<message name="IDS_ASH_STATUS_TRAY_BATTERY_PERCENT_CHARGING_BSM_ON_ACCESSIBLE" desc="The message used by accessibility to show battery is being charged with battery saver enabled.">
Battery at <ph name="percentage">$1<ex>56</ex></ph>% and charging. Battery Saver is on.
</message>
<message name="IDS_ASH_STATUS_TRAY_BATTERY_CALCULATING_ACCESSIBLE" desc="The message used by accessibility to show battery is calculating its time in short message.">

@ -0,0 +1 @@
94523e3dbd6829a8979dadda7770de1a21d38c53

@ -0,0 +1 @@
917a1e93e8afa9cb4a764c7ff8aa93ee793f3bf1

@ -0,0 +1 @@
346172cbad0787d9080c206a8672454115c8cef8

@ -0,0 +1 @@
2b128856c561007416a4cb1fcb90b1a8378bfb80

@ -0,0 +1 @@
f450a1071963bbba053f184d4a2abd762ef429d8

@ -0,0 +1 @@
173d235ab10b6784d263d58bfae853389f3f7150

@ -0,0 +1 @@
f450a1071963bbba053f184d4a2abd762ef429d8

@ -0,0 +1 @@
f450a1071963bbba053f184d4a2abd762ef429d8

@ -0,0 +1 @@
feb88a1945e4cf2cf8223ebfa6b861d415b6df1e

@ -0,0 +1 @@
b84b725e86368f564e54ae88f404b0751f899b77

@ -89,7 +89,8 @@ std::u16string GetLowBatteryTitle(
return l10n_util::GetStringUTF16(
IDS_ASH_STATUS_TRAY_CRITICAL_BATTERY_TITLE);
} else if (enabling_at_threshold_notification) {
return l10n_util::GetStringUTF16(IDS_ASH_STATUS_TRAY_LOW_BATTERY_BSM_TITLE);
return l10n_util::GetStringUTF16(
IDS_ASH_STATUS_TRAY_LOW_BATTERY_BSM_AUTOENABLED_TITLE);
}
return l10n_util::GetStringUTF16(IDS_ASH_STATUS_TRAY_LOW_BATTERY_TITLE);
@ -121,10 +122,10 @@ std::u16string GetLowBatteryMessage(
enabling_at_threshold_notification) {
return should_display_time
? l10n_util::GetStringFUTF16(
IDS_ASH_STATUS_TRAY_LOW_BATTERY_BSM_MESSAGE, duration,
base::NumberToString16(battery_percentage))
IDS_ASH_STATUS_TRAY_LOW_BATTERY_BSM_AUTOENABLED_MESSAGE,
base::NumberToString16(battery_percentage), duration)
: l10n_util::GetStringFUTF16(
IDS_ASH_STATUS_TRAY_LOW_BATTERY_BSM_MESSAGE_WITHOUT_TIME,
IDS_ASH_STATUS_TRAY_LOW_BATTERY_BSM_AUTOENABLED_MESSAGE_WITHOUT_TIME,
base::NumberToString16(battery_percentage));
}
@ -133,10 +134,10 @@ std::u16string GetLowBatteryMessage(
critical_notification)) {
return should_display_time
? l10n_util::GetStringFUTF16(
IDS_ASH_STATUS_TRAY_LOW_BATTERY_MESSAGE, duration,
base::NumberToString16(battery_percentage))
IDS_ASH_STATUS_TRAY_LOW_BATTERY_BSM_GENERIC_MESSAGE,
base::NumberToString16(battery_percentage), duration)
: l10n_util::GetStringFUTF16(
IDS_ASH_STATUS_TRAY_LOW_BATTERY_MESSAGE_WITHOUT_TIME,
IDS_ASH_STATUS_TRAY_LOW_BATTERY_BSM_GENERIC_MESSAGE_WITHOUT_TIME,
base::NumberToString16(battery_percentage));
}

@ -181,12 +181,19 @@ class BatteryNotificationTest : public AshTestBase {
return GetStringUTF16(IDS_ASH_STATUS_TRAY_LOW_BATTERY_TITLE);
}
std::u16string GetLowPowerMessageWithoutTime() {
std::u16string GetLowPowerMessageBSMWithoutTime() {
return GetStringFUTF16(
IDS_ASH_STATUS_TRAY_LOW_BATTERY_MESSAGE_WITHOUT_TIME,
IDS_ASH_STATUS_TRAY_LOW_BATTERY_BSM_GENERIC_MESSAGE_WITHOUT_TIME,
base::NumberToString16(PowerStatus::Get()->GetRoundedBatteryPercent()));
}
std::u16string GetLowPowerMessageBSM() {
return GetStringFUTF16(
IDS_ASH_STATUS_TRAY_LOW_BATTERY_BSM_GENERIC_MESSAGE,
base::NumberToString16(PowerStatus::Get()->GetRoundedBatteryPercent()),
GetRemainingTimeString());
}
std::u16string GetLowPowerMessage() {
return GetStringFUTF16(
IDS_ASH_STATUS_TRAY_LOW_BATTERY_MESSAGE, GetRemainingTimeString(),
@ -194,19 +201,21 @@ class BatteryNotificationTest : public AshTestBase {
}
std::u16string GetBatterySaverTitle() {
return GetStringUTF16(IDS_ASH_STATUS_TRAY_LOW_BATTERY_BSM_TITLE);
return GetStringUTF16(
IDS_ASH_STATUS_TRAY_LOW_BATTERY_BSM_AUTOENABLED_TITLE);
}
std::u16string GetBatterySaverMessageWithoutTime() {
return GetStringFUTF16(
IDS_ASH_STATUS_TRAY_LOW_BATTERY_BSM_MESSAGE_WITHOUT_TIME,
IDS_ASH_STATUS_TRAY_LOW_BATTERY_BSM_AUTOENABLED_MESSAGE_WITHOUT_TIME,
base::NumberToString16(PowerStatus::Get()->GetRoundedBatteryPercent()));
}
std::u16string GetBatterySaverMessage() {
return GetStringFUTF16(
IDS_ASH_STATUS_TRAY_LOW_BATTERY_BSM_MESSAGE, GetRemainingTimeString(),
base::NumberToString16(PowerStatus::Get()->GetRoundedBatteryPercent()));
IDS_ASH_STATUS_TRAY_LOW_BATTERY_BSM_AUTOENABLED_MESSAGE,
base::NumberToString16(PowerStatus::Get()->GetRoundedBatteryPercent()),
GetRemainingTimeString());
}
std::u16string GetBatterySaverOptOutButtonString() {
@ -321,7 +330,7 @@ TEST_F(BatteryNotificationTest, ThresholdBatterySaverOptInNotification) {
SystemNotificationWarningLevel::WARNING,
FullscreenVisibility::OVER_USER,
GetLowPowerTitle(),
GetLowPowerMessage(),
GetLowPowerMessageBSM(),
GetBatterySaverOptInButtonString()};
// Battery Saver should turn on when the button is clicked.
@ -344,7 +353,7 @@ TEST_F(BatteryNotificationTest,
SystemNotificationWarningLevel::WARNING,
FullscreenVisibility::OVER_USER,
GetLowPowerTitle(),
GetLowPowerMessageWithoutTime(),
GetLowPowerMessageBSMWithoutTime(),
GetBatterySaverOptInButtonString()};
// Battery Saver should turn on when the button is clicked.