WordPress.org

Ready to get started?Download WordPress

Forums

Translation duplicate plural and non-plural msg_id (2 posts)

  1. ianhaycox
    Member
    Posted 2 years ago #

    Hi,

    I have a problem generating a .POT file with duplicate plural and non-plural forms. For example,

    $n = 0;
    _e('times', MY_TD);               // happened 6 times
    _n( 'Time', 'Times', $n, MY_TD ); // once or multiple times
    _e('Time', MY_TD);                // the time, e.g. 12:30

    After generating the .POT with
    makepot wp-plugin ...

    the singular form of 'Time' is not present: I get,

    msgid "times"
    msgstr ""
    
    msgid "Time"
    msgid_plural "Times"
    msgstr[0] ""
    msgstr[1] ""

    In some languages the translation of noun Time and verb Time are different.

    Manually adding to the .pot file an extra msg_id 'Time' signals a fatal error with PoEdit.

    Any ideas, workarounds

  2. ianhaycox
    Member
    Posted 2 years ago #

    sprintf(_n( '%d Time', '%d Times', $n, MY_TD ), $n)

    Doh - no duplicate now !

Topic Closed

This topic has been closed to new replies.

About this Topic