Clean up and re-organize all strings
This commit is contained in:
parent
c31b8e9c86
commit
0265a069aa
6 changed files with 58 additions and 51 deletions
|
@ -150,8 +150,8 @@ public class EntriesCardAdapter extends RecyclerView.Adapter<EntriesCardAdapter.
|
|||
public void onItemDismiss(final int position) {
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(context);
|
||||
|
||||
builder.setTitle(context.getString(R.string.alert_remove))
|
||||
.setMessage(context.getString(R.string.msg_confirm_delete))
|
||||
builder.setTitle(R.string.dialog_title_remove)
|
||||
.setMessage(R.string.dialog_msg_confirm_delete)
|
||||
.setPositiveButton(android.R.string.yes, new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialogInterface, int i) {
|
||||
|
@ -194,7 +194,7 @@ public class EntriesCardAdapter extends RecyclerView.Adapter<EntriesCardAdapter.
|
|||
input.setLayoutParams(params);
|
||||
container.addView(input);
|
||||
|
||||
builder.setTitle(R.string.alert_rename)
|
||||
builder.setTitle(R.string.dialog_title_rename)
|
||||
.setView(container)
|
||||
.setPositiveButton(R.string.button_save, new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
|
@ -240,10 +240,10 @@ public class EntriesCardAdapter extends RecyclerView.Adapter<EntriesCardAdapter.
|
|||
|
||||
private void copyToClipboard(String text) {
|
||||
ClipboardManager clipboard = (ClipboardManager) context.getSystemService(Context.CLIPBOARD_SERVICE);
|
||||
ClipData clip = ClipData.newPlainText(context.getString(R.string.label_clipboard), text);
|
||||
ClipData clip = ClipData.newPlainText(context.getString(R.string.label_clipboard_content), text);
|
||||
clipboard.setPrimaryClip(clip);
|
||||
|
||||
Toast.makeText(context, R.string.msg_copied_to_clipboard, Toast.LENGTH_LONG).show();
|
||||
Toast.makeText(context, R.string.toast_copied_to_clipboard, Toast.LENGTH_LONG).show();
|
||||
}
|
||||
|
||||
public void setMoveEventCallback(ViewHolderEventCallback cb) {
|
||||
|
|
|
@ -120,11 +120,11 @@ public class MainActivity extends AppCompatActivity {
|
|||
boolean success = DatabaseHelper.exportAsJSON(this, uri);
|
||||
|
||||
if (success)
|
||||
Toast.makeText(this, R.string.msg_export_success, Toast.LENGTH_LONG).show();
|
||||
Toast.makeText(this, R.string.toast_export_success, Toast.LENGTH_LONG).show();
|
||||
else
|
||||
Toast.makeText(this, R.string.msg_export_failed, Toast.LENGTH_LONG).show();
|
||||
Toast.makeText(this, R.string.toast_export_failed, Toast.LENGTH_LONG).show();
|
||||
} else {
|
||||
Toast.makeText(this, R.string.msg_storage_not_accessible, Toast.LENGTH_LONG).show();
|
||||
Toast.makeText(this, R.string.toast_storage_not_accessible, Toast.LENGTH_LONG).show();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -147,8 +147,8 @@ public class MainActivity extends AppCompatActivity {
|
|||
private void exportJSONWithWarning() {
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(this);
|
||||
|
||||
builder.setTitle(R.string.msg_security_warning)
|
||||
.setMessage(R.string.msg_export_warning)
|
||||
builder.setTitle(R.string.dialog_title_security_warning)
|
||||
.setMessage(R.string.dialog_msg_export_warning)
|
||||
.setPositiveButton(android.R.string.yes, new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialogInterface, int i) {
|
||||
|
@ -171,12 +171,12 @@ public class MainActivity extends AppCompatActivity {
|
|||
|
||||
if (success) {
|
||||
adapter.setEntries(DatabaseHelper.load(this));
|
||||
Toast.makeText(this, R.string.msg_import_success, Toast.LENGTH_LONG).show();
|
||||
Toast.makeText(this, R.string.toast_import_success, Toast.LENGTH_LONG).show();
|
||||
} else {
|
||||
Toast.makeText(this, R.string.msg_import_failed, Toast.LENGTH_LONG).show();
|
||||
Toast.makeText(this, R.string.toast_import_failed, Toast.LENGTH_LONG).show();
|
||||
}
|
||||
} else {
|
||||
Toast.makeText(this, R.string.msg_storage_not_accessible, Toast.LENGTH_LONG).show();
|
||||
Toast.makeText(this, R.string.toast_storage_not_accessible, Toast.LENGTH_LONG).show();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -202,13 +202,13 @@ public class MainActivity extends AppCompatActivity {
|
|||
if (grantResults.length > 0 && grantResults[0] == PackageManager.PERMISSION_GRANTED) {
|
||||
exportJSONWithSelector();
|
||||
} else {
|
||||
Toast.makeText(this, R.string.msg_storage_permissions, Toast.LENGTH_LONG).show();
|
||||
Toast.makeText(this, R.string.toast_storage_permissions, Toast.LENGTH_LONG).show();
|
||||
}
|
||||
} else if (requestCode == PERMISSIONS_REQUEST_READ_IMPORT) {
|
||||
if (grantResults.length > 0 && grantResults[0] == PackageManager.PERMISSION_GRANTED) {
|
||||
importJSONWithSelector();
|
||||
} else {
|
||||
Toast.makeText(this, R.string.msg_storage_permissions, Toast.LENGTH_LONG).show();
|
||||
Toast.makeText(this, R.string.toast_storage_permissions, Toast.LENGTH_LONG).show();
|
||||
}
|
||||
} else {
|
||||
super.onRequestPermissionsResult(requestCode, permissions, grantResults);
|
||||
|
@ -331,7 +331,7 @@ public class MainActivity extends AppCompatActivity {
|
|||
|
||||
adapter.notifyDataSetChanged();
|
||||
} catch (Exception e) {
|
||||
Toast.makeText(this, R.string.msg_invalid_qr_code, Toast.LENGTH_LONG).show();
|
||||
Toast.makeText(this, R.string.toast_invalid_qr_code, Toast.LENGTH_LONG).show();
|
||||
}
|
||||
}
|
||||
} else if (requestCode == INTENT_OPEN_DOCUMENT && resultCode == Activity.RESULT_OK) {
|
||||
|
|
|
@ -38,7 +38,7 @@
|
|||
android:layout_marginEnd="@dimen/fab_small_label_offset"
|
||||
android:background="@drawable/shape_fab_label"
|
||||
android:padding="@dimen/fab_small_label_padding"
|
||||
android:text="@string/title_scan_qr"
|
||||
android:text="@string/button_scan_qr"
|
||||
android:textColor="@android:color/white"
|
||||
android:typeface="normal" />
|
||||
|
||||
|
@ -75,7 +75,7 @@
|
|||
android:layout_marginEnd="@dimen/fab_small_label_offset"
|
||||
android:background="@drawable/shape_fab_label"
|
||||
android:padding="@dimen/fab_small_label_padding"
|
||||
android:text="@string/title_enter_details"
|
||||
android:text="@string/button_enter_details"
|
||||
android:textColor="@android:color/white"
|
||||
android:typeface="normal" />
|
||||
|
||||
|
|
|
@ -3,26 +3,26 @@
|
|||
|
||||
<item
|
||||
android:id="@+id/menu_search"
|
||||
android:title="@string/title_search"
|
||||
android:title="@string/menu_main_search"
|
||||
android:icon="@drawable/ic_search_white"
|
||||
app:showAsAction="always|collapseActionView"
|
||||
app:actionViewClass="android.support.v7.widget.SearchView" />
|
||||
|
||||
<item
|
||||
android:id="@+id/submenu_backup"
|
||||
android:title="@string/menu_submenu_backup">
|
||||
android:title="@string/menu_main_submenu_backup">
|
||||
|
||||
<menu>
|
||||
<item
|
||||
android:id="@+id/action_export"
|
||||
android:orderInCategory="100"
|
||||
android:title="@string/menu_export"
|
||||
android:title="@string/menu_main_export"
|
||||
app:showAsAction="never" />
|
||||
|
||||
<item
|
||||
android:id="@+id/action_import"
|
||||
android:orderInCategory="100"
|
||||
android:title="@string/menu_import"
|
||||
android:title="@string/menu_main_import"
|
||||
app:showAsAction="never" />
|
||||
</menu>
|
||||
</item>
|
||||
|
@ -30,6 +30,6 @@
|
|||
<item
|
||||
android:id="@+id/action_about"
|
||||
android:orderInCategory="100"
|
||||
android:title="@string/menu_about"
|
||||
android:title="@string/menu_main_about"
|
||||
app:showAsAction="never" />
|
||||
</menu>
|
||||
|
|
|
@ -3,10 +3,10 @@
|
|||
|
||||
<item
|
||||
android:id="@+id/menu_popup_editLabel"
|
||||
android:title="@string/menu_edit_label" />
|
||||
android:title="@string/menu_popup_edit_label" />
|
||||
|
||||
<item
|
||||
android:id="@+id/menu_popup_remove"
|
||||
android:title="@string/alert_remove" />
|
||||
android:title="@string/menu_popup_remove" />
|
||||
|
||||
</menu>
|
|
@ -2,40 +2,47 @@
|
|||
<string name="app_name">andOTP</string>
|
||||
<string name="app_launcher">OTP Authenticator</string>
|
||||
|
||||
<string name="alert_remove">Remove</string>
|
||||
<string name="alert_rename">Rename</string>
|
||||
|
||||
<!-- Buttons -->
|
||||
<string name="button_enter_details">Enter details</string>
|
||||
<string name="button_scan_qr">Scan QR-Code</string>
|
||||
<string name="button_save">Save</string>
|
||||
|
||||
<!-- Custom formatting -->
|
||||
<string name="format_custom_period">%d s</string>
|
||||
|
||||
<string name="label_clipboard" translatable="false">OTP Token</string>
|
||||
<!-- Labels -->
|
||||
<string name="label_clipboard_content" translatable="false">OTP Token</string>
|
||||
<string name="label_tap_to_reveal">Tap to reveal</string>
|
||||
|
||||
<string name="menu_about">About</string>
|
||||
<string name="menu_edit_label">Edit label</string>
|
||||
<string name="menu_export">Export (JSON)</string>
|
||||
<string name="menu_import">Import (JSON)</string>
|
||||
<string name="menu_submenu_backup">Import / Export</string>
|
||||
<!-- Menu -->
|
||||
<string name="menu_main_about">About</string>
|
||||
<string name="menu_main_export">Export (JSON)</string>
|
||||
<string name="menu_main_import">Import (JSON)</string>
|
||||
<string name="menu_main_search">Search</string>
|
||||
<string name="menu_main_submenu_backup">Import / Export</string>
|
||||
|
||||
<string name="msg_camera_permission">Camera permission not granted</string>
|
||||
<string name="msg_confirm_delete">Are you sure you want do remove this account?</string>
|
||||
<string name="msg_copied_to_clipboard">Copied to clipboard</string>
|
||||
<string name="msg_export_success">Export to external storage successful</string>
|
||||
<string name="msg_export_failed">Export to external storage failed</string>
|
||||
<string name="msg_export_warning">Do you really want to export the database as plain-text JSON
|
||||
file? This file contains all your secret keys, please <b>keep it safe</b>!
|
||||
<string name="menu_popup_edit_label">Edit label</string>
|
||||
<string name="menu_popup_remove">Remove</string>
|
||||
|
||||
<!-- Toast messages -->
|
||||
<string name="toast_copied_to_clipboard">Copied to clipboard</string>
|
||||
<string name="toast_export_success">Export to external storage successful</string>
|
||||
<string name="toast_export_failed">Export to external storage failed</string>
|
||||
<string name="toast_import_success">Import from external storage successful</string>
|
||||
<string name="toast_import_failed">Import from external storage failed</string>
|
||||
<string name="toast_invalid_qr_code">Invalid QR Code</string>
|
||||
<string name="toast_storage_not_accessible">External storage currently not accessible</string>
|
||||
<string name="toast_storage_permissions">Storage permissions not granted</string>
|
||||
|
||||
<!-- Dialogs -->
|
||||
<string name="dialog_title_remove">Remove</string>
|
||||
<string name="dialog_title_rename">Rename</string>
|
||||
<string name="dialog_title_security_warning">Security warning</string>
|
||||
|
||||
<string name="dialog_msg_confirm_delete">Are you sure you want do remove this account?</string>
|
||||
<string name="dialog_msg_export_warning">Do you really want to export the database as plain-text
|
||||
JSON file? This file contains all your secret keys, please <b>keep it safe</b>!
|
||||
</string>
|
||||
<string name="msg_import_success">Import from external storage successful</string>
|
||||
<string name="msg_import_failed">Import from external storage failed</string>
|
||||
<string name="msg_invalid_qr_code">Invalid QR Code</string>
|
||||
<string name="msg_security_warning">Security warning</string>
|
||||
<string name="msg_storage_not_accessible">External storage currently not accessible</string>
|
||||
<string name="msg_storage_permissions">Storage permissions not granted</string>
|
||||
|
||||
<string name="title_enter_details">Enter details</string>
|
||||
<string name="title_scan_qr">Scan QR-Code</string>
|
||||
<string name="title_search">Search</string>
|
||||
|
||||
<!-- About dialog -->
|
||||
<string name="about_description">
|
||||
|
|
Loading…
Reference in a new issue