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

  1. guidod
    Posted 2 years 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;
    $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.



  2. Michael Beckwith
    Plugin Author

    Posted 2 years 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
    Posted 2 years 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
    Plugin Author

    Posted 2 years 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.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Custom Post Type UI
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic