CustomPress translation problem

I've been translating CustomPress to spanish. I've translated the custompress-es_ES.po file with PoEdit and then I've uploaded the custompress-es_ES.mo file to /cp-languages folder by FTP, but the main page of CustomPress plugin appears in english.

The same occurs with content_types-es_ES.po / content_types-es_ES.mo in /ct-languages folder. I've uploaded the .mo file (not yet complete), but all text strings translated appear in english.

Am I doing something wrong? All the plugins I've translated (and I've translated many of them) work. I don't understand why custom press translation don't.

  • Ivan
    • The Incredible Code Injector

    @blogspnte Thank you for reporting this bug. The path variable used is pointing to the wrong location. Change the following lines in order to make the localization work. For CustomPress: open "custompress" directory and edit "cp-loader.php". On Line 61 change:
    load_plugin_textdomain( 'custompress', null, $plugin_dir ); To
    load_plugin_textdomain( 'custompress', null, 'custompress/cp-languages' );

    For ContentTypes: open "custompress/cp-submodules/content-types" directory and edit "ct-loader.php". On line 47 change:
    load_plugin_textdomain( 'content_types', null, $plugin_dir ); To
    load_plugin_textdomain( 'content_types', null, 'custompress/cp-submodules/content-types/ct-languages' );

    Make sure you have the ".mo" files in the right directories. Also if you are using MS setup make sure you have set the default language in the admin.

  • blogspnte
    • Design Lord, Child of Thor

    Thanks, Ivan, for the patch. Now, my spanish translations works fine.

    If you want to add my translation to a new version of the plugin, please wait for some days, because I have to review my translation.

    On the other hand, there are some strings in the code which should be localized for better results in translations:

    1. Lines 38, 41, 44, 57 and 84 in cp-admin-ui-settings.php.
    2. In ct-admin-ui-add-taxonomy.php, line 38; in ct-admin-ui-edit-post-type.php, line 23; and in ct-admin-ui-edit-taxonomy.php, lines 25 and 40, there's no localization function in the "required" string.
    3. In ct-admin-ui-add-custom-fields.php and ct-admin-ui-edit-custom-field.php, there are no localization functions in the strings related to field types (42-47 and 44-49).
    4. In ct-admin-ui-add-custom-field.php and ct-admin-ui-custom-fields.php, there are no localization functions in the button "Add Custom Field".

    If I find other non localized strings, I'll tell you.

  • Ivan
    • The Incredible Code Injector

    @blogspnte Thank you for taking the time to track them down. Some of them are non-translatable like "post", "page" and "attachment" since these are the actual values used for the post types. Other strings like "required" are for translation though. I will make sure to add localization where necessary.

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.