From 9c5f136f5b057bfbb070a690ee946b07126a9ef3 Mon Sep 17 00:00:00 2001 From: Alexander Bakker Date: Wed, 15 Jul 2020 13:28:29 +0200 Subject: [PATCH] Make all remaining hardcoded strings translatable I'm pretty sure I got all of them, but it's possible the linter missed some. --- app/src/main/AndroidManifest.xml | 13 +++++++------ .../aegis/ui/PreferencesFragment.java | 9 ++------- .../aegis/ui/views/GroupAdapter.java | 6 +++--- .../aegis/ui/views/GroupHolder.java | 6 +++--- app/src/main/res/layout/card_group.xml | 10 +--------- app/src/main/res/layout/card_slot.xml | 3 +-- app/src/main/res/menu/menu_action_mode.xml | 2 +- app/src/main/res/menu/menu_scanner.xml | 2 +- app/src/main/res/values/strings.xml | 15 ++++++++++++--- 9 files changed, 31 insertions(+), 35 deletions(-) diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 1211a5d1..583a3535 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -29,7 +29,7 @@ android:label="@string/title_activity_about" /> + android:label="@string/title_activity_select_entries" /> @@ -50,25 +50,26 @@ + android:label="@string/title_activity_edit_entry" /> - + android:label="@string/title_activity_manage_slots" /> + android:label="@string/title_activity_manage_groups" /> diff --git a/app/src/main/java/com/beemdevelopment/aegis/ui/PreferencesFragment.java b/app/src/main/java/com/beemdevelopment/aegis/ui/PreferencesFragment.java index 776aaca6..53aab838 100644 --- a/app/src/main/java/com/beemdevelopment/aegis/ui/PreferencesFragment.java +++ b/app/src/main/java/com/beemdevelopment/aegis/ui/PreferencesFragment.java @@ -678,14 +678,9 @@ public class PreferencesFragment extends PreferenceFragmentCompat { }) .setNegativeButton(android.R.string.cancel, null); if (_vault.isEncryptionEnabled()) { - final String[] items = {"Keep the vault encrypted"}; + final String[] items = {getString(R.string.pref_export_keep_encrypted)}; final boolean[] checkedItems = {true}; - builder.setMultiChoiceItems(items, checkedItems, new DialogInterface.OnMultiChoiceClickListener() { - @Override - public void onClick(DialogInterface dialog, int index, boolean isChecked) { - checked.set(isChecked); - } - }); + builder.setMultiChoiceItems(items, checkedItems, (dialog, index, isChecked) -> checked.set(isChecked)); } else { builder.setMessage(R.string.export_warning); } diff --git a/app/src/main/java/com/beemdevelopment/aegis/ui/views/GroupAdapter.java b/app/src/main/java/com/beemdevelopment/aegis/ui/views/GroupAdapter.java index 8aea6075..3d04e3a9 100644 --- a/app/src/main/java/com/beemdevelopment/aegis/ui/views/GroupAdapter.java +++ b/app/src/main/java/com/beemdevelopment/aegis/ui/views/GroupAdapter.java @@ -4,12 +4,12 @@ import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; +import androidx.recyclerview.widget.RecyclerView; + import com.beemdevelopment.aegis.R; import java.util.ArrayList; -import androidx.recyclerview.widget.RecyclerView; - public class GroupAdapter extends RecyclerView.Adapter { private GroupAdapter.Listener _listener; private ArrayList _groups; @@ -38,7 +38,7 @@ public class GroupAdapter extends RecyclerView.Adapter { @Override public GroupHolder onCreateViewHolder(ViewGroup parent, int viewType) { - View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.card_slot, parent, false); + View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.card_group, parent, false); return new GroupHolder(view); } diff --git a/app/src/main/java/com/beemdevelopment/aegis/ui/views/GroupHolder.java b/app/src/main/java/com/beemdevelopment/aegis/ui/views/GroupHolder.java index 436a14fa..ed490500 100644 --- a/app/src/main/java/com/beemdevelopment/aegis/ui/views/GroupHolder.java +++ b/app/src/main/java/com/beemdevelopment/aegis/ui/views/GroupHolder.java @@ -4,17 +4,17 @@ import android.view.View; import android.widget.ImageView; import android.widget.TextView; -import com.beemdevelopment.aegis.R; - import androidx.recyclerview.widget.RecyclerView; +import com.beemdevelopment.aegis.R; + public class GroupHolder extends RecyclerView.ViewHolder { private TextView _slotName; private ImageView _buttonDelete; public GroupHolder(final View view) { super(view); - _slotName = view.findViewById(R.id.text_slot_name); + _slotName = view.findViewById(R.id.text_group_name); _buttonDelete = view.findViewById(R.id.button_delete); } diff --git a/app/src/main/res/layout/card_group.xml b/app/src/main/res/layout/card_group.xml index f44fb884..4bc91f0d 100644 --- a/app/src/main/res/layout/card_group.xml +++ b/app/src/main/res/layout/card_group.xml @@ -28,18 +28,10 @@ android:id="@+id/text_group_name" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:text="Group name" + android:text="@string/group_name_hint" android:textAppearance="?android:attr/textAppearanceMedium" android:textColor="?android:attr/textColorPrimary" /> - - diff --git a/app/src/main/res/layout/card_slot.xml b/app/src/main/res/layout/card_slot.xml index b767bae1..7ac3277d 100644 --- a/app/src/main/res/layout/card_slot.xml +++ b/app/src/main/res/layout/card_slot.xml @@ -34,13 +34,12 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:textAppearance="?android:attr/textAppearanceMedium" - android:text="Slot name" android:id="@+id/text_slot_name" android:textColor="?android:attr/textColorPrimary"/> diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 7d0155e7..461341db 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -45,6 +45,7 @@ Import tokens from an app (requires root access) Export Export the vault + Keep the vault encrypted Password reminder Show a reminder to enter the password every once in a while, so that you don\'t forget it. Screen security @@ -174,6 +175,7 @@ Unlocking the vault Unlocking the vault (repairing) You must have at least one password slot + (this devices) Remove slot Are you sure you want to remove this slot? Remove group @@ -197,7 +199,6 @@ Group name Edit groups Manage and delete your groups here - Settings Search in account names Include account name matches in the search results Highlight tokens when tapped @@ -228,7 +229,6 @@ Lock status Aegis can create a persistent notification to notify you when the vault is locked Vault is unlocked. Tap here to lock. - About Version Changelog What\'s new @@ -253,6 +253,7 @@ Scanned %d/%d QR codes Expected QR code #%d, but scanned #%d instead Vault backup failed recently + Switch camera body { @@ -273,7 +274,6 @@ There are no codes to be shown. Start adding entries by tapping the plus sign in the bottom right corner No entries found Done - Transfer entries %d / %d entries Next Previous @@ -287,4 +287,13 @@ Strong Use PIN keyboard on lockscreen Enable this if you want to enable the PIN keyboard on the lockscreen. This only works for numeric passwords + + Settings + Manage groups + Transfer entries + About + Edit entry + Scan a QR code + Manage key slots + Select entries