WordPress.org

Support

Support » Plugins and Hacks » [Plugin: WP-UserOnline] Translation not working

[Plugin: WP-UserOnline] Translation not working

  • As already written in an email – the translation (German)of WP-UserOnline didn’t work in my WordPress 2.9.2 configuration.

    After adding the following lines in the file wp-useronline.php it works.

    if (function_exists('load_plugin_textdomain'))
        load_plugin_textdomain('wp-useronline', false, dirname(plugin_basename(__FILE__)) . '/lang');

    But also the plural forms in the language po/pot files were not correctly formated – after generating a new pot file with PoEdit and fixing the plural definition the translation works now.

    http://wordpress.org/extend/plugins/wp-useronline/

Viewing 6 replies - 1 through 6 (of 6 total)
  • Included the textdomain loading fix:

    http://plugins.trac.wordpress.org/changeset/240575/wp-useronline

    Thanks.

    As for the plural forms, each language can have a different plural definition, so that’s something you should change in the .po file.

    But in the setup description it should be mentioned that the plural from in the pot file must be entered:

    "Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n"

    should be for German eg.

    "Plural-Forms: nplurals=2; plural=n != 1;\n"

    Besides that in the recent pot file there are some errors:

    #: admin.php:24
    #, php-format
    msgid "There is <strong><a href='%s'>%s user</a></strong> online now."
    msgid_plural ""
    "There are a total of <strong><a href='%s'>%s users</a></strong> online now."
    msgstr[0] ""
    msgstr[1] ""

    should read as

    #: admin.php:24
    #, php-format
    msgid "There is <strong><a href='%s'>%s user</a></strong> online now."
    msgid_plural "There are a total of <strong><a href='%s'>%s users</a></strong> online now."
    msgstr[0] ""
    msgstr[1] ""

    Or

    #: template-tags.php:79
    #, php-format
    msgid ""
    "There is <strong>%s</strong> online now: <strong>%s</strong>, <strong>%s</"
    "strong> and <strong>%s</strong>."
    msgid_plural ""
    "There are a total of <strong>%s</strong> online now: <strong>%s</strong>, "
    "<strong>%s</strong> and <strong>%s</strong>."
    msgstr[0] ""
    msgstr[1] ""

    should read as

    #: template-tags.php:79
    #, php-format
    msgid ""
    "There is <strong>%s</strong> online now: <strong>%s</strong>, <strong>%s</"
    "strong> and <strong>%s</strong>."
    msgid_plural "There are a total of <strong>%s</strong> online now: <strong>%s</strong>, "
    "<strong>%s</strong> and <strong>%s</strong>."
    msgstr[0] ""
    msgstr[1] ""

    I’ve notified the person in charge of the .pot generator.

    Both POT formats are perfectly acceptable.

    Where exactly was your problem? Was there a error in poEdit, in translating, in generating a MO file, in using the already-generated MO file?

    Hi people, I don’t understand anything you are above talking about.

    My problem is : I don’t now how to use those .po, .pot or .mo files to translate the plugin in my language (PT-BR). What do a I have to do to put translation working correctly?

    I have tried to exclude all files except ‘wp-useronline-pt_BR.po’ and ‘wp-useronline-pt_BR.mo’ but nothing happened. I’ve deactivated an re-activated that plugin and nothing have happened. It’s in English all the time and don’t change.

    I’ve tried to use poedit to check ‘.pot’ and ‘.po’ files but they seem to be OK.

    What do I have to do in this case?
    Nothing is clear to me and I don’t know to edit PHP files.

    Why don’t you promote a simple way (like a button or a checkbox or a dropdown menu) to help users to configure the correct language of the plugin? As simple as possible for beginners like me.

    Few people understand PHP programming.

    Thank you for your comprehension.

    []’s

     

    @marcos Blatt: As tin68 mentioned, there was a bug in the plugin that prevented it from loading the appropriate translation.

    You have 2 options:

    Reinstall version 2.73.

    or:

    Move the appropriate .mo file from wp-useronline/lang to wp-useronline

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘[Plugin: WP-UserOnline] Translation not working’ is closed to new replies.
Skip to toolbar