mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-04-22 01:40:07 +01:00
Improve translations with pluralized string resources.
This commit is contained in:
@@ -131,7 +131,7 @@ class PrivacySettingsFragment : DSLSettingsFragment(R.string.preferences__privac
|
||||
|
||||
clickPref(
|
||||
title = DSLSettingsText.from(R.string.PrivacySettingsFragment__blocked),
|
||||
summary = DSLSettingsText.from(getString(R.string.PrivacySettingsFragment__d_contacts, state.blockedCount)),
|
||||
summary = DSLSettingsText.from(resources.getQuantityString(R.plurals.PrivacySettingsFragment__d_contacts, state.blockedCount, state.blockedCount)),
|
||||
onClick = {
|
||||
Navigation.findNavController(requireView())
|
||||
.safeNavigate(R.id.action_privacySettingsFragment_to_blockedUsersActivity)
|
||||
|
||||
@@ -11,6 +11,7 @@ import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.annotation.PluralsRes;
|
||||
import androidx.annotation.StringRes;
|
||||
|
||||
import org.thoughtcrime.securesms.R;
|
||||
@@ -141,7 +142,7 @@ public class CallParticipantsListUpdatePopupWindow extends PopupWindow {
|
||||
description = context.getString(getThreeMemberDescriptionResourceId(isAdded), getNextDisplayName(iterator), getNextDisplayName(iterator), getNextDisplayName(iterator));
|
||||
break;
|
||||
default:
|
||||
description = context.getString(getManyMemberDescriptionResourceId(isAdded), getNextDisplayName(iterator), getNextDisplayName(iterator), recipients.size() - 2);
|
||||
description = context.getResources().getQuantityString(getManyMemberDescriptionResourceId(isAdded), recipients.size() - 2, getNextDisplayName(iterator), getNextDisplayName(iterator), recipients.size() - 2);
|
||||
}
|
||||
|
||||
descriptionTextView.setText(description);
|
||||
@@ -181,11 +182,11 @@ public class CallParticipantsListUpdatePopupWindow extends PopupWindow {
|
||||
}
|
||||
}
|
||||
|
||||
private static @StringRes int getManyMemberDescriptionResourceId(boolean isAdded) {
|
||||
private static @PluralsRes int getManyMemberDescriptionResourceId(boolean isAdded) {
|
||||
if (isAdded) {
|
||||
return R.string.CallParticipantsListUpdatePopupWindow__s_s_and_d_others_joined;
|
||||
return R.plurals.CallParticipantsListUpdatePopupWindow__s_s_and_d_others_joined;
|
||||
} else {
|
||||
return R.string.CallParticipantsListUpdatePopupWindow__s_s_and_d_others_left;
|
||||
return R.plurals.CallParticipantsListUpdatePopupWindow__s_s_and_d_others_left;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user