Warnings on translations with plural form

  • Hello,
    I am unable to translate few phrases in Bosnian. For example, phrase
    Post permanently deleted. (singular)
    %s posts permanently deleted. (plural)

    I get a warning “Missing %s placeholder in translation.” when I translate singular form as it is (without %s) but when I add %s I get “Extra %s placeholder in translation.”

  • @kenan3008:
    Fyi., both examples have been translated and work fine in Greek polytonic.
    Do you get similar problems elsewhere?

  • Yes, basically all strings with plural forms (three plurals for Bosnian) that don’t have %s in singular have this problem.

    Here is a screen shot:
    http://img32.imageshack.us/img32/6589/slikajr.png

  • I think the problem lies here: http://trac.glotpress.org/ticket/59 . I’ll let you know once it’s sorted. Thanks.

  • And committed http://trac.glotpress.org/changeset/423 . Let me know if it’s working now. Thanks.

  • Same as before. It think that there should be %s in singular like this:

    %s comment permanently deleted
    %s comments permanently deleted

    As you can see, there are three fields for the following numbers:

    Form 0 for 1, 21, 31, 41, 51, 61…
    Form 1 for 2, 3, 4, 22, 23, 24…
    Form 2 for 5, 6, 7, 8, 9, 10…

    I think that, if you don’t have %s in the first field, numbers 1,21,31,… won’t be displayed. I had to add %s in all strings for Form 0 in the bs.wordpress.org translation (http://svn.automattic.com/wordpress-i18n/bs_BA/tags/2.9.2/messages/bs_BA.po) because I was getting the same error in Poedit as in GlotPress (plural form at bs.wordpress.org is with || ).

  • …I was getting the same error in Poedit as in GlotPress…

    Does that mean that there’s something wrong with the plurals definition? I.e:

    (n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2)

    How is it defined in your PoEdit?

  • The definition is the same:
    nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);

    I have posted a link to the po file of version 2.9.2 above.

    As you know, in English, plural form is much simpler. You have one string for singular, and all plurals are with an “s” at the end. Because of that, you don’t need %s in singular form for English. But then again, in some plural strings you still have %s in singular, for example:

    #: wp-admin/edit-pages.php:160
    #, php-format
    msgid “%s page not updated, somebody is editing it.”
    msgid_plural “%s pages not updated, somebody is editing them.”
    msgstr[0] “%s stranica nije ažurirana, neko je uređuje.”
    msgstr[1] “%s stranice nisu ažurirane, neko ih uređuje.”
    msgstr[2] “%s stranica nije ažurirano, neko ih uređuje.”

    I checked my assumption stated above that without %s numbers 1,21,31 won’t be displayed and it is correct.
    I have used this string for testing:

    #: wp-admin/edit-pages.php:168
    #, php-format
    msgid “Page moved to the trash.”
    msgid_plural “%s pages moved to the trash.”
    msgstr[0] “%s stranica je premještena u smeće.”
    msgstr[1] “%s stranice su premještene u smeće”
    msgstr[2] “%s stranica je premješteno u smeće”

    Here are the screen shots.
    21 pages deleted (without %s in form 0), there is no number of deleted pages in the yellow warning:
    http://img704.imageshack.us/img704/2686/test1r.png

    21 pages deleted (with %s in form 0), everything fine in yellow warning:
    http://img715.imageshack.us/img715/4323/test2e.png

    4 pages deleted (form 1):
    http://img717.imageshack.us/img717/5411/test3w.png

    7 pages deleted (form 2):
    http://img695.imageshack.us/img695/6679/test4k.png

    You should add %s in singular for strings like this just like in example with “page not updated” at the top of this message. No harm done to English or any other language and you will correct the error for all languages that are using plural form similar to mine.

  • This is either still not solved or we have a different problem with Serbian locale. Issues I described here are still applied, even though I had 3 deployments since this changeset.

    Could you please check it?

    (btw, administrative pages My Profile, Typekit Fonts, OpenID (and other OpenID related stuff) are not internationalized so we can’t translate them; plus, on locale search pages translations are not applied; please check this too)

  • Could you please deploy Serbian translation for wpcom and gravatar since I belive issue described above should be solved now in [493]?

    Thanks

  • Deployed (and congratulations! 920 untranslated out of 9323!)

  • Thank you, but on gravatar new translation still isn’t in use so please check it.

    And I could tell that issue with Serbian was definitely solved with [493].

    congratulations! 920 untranslated out of 9323!

    If you could finally answer me this question I would be very close to finishing whole translation ;)

  • Gravatar is not “deployed” actually, it is used directly on Gravatar’s site when they choose to do so.

    As far as Post Ratings is concerned, those strings are not used on the bulk of WordPress.com, just for some VIP installs.

  • Gravatar is not “deployed” actually, it is used directly on Gravatar’s site when they choose to do so.

    Then you should have a better process since it is too long (16 days since I finished translating).

    As far as Post Ratings is concerned, those strings are not used on the bulk of WordPress.com, just for some VIP installs.

    Thank you.

  • @miladin: we’re still getting the process of automating deployment for translations on Gravatar set up. The plan is to have them deploy automatically like on WordPress.com, but this requires some development and configuration time which we haven’t had just yet. We’ll try to get things deployed as soon as we can, but I’m sure you understand.

  • Thank you for reply, Beau. I understand, but you should explained this at the beginning so that we have a clear situation from start. I’m not only one who is asking about this.

  • The topic ‘Warnings on translations with plural form’ is closed to new replies.