vslavik / poedit

Translations editor for Mac, Windows and Unix
https://poedit.net
MIT License
1.79k stars 278 forks source link

False positive with missing space warning #861

Open nkosi23 opened 2 months ago

nkosi23 commented 2 months ago

i've got a warning for the following translation from English to French while everything is actually correct:

Original string:
{VAR_PLURAL, plural, =1 {project} other {projects}}

Translated String:
{VAR_PLURAL, plural, =1 {projet} other {projets}}

image

vslavik commented 2 months ago

This is, I think, unfortunate translation of Placeholder “{project}” is missing from translation.

That it triggers on ICU MessageFormat syntax is unfortunate, but well, that will require proper support for that syntax in Poedit to be handled.

nkosi23 commented 2 months ago

Oh I see, thanks for the insights!

This is indeed an xlf file from an angular project (sorry for not mentioning it) This syntax is needed to pluralize translations, but supporting it may be tricky since any number of cases can be specified: for example:

{VAR_PLURAL, plural, =1 {project} other {projects}}

could also be

{VAR_PLURAL, plural, =1 {project} =2 {large project} =3 {mega project} other {corporate programs}}

However the below seems to be properly supported by poedit as I do not have this warning:

{VAR_SELECT, select, 1 {today } 2 {by the day of delivery } other {no later than {INTERPOLATION} months after delivery }}

So maybe the code handling VAR_SELECT could be reused for the most part.