WordPress.org

Ready to get started?Download WordPress

Forums

Custom Post Type UI
[resolved] Make labels automatically multilingual (4 posts)

  1. guidod
    Member
    Posted 10 months ago #

    Hi! Great plugin.

    For non-English sites with many post types, it's cumbersome to edit all labels to match the actual language the rest of the backend is rendered in.

    In lines 118-128 of custom-post-type-ui.php, default labels could be built based on the core WordPress translations. I know this might not work for languages that don't follow the same Verb + Noun order, but for most this would be enough, and probably better than the English defaults.

    For example:
    $cpt_labels['add_new'] = ( $cpt_post_type[2]["add_new"] ) ? $cpt_post_type[2]["add_new"] : 'Add ' .$cpt_singular;
    becomes:
    $cpt_labels['add_new'] = ( $cpt_post_type[2]["add_new"] ) ? $cpt_post_type[2]["add_new"] : __('Add').' ' .$cpt_singular;

    I manually did this on my setup, but it would be good if it was changed on the plugin core.

    Thanks!

    http://wordpress.org/plugins/custom-post-type-ui/

  2. Michael Beckwith
    Member
    Plugin Author

    Posted 10 months ago #

    Aha, thank you for pointing out these missed strings. I won't argue at all about making as much translatable as possible. It's just hard to catch all the spots at times. I can't say for sure it'll be in the next release, pending, but will for sure in the release after that if not.

  3. guidod
    Member
    Posted 10 months ago #

    Thanks! The good thing about this change is that all these "Add", "Edit", "Search" strings are already translated in WordPress' translations, so changing those 5 lines automatically translates those custom post type labels without having to change the CPT UI translation files.

  4. Michael Beckwith
    Member
    Plugin Author

    Posted 10 months ago #

    Chances are I'll run it through poedit once more just to make sure. Also I think that'd add line number references appropriately as well.

Reply

You must log in to post.

About this Plugin

About this Topic