Browse Source

Localize folder type

main
M66B 6 years ago
parent
commit
f67f822267
2 changed files with 13 additions and 2 deletions
  1. +9
    -2
      app/src/main/java/eu/faircode/email/AdapterFolder.java
  2. +4
    -0
      app/src/main/res/values/strings.xml

+ 9
- 2
app/src/main/java/eu/faircode/email/AdapterFolder.java View File

@ -224,13 +224,20 @@ public class AdapterFolder extends RecyclerView.Adapter<AdapterFolder.ViewHolder
holder.tvName.setText(context.getString(R.string.title_folder_unseen, name, folder.unseen)); holder.tvName.setText(context.getString(R.string.title_folder_unseen, name, folder.unseen));
else else
holder.tvName.setText(name); holder.tvName.setText(name);
holder.tvName.setTypeface(null, folder.unseen > 0 ? Typeface.BOLD : Typeface.NORMAL); holder.tvName.setTypeface(null, folder.unseen > 0 ? Typeface.BOLD : Typeface.NORMAL);
holder.tvAfter.setText(Integer.toString(folder.after)); holder.tvAfter.setText(Integer.toString(folder.after));
holder.tvAfter.setVisibility(folder.synchronize ? View.VISIBLE : View.INVISIBLE); holder.tvAfter.setVisibility(folder.synchronize ? View.VISIBLE : View.INVISIBLE);
holder.ivSync.setVisibility(folder.synchronize ? View.VISIBLE : View.INVISIBLE); holder.ivSync.setVisibility(folder.synchronize ? View.VISIBLE : View.INVISIBLE);
holder.tvCount.setText(Integer.toString(folder.messages)); holder.tvCount.setText(Integer.toString(folder.messages));
holder.tvType.setText(folder.type);
int resid = context.getResources().getIdentifier(
"title_folder_" + folder.type.toLowerCase(),
"string",
context.getPackageName());
holder.tvType.setText(resid > 0 ? context.getString(resid) : folder.type);
holder.tvAccount.setText(folder.accountName); holder.tvAccount.setText(folder.accountName);
holder.wire(); holder.wire();


+ 4
- 0
app/src/main/res/values/strings.xml View File

@ -68,8 +68,12 @@
<string name="title_folder_unified">Unified inbox</string> <string name="title_folder_unified">Unified inbox</string>
<string name="title_folder_inbox">Inbox</string> <string name="title_folder_inbox">Inbox</string>
<string name="title_folder_outbox">Outbox</string> <string name="title_folder_outbox">Outbox</string>
<string name="title_folder_all">Archive</string>
<string name="title_folder_drafts">Drafts</string> <string name="title_folder_drafts">Drafts</string>
<string name="title_folder_trash">Trash</string>
<string name="title_folder_junk">Spam</string>
<string name="title_folder_sent">Sent</string> <string name="title_folder_sent">Sent</string>
<string name="title_folder_user">User</string>
<string name="title_folder_thread">Message thread</string> <string name="title_folder_thread">Message thread</string>
<string name="title_no_messages">No messages</string> <string name="title_no_messages">No messages</string>


Loading…
Cancel
Save