WordPress.org

Ready to get started?Download WordPress

Forums

Quotes Collection
[Bug] "Next quote" never translated (4 posts)

  1. nemo.vrusso
    Member
    Posted 3 years ago #

    Hello, there is a tiny bug regarding the translation of particular string: "Next quote".

    Since you have

    $quotescollection_next_quote = __('Next quote', 'quotes-collection').' »';

    at the very top of your plugin, you call the __ function before the init hook is actually invoked. Therefore, at that point the dictionaries haven't been loaded yet, and the string "Next quote" doesn't get translated.

    To fix it, I changed the line above to a simple

    $quotescollection_next_quote = NULL;

    Then I added this

    global $quotescollection_next_quote;
    $quotescollection_next_quote = __('Next quote', 'quotes-collection').' »';

    right after

    load_plugin_textdomain('quotes-collection', 'wp-content/plugins/quotes-collection/languages/');

    I should have probably filed a bug somewhere and proposed a decent patch, but I am in kinda rush :)

    Cheers,

    Vincenzo

  2. Lucker
    Member
    Posted 3 years ago #

    I did a bit easier: just replaced "Next quote" in the quotes collection.php to the local language text and switched encoding in the file to UTF-8. That's it! Just replace file on the host.

    Cheers

  3. S.K
    Member
    Posted 3 years ago #

    @Lucker

    Should it not be saves as "UTF-8 without BOM"?

    @nemo.vrusso

    Is there any other way of achieving it?

    Thanks

    S.K

  4. SriniG
    Member
    Plugin Author

    Posted 3 years ago #

    This is fixed in v1.4.3. Here's the changes if anybody is interested.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic