Viewing 9 replies - 1 through 9 (of 9 total)
  • Plugin Contributor Michael Beckwith

    (@tw2113)

    The BenchPresser

    I’m struggling to figure out where any sort of conflict would come in with this, truth be told.

    You have complete control over the labels/text used with the post types and taxonomies you use. Only place I’m iffy on regarding translating is the “Post Type Name” field, which is what’s used to derive a post type slug. I don’t have a lot of experience with internationalized slugs for CPTs.

    Other than that, WordPress core would handle the rest regarding creating posts in the post type and the translating of those editor screens and which strings get displayed for each spot.

    Let me know if you’re still struggling on your end and if possible, provide more information that could be helpful in figuring out what’s going on.

    Thread Starter new_B

    (@new_b)

    Thanks Michael.

    I am able to translate all content fine–breadcrumbs that include titles of posts etc. are all fine and translatable.

    The only issue is when I try to display custom post type archive pages like the one described above. For some reason the custom post type name is not translatable within the usual WPML string translation interface.

    Please let me know if there is anything else that would help to troubleshoot. Thanks for all your time and help.

    Thread Starter new_B

    (@new_b)

    *Note: the actual custom post type archive page contents are fine and translatable. The only minor issue is the breadcrumb trail that shows up.

    It uses the custom post type name label available only in English.

    Thread Starter new_B

    (@new_b)

    Thread Starter new_B

    (@new_b)

    Perhaps the register post type needs to be wrapped in _x() http://codex.ww.wp.xz.cn/Function_Reference/register_post_type.

    Thread Starter new_B

    (@new_b)

    Thread Starter new_B

    (@new_b)

    I took a look that the code in custom-post-type-ui.php is enclosed in __():

    For some reason, it is still not translatable. I even tried tweaking another line with no luck.

    'label' => __($cpt_label)'
    
    ...

    //set custom label values
    $cpt_labels[‘name’] = __($cpt_label);
    $cpt_labels[‘singular_name’] = __($cpt_post_type[“singular_label”]);`

    Plugin Contributor Michael Beckwith

    (@tw2113)

    The BenchPresser

    looks like those $cpt_labels are wrapped in __() but lack the textdomain, but that shouldn’t be a problem because you yourself provide the values inside the variables from the form provided when adding the post types.

    If you click “Advanced Label Options” you’ll get a dropdown area that allows you to customize an itemized list of various label fields. Pretty much every part of the registration process that you’d need to translate, is already user provided, just need to put in the already translated text.

    Thread Starter new_B

    (@new_b)

    I wasn’t able to find the space to translate it. For some reason the strings didn’t register in WPML to be translatable.

    I ended up disabling the plugin and registering the custom post types via functions.php (with export of the plugin generated code) and added __() around the label names. This solved the issue for me.

    Thanks.

Viewing 9 replies - 1 through 9 (of 9 total)

The topic ‘Custom Post Type Translation: Compatible with WPML?’ is closed to new replies.