• First of all, thanks for the plugin. It’s a great addition to WooCommerce. There’s just one thing wrong with it: “Out of stock” cannot be translated (in version 1.0.1). For some reason, all other strings can be translated just fine, but “Out of stock” refuses to translate.

    I’ve tried translating the plugin (using the included .pot file) in Poedit and in Loco Translation, on two separate sites and in different languages. In all cases, every other translation string worked but “Out of stock” did not.

    Maybe the translation file was not updated along with some changes in the plugin?

    Any help would be appreciated, thanks!

Viewing 3 replies - 1 through 3 (of 3 total)
  • I have this problem too. I found the code in woo-show-stock/main.php

    echo "<div class='remaining-out-stock'>".esc_html__(' Out of stock ', 'woo-show-stock') ."</div>";

    I changed the ‘ Out of stock ‘ string to the desired string in Swedish. It will get overwritten when the plugin is updated, but I can live with that.

    • This reply was modified 3 years, 1 month ago by Argentum.

    The developer may have missed to create a fresh .pot from the very latest version of the plugin.
    In general, you could add it manually in the relevant .po file, making sure to exactly match the original string. It can be opened in a text browser. The notes about the location of the source string can be omitted.
    Then open in poedit and save in order to get a compiled .mo, since that’s the file being used by PHP.

    You might also use a plugin like “Say what” for this, but if this is the only string you need to fix, then that may feel like overkill.

    Message to @niloybrightvessel
    Currently this plugin is not available for community translation on https://translate.www.ads-software.com/projects/wp-plugins/woo-show-stock/ because load_plugin_textdomain() seems to be missing in your code. (At least the Import function for translate.www.ads-software.com thinks so.)

    Funnily enough, there’s a very quick and easy solution to this: If you declare Requires at least to 4.6 (or a later version of WordPress), then you don’t need load_plugin_textdomain() since WordPress automatically loads the text-domain of your slug from /wp-content/languages/plugins since then.

    @tobifjellner

    >>The developer may have missed to create a fresh .pot from the very latest version of the plugin.

    No there is 17 strings so the pot and po files are identical as far as I can see.

    >>Currently this plugin is not available for community translation on https://translate.www.ads-software.com/projects/wp-plugins/woo-show-stock/ because load_plugin_textdomain() seems to be missing in your code. (At least the Import function for translate.www.ads-software.com thinks so.)

    Maybe that is the problem then?

    >>Funnily enough, there’s a very quick and easy solution to this: If you declare Requires at least to 4.6

    Where do you set that?

    • This reply was modified 3 years, 1 month ago by Argentum.
    • This reply was modified 3 years, 1 month ago by Argentum.
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘“Out of stock” refuses to translate – other strings get translated just fine’ is closed to new replies.