Support » Plugin: Custom Post Type UI » Make labels automatically multilingual

  • Resolved guidod


    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;
    $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.


Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Michael Beckwith


    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.

    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.

    Plugin Author Michael Beckwith


    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.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Make labels automatically multilingual’ is closed to new replies.