Rewrite more plural handling of 'Days'

This commit is contained in:
Dr. Tobias Quathamer
2017-02-09 10:03:45 +01:00
parent 1123f03134
commit fa2ffbd70f
2 changed files with 3 additions and 2 deletions
@@ -678,7 +678,7 @@ public class PasscodeActivity extends BaseFragment implements NotificationCenter
} else if (UserConfig.autoLockIn < 60 * 60 * 24) {
val = ApplicationLoader.applicationContext.getResources().getQuantityString(R.plurals.Hours, (int) Math.ceil(UserConfig.autoLockIn / 60.0f / 60), (int) Math.ceil(UserConfig.autoLockIn / 60.0f / 60));
} else {
val = LocaleController.formatString("AutoLockInTime", R.string.AutoLockInTime, LocaleController.formatPluralString("Days", (int) Math.ceil(UserConfig.autoLockIn / 60.0f / 60 / 24)));
val = ApplicationLoader.applicationContext.getResources().getQuantityString(R.plurals.Days, (int) Math.ceil(UserConfig.autoLockIn / 60.0f / 60 / 24), (int) Math.ceil(UserConfig.autoLockIn / 60.0f / 60 / 24));
}
textCell.setTextAndValue(LocaleController.getString("AutoLock", R.string.AutoLock), val, true);
textCell.setTextColor(0xff000000);
@@ -589,7 +589,8 @@ public class ProfileNotificationsActivity extends BaseFragment implements Notifi
// @TODO: Maybe this should be reworded a bit.
val = mContext.getResources().getQuantityString(R.plurals.Hours, (int) Math.ceil(delta / 60.0f / 60), (int) Math.ceil(delta / 60.0f / 60));
} else if (delta < 60 * 60 * 24 * 365) {
val = LocaleController.formatString("WillUnmuteIn", R.string.WillUnmuteIn, LocaleController.formatPluralString("Days", (int) Math.ceil(delta / 60.0f / 60 / 24)));
// @TODO: Maybe this should be reworded a bit.
val = mContext.getResources().getQuantityString(R.plurals.Days, (int) Math.ceil(delta / 60.0f / 60 / 24), (int) Math.ceil(delta / 60.0f / 60 / 24));
} else {
val = null;
}