Create separate On/Off string resources for Vibration & haptics

Some translators need to be able to adapt the text for On/Off preference
state to match the preference title "Vibration & haptics", which
requires a different inflection and plural form on some languages.

This change separates this resource string from the more generic one
that was used before to allow this flexible translation.

Fix: 228342641
Fix: 229060423
Test: VibrationPreferenceControllerTest
Change-Id: Ib46b3e0d0a980ff57e91f55c73348c440327bad7
This commit is contained in:
Lais Andrade
2022-04-25 17:02:43 +01:00
parent 8cb0439d9c
commit cc8790f7b3
3 changed files with 11 additions and 4 deletions

View File

@@ -92,7 +92,7 @@ public class VibrationPreferenceControllerTest {
controller.updateState(mPreference);
assertThat(mPreference.getSummary().toString()).isEqualTo(
mContext.getString(R.string.switch_on_text));
mContext.getString(R.string.accessibility_vibration_settings_state_on));
}
@Test
@@ -103,7 +103,7 @@ public class VibrationPreferenceControllerTest {
controller.updateState(mPreference);
assertThat(mPreference.getSummary().toString()).isEqualTo(
mContext.getString(R.string.switch_on_text));
mContext.getString(R.string.accessibility_vibration_settings_state_on));
}
@Test
@@ -114,7 +114,7 @@ public class VibrationPreferenceControllerTest {
controller.updateState(mPreference);
assertThat(mPreference.getSummary().toString()).isEqualTo(
mContext.getString(R.string.switch_off_text));
mContext.getString(R.string.accessibility_vibration_settings_state_off));
}
private VibrationPreferenceController createPreferenceController() {