Make all remaining hardcoded strings translatable

I'm pretty sure I got all of them, but it's possible the linter missed some.
This commit is contained in:
Alexander Bakker 2020-07-15 13:28:29 +02:00
parent 8c34ce8f38
commit 9c5f136f5b
9 changed files with 31 additions and 35 deletions

View file

@ -29,7 +29,7 @@
android:label="@string/title_activity_about" />
<activity
android:name=".ui.SelectEntriesActivity"
android:label="Select entries" />
android:label="@string/title_activity_select_entries" />
<activity
android:name=".ui.MainActivity"
android:label="${title}">
@ -50,25 +50,26 @@
<activity
android:name=".ui.ScannerActivity"
android:configChanges="keyboardHidden|orientation|screenSize"
android:label="Scan a QR code"
android:label="@string/title_activity_scan_qr"
android:screenOrientation="portrait" />
<activity
android:name=".ui.EditEntryActivity"
android:label="Edit entry" />
android:label="@string/title_activity_edit_entry" />
<activity
android:name=".ui.IntroActivity"
android:theme="@style/Theme.Intro" />
<activity android:name=".ui.AuthActivity"
<activity
android:name=".ui.AuthActivity"
android:theme="@style/AppTheme.NoActionBar" />
<activity
android:name=".ui.PreferencesActivity"
android:label="@string/title_activity_preferences" />
<activity
android:name=".ui.SlotManagerActivity"
android:label="Manage key slots" />
android:label="@string/title_activity_manage_slots" />
<activity
android:name=".ui.GroupManagerActivity"
android:label="Manage groups" />
android:label="@string/title_activity_manage_groups" />
<service android:name=".services.NotificationService" />
</application>

View file

@ -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);
}

View file

@ -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<GroupHolder> {
private GroupAdapter.Listener _listener;
private ArrayList<String> _groups;
@ -38,7 +38,7 @@ public class GroupAdapter extends RecyclerView.Adapter<GroupHolder> {
@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);
}

View file

@ -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);
}

View file

@ -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" />
<TextView
android:id="@+id/text_slot_used"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="5dp"
android:text="... entries"
android:visibility="visible" />
</LinearLayout>
</LinearLayout>

View file

@ -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"/>
<TextView
android:id="@+id/text_slot_used"
android:text="(this device)"
android:text="@string/slot_this_device"
android:visibility="gone"
android:layout_marginStart="5dp"
android:layout_width="wrap_content"

View file

@ -12,7 +12,7 @@
android:id="@+id/action_edit"
android:orderInCategory="90"
android:icon="@drawable/ic_mode_edit"
android:title="Edit"
android:title="@string/edit"
app:showAsAction="always" />
<item

View file

@ -7,7 +7,7 @@
<item
android:id="@+id/action_camera"
android:icon="@drawable/ic_camera_front_24dp"
android:title="Switch camera"
android:title="@string/switch_camera"
app:showAsAction="always"/>
</menu>

View file

@ -45,6 +45,7 @@
<string name="pref_import_app_summary">Import tokens from an app (requires root access)</string>
<string name="pref_export_title">Export</string>
<string name="pref_export_summary">Export the vault</string>
<string name="pref_export_keep_encrypted">Keep the vault encrypted</string>
<string name="pref_password_reminder_title">Password reminder</string>
<string name="pref_password_reminder_summary">Show a reminder to enter the password every once in a while, so that you don\'t forget it.</string>
<string name="pref_secure_screen_title">Screen security</string>
@ -174,6 +175,7 @@
<string name="unlocking_vault">Unlocking the vault</string>
<string name="unlocking_vault_repair">Unlocking the vault (repairing)</string>
<string name="password_slot_error">You must have at least one password slot</string>
<string name="slot_this_device">(this devices)</string>
<string name="remove_slot">Remove slot</string>
<string name="remove_slot_description">Are you sure you want to remove this slot?</string>
<string name="remove_group">Remove group</string>
@ -197,7 +199,6 @@
<string name="group_name_hint">Group name</string>
<string name="preference_manage_groups">Edit groups</string>
<string name="preference_manage_groups_summary">Manage and delete your groups here</string>
<string name="title_activity_preferences">Settings</string>
<string name="pref_search_name_title">Search in account names</string>
<string name="pref_search_name_summary">Include account name matches in the search results</string>
<string name="pref_highlight_entry_title">Highlight tokens when tapped</string>
@ -228,7 +229,6 @@
<string name="channel_name_lock_status">Lock status</string>
<string name="channel_description_lock_status">Aegis can create a persistent notification to notify you when the vault is locked</string>
<string name="vault_unlocked_state">Vault is unlocked. Tap here to lock.</string>
<string name="title_activity_about">About</string>
<string name="version">Version</string>
<string name="changelog">Changelog</string>
<string name="whats_new">What\'s new</string>
@ -253,6 +253,7 @@
<string name="google_qr_export_scanned">Scanned %d/%d QR codes</string>
<string name="google_qr_export_unexpected">Expected QR code #%d, but scanned #%d instead</string>
<string name="backup_error_bar_message"><b>Vault backup failed recently</b></string>
<string name="switch_camera">Switch camera</string>
<string name="custom_notices_format_style" translatable="false" >
body {
@ -273,7 +274,6 @@
<string name="empty_list">There are no codes to be shown. Start adding entries by tapping the plus sign in the bottom right corner</string>
<string name="empty_list_title">No entries found</string>
<string name="done">Done</string>
<string name="title_activity_transfer">Transfer entries</string>
<string name="entries_count">%d / %d entries</string>
<string name="next">Next</string>
<string name="previous">Previous</string>
@ -287,4 +287,13 @@
<string name="password_strength_strong">Strong</string>
<string name="pref_pin_keyboard_title">Use PIN keyboard on lockscreen</string>
<string name="pref_pin_keyboard_summary">Enable this if you want to enable the PIN keyboard on the lockscreen. This only works for numeric passwords</string>
<string name="title_activity_preferences">Settings</string>
<string name="title_activity_manage_groups">Manage groups</string>
<string name="title_activity_transfer">Transfer entries</string>
<string name="title_activity_about">About</string>
<string name="title_activity_edit_entry">Edit entry</string>
<string name="title_activity_scan_qr">Scan a QR code</string>
<string name="title_activity_manage_slots">Manage key slots</string>
<string name="title_activity_select_entries">Select entries</string>
</resources>