mirror of
https://github.com/M66B/FairEmail.git
synced 2025-01-01 04:35:57 +00:00
I18N of counts
This commit is contained in:
parent
7364b97cb7
commit
c4961ce7d2
4 changed files with 23 additions and 16 deletions
|
@ -315,15 +315,16 @@ public class ActivityView extends ActivityBilling implements FragmentManager.OnB
|
|||
List<DrawerItem> items = new ArrayList<>();
|
||||
|
||||
for (TupleAccountEx account : accounts) {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append(account.name);
|
||||
String title;
|
||||
if (account.unseen > 0)
|
||||
sb.append(" (").append(nf.format(account.unseen)).append(")");
|
||||
title = getString(R.string.title_name_count, account.name, nf.format(account.unseen));
|
||||
else
|
||||
title = account.name;
|
||||
items.add(new DrawerItem(account.id,
|
||||
"connected".equals(account.state)
|
||||
? account.primary ? R.drawable.baseline_folder_special_24 : R.drawable.baseline_folder_24
|
||||
: R.drawable.baseline_folder_open_24,
|
||||
account.color, sb.toString(), account.unseen > 0));
|
||||
account.color, title, account.unseen > 0));
|
||||
}
|
||||
|
||||
items.add(new DrawerItem(-1));
|
||||
|
|
|
@ -164,11 +164,13 @@ public class AdapterFolder extends RecyclerView.Adapter<AdapterFolder.ViewHolder
|
|||
|
||||
ivNotify.setVisibility(folder.notify ? View.VISIBLE : View.GONE);
|
||||
|
||||
StringBuilder n = new StringBuilder();
|
||||
n.append(folder.getDisplayName(context));
|
||||
if (folder.unseen > 0)
|
||||
n.append(" (").append(nf.format(folder.unseen)).append(")");
|
||||
tvName.setText(n.toString());
|
||||
tvName.setText(context.getString(R.string.title_name_count,
|
||||
folder.getDisplayName(context),
|
||||
nf.format(folder.unseen)));
|
||||
else
|
||||
tvName.setText(folder.getDisplayName(context));
|
||||
|
||||
tvName.setTypeface(null, folder.unseen > 0 ? Typeface.BOLD : Typeface.NORMAL);
|
||||
tvName.setTextColor(folder.unseen > 0 ? colorUnread : textColorSecondary);
|
||||
|
||||
|
|
|
@ -1547,11 +1547,12 @@ public class FragmentMessages extends FragmentBase {
|
|||
errors = true;
|
||||
}
|
||||
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append(getString(R.string.title_folder_unified));
|
||||
if (unseen > 0)
|
||||
sb.append(" (").append(nf.format(unseen)).append(")");
|
||||
setSubtitle(sb.toString());
|
||||
setSubtitle(getString(R.string.title_name_count,
|
||||
getString(R.string.title_folder_unified),
|
||||
nf.format(unseen)));
|
||||
else
|
||||
setSubtitle(getString(R.string.title_folder_unified));
|
||||
|
||||
boolean refreshing = false;
|
||||
for (TupleFolderEx folder : folders)
|
||||
|
@ -1583,11 +1584,12 @@ public class FragmentMessages extends FragmentBase {
|
|||
if (folder == null)
|
||||
setSubtitle(null);
|
||||
else {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append(folder.getDisplayName(getContext()));
|
||||
if (folder.unseen > 0)
|
||||
sb.append(" (").append(nf.format(folder.unseen)).append(")");
|
||||
setSubtitle(sb.toString());
|
||||
setSubtitle(getString(R.string.title_name_count,
|
||||
folder.getDisplayName(getContext()),
|
||||
nf.format(folder.unseen)));
|
||||
else
|
||||
setSubtitle(folder.getDisplayName(getContext()));
|
||||
|
||||
boolean outbox = EntityFolder.OUTBOX.equals(folder.type);
|
||||
if (FragmentMessages.this.outbox != outbox) {
|
||||
|
|
|
@ -62,6 +62,8 @@
|
|||
<string name="title_notification_sending">Sending messages</string>
|
||||
<string name="title_notification_failed">\'%1$s\' failed</string>
|
||||
|
||||
<string name="title_name_count">%1$s (%2$s)</string>
|
||||
|
||||
<string name="menu_answers">Templates</string>
|
||||
<string name="menu_operations">Operations</string>
|
||||
<string name="menu_setup">Setup</string>
|
||||
|
|
Loading…
Reference in a new issue