[Battery Usage] Make the timestamp slot info text format localizable.
(1) Some languages could localize the hephen to "~" or "to". (2) Both 12hr format and 24hr format will have spaces around the hyphen. Bug: 267185303 Bug: 266839251 Bug: 267349989 Bug: 267572852 Bug: 267595534 Test: manual Change-Id: I62ff37d9ab20292621ee29ee3080cea7f8fd0fdb
This commit is contained in:
@@ -440,7 +440,8 @@ public class BatteryChartPreferenceController extends AbstractPreferenceControll
|
||||
return selectedHourText;
|
||||
}
|
||||
|
||||
return String.format("%s %s", selectedDayText, selectedHourText);
|
||||
return mContext.getString(
|
||||
R.string.battery_usage_day_and_hour, selectedDayText, selectedHourText);
|
||||
}
|
||||
|
||||
private String getAccessibilityAnnounceMessage() {
|
||||
@@ -666,8 +667,8 @@ public class BatteryChartPreferenceController extends AbstractPreferenceControll
|
||||
}
|
||||
return index == timestamps.size() - 1
|
||||
? generateText(timestamps, index)
|
||||
: String.format("%s%s%s", generateText(timestamps, index),
|
||||
mIs24HourFormat ? "-" : " - ", generateText(timestamps, index + 1));
|
||||
: mContext.getString(R.string.battery_usage_timestamps_hyphen,
|
||||
generateText(timestamps, index), generateText(timestamps, index + 1));
|
||||
}
|
||||
|
||||
public HourlyChartLabelTextGenerator setLatestTimestamp(Long latestTimestamp) {
|
||||
|
Reference in New Issue
Block a user