forked from upstream-mirrors/OpenTracks
Add generic_yes and generic_no strings and use them in confirmation dialogs.
This commit is contained in:
@@ -708,6 +708,10 @@ limitations under the License.
|
||||
%1$s name. E.g., 'Track 1'.">
|
||||
Name: %1$s
|
||||
</string>
|
||||
<string name="generic_no"
|
||||
translation_description="The text on a button to say no.">
|
||||
No
|
||||
</string>
|
||||
<string name="generic_ok"
|
||||
translation_description="The text on a button to say ok.">
|
||||
OK
|
||||
@@ -732,7 +736,11 @@ limitations under the License.
|
||||
translation_description="The title on an alert dialog indicating success.">
|
||||
Success
|
||||
</string>
|
||||
|
||||
<string name="generic_yes"
|
||||
translation_description="The text on a button to say yes.">
|
||||
Yes
|
||||
</string>
|
||||
|
||||
<!-- Gps -->
|
||||
<string name="gps_google_location_settings"
|
||||
translation_description="In Android, the Google location settings to modify location settings
|
||||
|
||||
@@ -107,8 +107,8 @@ public class ConfirmDialogFragment extends DialogFragment {
|
||||
checkBox = (CheckBox) view.findViewById(R.id.confirm_dialog_check_box);
|
||||
|
||||
return new AlertDialog.Builder(fragmentActivity).setNegativeButton(
|
||||
android.R.string.cancel, null)
|
||||
.setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() {
|
||||
R.string.generic_no, null)
|
||||
.setPositiveButton(R.string.generic_yes, new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
int confirmId = getArguments().getInt(KEY_CONFIRM_ID);
|
||||
|
||||
+2
-2
@@ -79,12 +79,12 @@ public class EnableSyncDialogFragment extends DialogFragment {
|
||||
@Override
|
||||
public Dialog onCreateDialog(Bundle savedInstanceState) {
|
||||
return new AlertDialog.Builder(fragmentActivity).setMessage(R.string.enable_sync_message)
|
||||
.setNegativeButton(R.string.generic_cancel, new OnClickListener() {
|
||||
.setNegativeButton(R.string.generic_no, new OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
caller.onEnableSyncDone(false);
|
||||
}
|
||||
}).setPositiveButton(R.string.generic_ok, new OnClickListener() {
|
||||
}).setPositiveButton(R.string.generic_yes, new OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
caller.onEnableSyncDone(true);
|
||||
|
||||
+3
-2
@@ -46,8 +46,8 @@ public class InstallEarthDialogFragment extends DialogFragment {
|
||||
fragmentActivity = getActivity();
|
||||
return new AlertDialog.Builder(fragmentActivity)
|
||||
.setMessage(R.string.track_detail_install_earth_message)
|
||||
.setNegativeButton(android.R.string.cancel, null)
|
||||
.setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() {
|
||||
.setNegativeButton(R.string.generic_no, null)
|
||||
.setPositiveButton(R.string.generic_yes, new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
Intent intent = new Intent().setData(Uri.parse(SaveActivity.GOOGLE_EARTH_MARKET_URL));
|
||||
@@ -60,6 +60,7 @@ public class InstallEarthDialogFragment extends DialogFragment {
|
||||
}
|
||||
}
|
||||
})
|
||||
.setTitle(R.string.generic_confirm_title)
|
||||
.create();
|
||||
}
|
||||
}
|
||||
@@ -235,7 +235,7 @@ public class GoogleSettingsActivity extends AbstractSettingsActivity {
|
||||
final String newValue = bundle.getString(ACCOUNT_NAME_KEY);
|
||||
alertDialog.setMessage(
|
||||
getString(R.string.settings_google_account_confirm_message, googleAccount));
|
||||
alertDialog.setButton(AlertDialog.BUTTON_POSITIVE, getString(android.R.string.ok),
|
||||
alertDialog.setButton(AlertDialog.BUTTON_POSITIVE, getString(R.string.generic_yes),
|
||||
new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface d, int button) {
|
||||
|
||||
@@ -61,8 +61,8 @@ public class DialogUtils {
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(context)
|
||||
.setCancelable(true)
|
||||
.setIcon(android.R.drawable.ic_dialog_alert)
|
||||
.setNegativeButton(android.R.string.cancel, cancelListener)
|
||||
.setPositiveButton(android.R.string.ok, okListener)
|
||||
.setNegativeButton(R.string.generic_no, cancelListener)
|
||||
.setPositiveButton(R.string.generic_yes, okListener)
|
||||
.setTitle(R.string.generic_confirm_title);
|
||||
if (messageId != -1) {
|
||||
builder.setMessage(messageId);
|
||||
|
||||
Reference in New Issue
Block a user