Skip to content
This repository has been archived by the owner on Jul 22, 2024. It is now read-only.

Commit

Permalink
Replace all the hardcoded Firefox strings (#1612)
Browse files Browse the repository at this point in the history
* Replace all the hardcoded Firefox strings

* Updated modified strings id
  • Loading branch information
keianhzo authored and bluemarvin committed Aug 21, 2019
1 parent 3c3c7dc commit 8f83e2f
Show file tree
Hide file tree
Showing 8 changed files with 22 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -122,4 +122,8 @@ public void setHelpDelegate(Runnable aDelegate) {
}
}

public void setDescription(@NonNull String description) {
mSwitchDescription.setText(description);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -736,17 +736,7 @@ public void showButtonPrompt(String title, @NonNull String msg, @NonNull String[
mConfirmPrompt.show(REQUEST_FOCUS);
}

public void showAppDialog(@NonNull @StringRes int title, @NonNull @StringRes int description, @NonNull @StringRes int [] btnMsg, @NonNull AppDialogWidget.Delegate callback) {
mAppDialog = new AppDialogWidget(getContext());
mAppDialog.mWidgetPlacement.parentHandle = getHandle();
mAppDialog.setTitle(title);
mAppDialog.setMessage(description);
mAppDialog.setButtons(btnMsg);
mAppDialog.setDelegate(callback);
mAppDialog.show(REQUEST_FOCUS);
}

public void showAppDialog(@NonNull String title, @NonNull String description, @NonNull String[] btnMsg, @NonNull AppDialogWidget.Delegate callback) {
public void showAppDialog(@NonNull String title, @NonNull @StringRes int description, @NonNull @StringRes int [] btnMsg, @NonNull AppDialogWidget.Delegate callback) {
mAppDialog = new AppDialogWidget(getContext());
mAppDialog.mWidgetPlacement.parentHandle = getHandle();
mAppDialog.setTitle(title);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ public void show(@ShowFlags int aShowFlags) {

} else {
mWidgetManager.getFocusedWindow().showAppDialog(
R.string.voice_samples_collect_dialog_title,
getResources().getString(R.string.voice_samples_collect_data_dialog_title, getResources().getString(R.string.app_name)),
R.string.voice_samples_collect_dialog_description,
new int[]{
R.string.voice_samples_collect_dialog_do_not_allow,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,4 +81,8 @@ public void setHelpClickListener(@NonNull View.OnClickListener listener) {
mBinding.setHelpClickListener(listener);
}

public void setTitle(@NonNull String title) {
mBinding.setTitle(title);
}

}
2 changes: 1 addition & 1 deletion app/src/main/res/layout/options_language_display.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:title="@string/settings_language_choose_language_display_title" />
app:title="@{String.format(@string/settings_language_choose_display_language_title, @string/app_name)}" />

<ScrollView
android:id="@+id/scrollbar"
Expand Down
8 changes: 4 additions & 4 deletions app/src/main/res/layout/options_privacy.xml
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@
style="@style/settingsDescription"
android:height="40dp"
android:gravity="center_vertical"
android:text="@string/security_options_speech_data_title" />
android:text="@{String.format(@string/security_options_speech_data_collection_title, @string/app_name)}" />

<org.mozilla.vrbrowser.ui.views.settings.SwitchSetting
android:id="@+id/speechDataSwitch"
Expand All @@ -124,7 +124,7 @@
android:layout_marginStart="40dp"
app:on_text="@string/permission_allow"
app:off_text="@string/permission_reject"
app:description="@string/security_options_speech_data" />
app:description="@{String.format(@string/security_options_speech_data_collect, @string/app_name)}" />

<org.mozilla.vrbrowser.ui.views.settings.SwitchSetting
android:id="@+id/telemetryDataSwitch"
Expand All @@ -133,7 +133,7 @@
android:layout_marginStart="40dp"
app:on_text="@string/permission_allow"
app:off_text="@string/permission_reject"
app:description="@string/security_options_telemetry_data" />
app:description="@{String.format(@string/security_options_telemetry_send_data, @string/app_name)}" />

<org.mozilla.vrbrowser.ui.views.settings.SwitchSetting
android:id="@+id/crashReportsDataSwitch"
Expand All @@ -142,7 +142,7 @@
android:layout_marginStart="40dp"
app:on_text="@string/permission_allow"
app:off_text="@string/permission_reject"
app:description="@string/security_options_crash_reports_data" />
app:description="@{String.format(@string/security_options_crash_reports_send_data, @string/app_name)}" />

</LinearLayout>
</ScrollView>
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/layout/setting_switch.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
<TextView
android:id="@+id/setting_description"
android:textAlignment="textStart"
android:paddingEnd="20dp"
style="@style/settingsText"
tools:text="Switch Setting Description" />

Expand Down
12 changes: 6 additions & 6 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@
'Firefox Display Language' dialog window (accessible from the browser's Settings dialog window).
Below this string appears a list of locales for the user to choose as their preferred display
language for the application UI. -->
<string name="settings_language_choose_language_display_title">Firefox Display Language</string>
<string name="settings_language_choose_display_language_title">%1$s Display Language</string>

<!-- This string is used to label a text label that appears in the header description of 'Language Settings' ->
'Firefox Display Language' dialog window (accessible from the browser's Settings dialog window).
Expand Down Expand Up @@ -476,20 +476,20 @@

<!-- This string is a label above the group of switches that indicates that the switches below
relate to Firefox data collection and use. -->
<string name="security_options_speech_data_title">Firefox Data Collection and Use</string>
<string name="security_options_speech_data_collection_title">%1$s Data Collection and Use</string>

<!-- This string labels an Allow/Don't Allow switch in the Privacy and Security settings dialog
and is used to enable or disable permission to collect speech data. -->
<string name="security_options_speech_data">Allow Firefox to collect speech data</string>
<string name="security_options_speech_data_collect">Allow %1$s to collect speech data</string>

<!-- This string labels an Allow/Don't Allow switch in the Privacy and Security settings dialog
and is used to enable or disable permission to collect telemetry data. -->
<string name="security_options_telemetry_data">Allow Firefox to send technical and interaction data to Mozilla
<string name="security_options_telemetry_send_data">Allow %1$s to send technical and interaction data to Mozilla
</string>

<!-- This string labels an Allow/Don't Allow switch in the Privacy and Security settings dialog
and is used to enable or disable permission to send crash reports. -->
<string name="security_options_crash_reports_data">Allow Firefox to send backlogged crash reports on your behalf
<string name="security_options_crash_reports_send_data">Allow %1$s to send backlogged crash reports on your behalf
</string>

<!-- This string is displayed below the On/Off switch to indicate a switch's current state as 'On'. -->
Expand Down Expand Up @@ -860,7 +860,7 @@

<!-- This string is displayed in the title of the Voice Search samples collect dialog. That dialog is shown the first time
a user tries to use the voice search. -->
<string name="voice_samples_collect_dialog_title">Allow Firefox Reality to Collect Voice Samples for Research?</string>
<string name="voice_samples_collect_data_dialog_title">Allow %1$s to Collect Voice Samples for Research?</string>

<!-- This string is displayed in the description of the Voice Search samples collect dialog. That dialog is shown the first time
a user tries to use the voice search. -->
Expand Down

0 comments on commit 8f83e2f

Please sign in to comment.