WordPress.org

Ready to get started?Download WordPress

Forums

[Plugin: WP-UserOnline] Translation not working (7 posts)

  1. tin68
    Member
    Posted 4 years ago #

    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/

  2. scribu
    Member
    Posted 4 years ago #

    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.

  3. tin68
    Member
    Posted 4 years ago #

    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] ""
  4. scribu
    Member
    Posted 4 years ago #

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

  5. Nikolay Bachiyski
    Key Master
    Posted 4 years ago #

    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?

  6. Marcos
    Member
    Posted 4 years ago #

    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

     

  7. scribu
    Member
    Posted 4 years ago #

    @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

Topic Closed

This topic has been closed to new replies.

About this Topic