Support » Plugin: Media Cleaner » Localization issues (?)

  • Resolved Norske


    Hello, Jordy!

    I’ve spent some time translating your wonderful plugin into Russian this weekend. (Actually, I’ve processed all untranslated/fuzzy strings and approved them). But, unfortunately, the result is still not perfect as those localized strings cover just about 30-40% of the current interface of Media Cleaner.

    So, I had to make some kind of a small research and I’ve (probably) found some issues, which cause this situation.

    First of all, there are 2 different text domains in source files: 'meowapps' (11 strings from common\admin.php) and 'media-cleaner' (60+ strings from others). All these pieces are available for translation and properly included into po/mo files. But WP loads only one text-domain per a plugin (‘media-cleaner’ in this case). So, the admin screen is still shown in English although a huge part of it is properly translated.

    Second point is that there are also at least 80+ strings in the plugin interface which are shown to the end user but not yet prepared for localization (not gettexted with __()), so they are not available through the translators’ tools. The main issue here is that already localized strings mention field names and other texts which are not yet ready. For example, an intro paragrpah tells about scanning methods, but method names (fields and labels) are still in English.

    I took the liberty of looking through your code files and gettexting the most needed strings (to my mind) with a temporary text domain to collect them into a separate *.pot and to test if the rest localization breaks anything. The result looked good enougth to me 🙂


    Certainly, I don’t plan to use modified files without your permission. This was just a research to support this post (didn’t want to criticize your hard work without any effort on my part). I’ll be happy to send you those drafts if this will help you to save some time in future.

    And one more tiny thing. Not even sure (forgive me, since I’m not skilled enough in PHP), but this line in api.php seems to have a variable inside a translated string:
    'message' => __( "No files for this path ($path).", 'media-cleaner' )
    Maybe it should be something like this (?):
    'message' => sprintf( __( "No files for this path (%s).", 'media-cleaner' ), $path )

    I didn’t touched hardcoded strings passed through the error_log() and $this->log() functions, since some of them are used in conditional statements. There is also i18n support for the JavaScript files since WP 5.0 (to translate dialogs and ajax messages), but I didn’t used it yet.

    Anyway, thank you very much for your nice plugin!
    Please feel free to contact me if I can help you with localization (via GitHub PR or somehow else).

Viewing 1 replies (of 1 total)
  • Plugin Author Jordy Meow


    Hello 🙂

    Could you contact me through my website? Here:

    Definitely, I would like to integrate those changes 🙂 For the admin, I could also fix it. However, it’s fine to use a variable when double quotes are used in PHP.

    JS i18n support is also possible but slightly more tricky (and the translations could be served by PHP).

    I’ll wait for your message 🙂 Thanks a ton for doing this!

Viewing 1 replies (of 1 total)
  • You must be logged in to reply to this topic.