Localization: Add pluralization to some strings (#5526)

This commit is contained in:
zubiden 2025-01-22 23:01:24 +01:00 committed by Alexander Zinchuk
parent 5b04aff397
commit 5e7c38bb33
3 changed files with 15 additions and 13 deletions

View File

@ -1455,13 +1455,14 @@
"StarsReactionLink" = "https://telegram.org/tos/stars";
"MiniAppsMoreTabs_one" = "{botName} & {count} Other";
"MiniAppsMoreTabs_other" = "{botName} & {count} Others";
"PrizeCredits" = "Your prize is {count} Stars.";
"PrizeCredits2_one" = "Your prize is {count} Star.";
"PrizeCredits2_other" = "Your prize is {count} Stars.";
"ActionStarGiftTitle" = "{user} sent you a Gift for {count} Stars";
"ActionStarGiftOutTitle" = "You have sent a gift for {count} Stars";
"ActionStarGiftOutDescription_one" = "{user} can display this gift on their profile or convert it to {count} Star.";
"ActionStarGiftOutDescription_other" = "{user} can display this gift on their profile or convert it to {count} Stars.";
"ActionStarGiftDescription_one" = "Add this gift to your profile or convert it to {count} Star.";
"ActionStarGiftDescription_other" = "Add this gift to your profile or convert it to {count} Stars.";
"ActionStarGiftOutDescription2_one" = "{user} can display this gift on their profile or convert it to {count} Star.";
"ActionStarGiftOutDescription2_other" = "{user} can display this gift on their profile or convert it to {count} Stars.";
"ActionStarGiftDescription2_one" = "Add this gift to your profile or convert it to {count} Star.";
"ActionStarGiftDescription2_other" = "Add this gift to your profile or convert it to {count} Stars.";
"ActionStarGiftDisplaying" = "You kept this gift on your profile.";
"ActionStarGiftOutDescriptionUpgrade" = "{user} can turn this gift to a unique collectible.";
"ActionStarGiftDescriptionUpgrade" = "Tap “Unpack” to turn this gift to a unique collectible.";

View File

@ -451,7 +451,7 @@ const ActionMessage: FC<OwnProps & StateProps> = ({
if (message.isOutgoing) {
if (amountToConvert) {
return lang('ActionStarGiftOutDescription', {
return lang('ActionStarGiftOutDescription2', {
user: targetUser || 'User',
count: amountToConvert,
}, { withNodes: true, pluralValue: amountToConvert });
@ -484,7 +484,7 @@ const ActionMessage: FC<OwnProps & StateProps> = ({
}
if (amountToConvert) {
return lang('ActionStarGiftDescription', {
return lang('ActionStarGiftDescription2', {
count: amountToConvert,
}, { withNodes: true, pluralValue: amountToConvert });
}
@ -638,12 +638,13 @@ const ActionMessage: FC<OwnProps & StateProps> = ({
</span>
<span className="action-message-subtitle">
{renderText(lang(
'PrizeCredits', {
'PrizeCredits2', {
count: (
<b>{formatInteger(message.content.action?.stars!)}</b>
),
}, {
withNodes: true,
pluralValue: message.content.action?.stars!,
},
), ['simple_markdown'])}
</span>

View File

@ -1703,9 +1703,6 @@ export interface LangPairWithVariables<V extends unknown = LangVariable> {
'StarsReactionTerms': {
'link': V;
};
'PrizeCredits': {
'count': V;
};
'ActionStarGiftTitle': {
'user': V;
'count': V;
@ -1952,11 +1949,14 @@ export interface LangPairPluralWithVariables<V extends unknown = LangVariable> {
'botName': V;
'count': V;
};
'ActionStarGiftOutDescription': {
'PrizeCredits2': {
'count': V;
};
'ActionStarGiftOutDescription2': {
'user': V;
'count': V;
};
'ActionStarGiftDescription': {
'ActionStarGiftDescription2': {
'count': V;
};
'StarsSubscribeText': {