Using plural with multiple parameters

More
7 years 2 weeks ago #2636 by Unitybear
Hey

I just downloaded the new version with plural support and was trying to implement it. I just wanted to be sure if I was running into a limitation or if there's another way to do it.

I have a label like so: You got X in Y tries

This would then have the following keys in English:
You got X in Plural tries
You got X in Singular try
You got X in Zero tries

Now given that X can be a singular or plural number will both X and Y have to be singular for it to be registered as singular?

Please Log in or Create an account to join the conversation.

More
7 years 2 weeks ago #2637 by Frank
Hi,
Because of how many combinations can be to correctly handling plurals for several parameters (e.g. You got X (POINT/POINTS) in Y (TRY/TRIES)), the plugin is currently only using the first parameter to determine the plural type.
So, in your case, if you X is plural, you will get 'You got X in Y tries', and 'You got X in Y try' if X is singular, no matter whatever Y is plural or singular.

If you instead want to handle plurals just for the Y and ignore the X, you will have to use a localization callback .

Just make Y the only parameter, and then replace X in your callback.

For example, the translation will be 'You got <X> in {[Y]} tries".
When translating that, the plugin will replace {[Y]} automatically, and then will call the Callback, where you can do:
mainTranslation.Replace("<X>", 5);

Hope that helps,
Frank

Are you :-) Give I2L 5 stars!
Are you :-( Please lets us know how to improve it!
To get the betas as soon as they are ready, check this out

Please Log in or Create an account to join the conversation.

More
7 years 1 week ago #2638 by Unitybear
Hey

Yeah, just wanted to make sure.

Thanks

Please Log in or Create an account to join the conversation.

Time to create page: 0.148 seconds
Template by JoomlaShine