#29630 closed enhancement (invalid)
Translatable slug in register_post_type and register_taxonomy
Reported by: | gugaalves | Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 4.0 |
Component: | Posts, Post Types | Keywords: | |
Focuses: | Cc: |
Description (last modified by )
When registering a Custom Post Type or a Custom Taxonomy, we're able to pass translations to labels, but can't do it in slugs.
Why we can't do this:
'rewrite' => array( 'slug' => _x('Books', 'post type general name', 'your-plugin-textdomain' ) ),
In sites like WordCamp sites, for example, its weird to a Brazilian Sponsor see /sponsor instead of /patrocinador in post slug.
Change History (4)
#2
@
10 years ago
- Milestone Awaiting Review deleted
- Resolution set to invalid
- Status changed from new to closed
This works. You just have to make sure you're calling register_post_type() after translations are loaded. Since in this case you need to call it after WP_Rewrite is initialized, then you should be good.
For WordCamp sites, you can submit a ticket to https://meta.trac.wordpress.org/ if you'd like it supported there.
#3
in reply to:
↑ 1
@
10 years ago
Replying to ocean90:
Hello gugaalves,
this is already possible, what does't work for you in detail?
I'll test again then, some may have been my mistake or my local environment.
That should already be in use on WordCamps themes then, I thought this test after seeing that it didn't happen in the WordCamp Rio de Janeiro site, i'll register this in the other trac, thanks :)
Hello gugaalves,
this is already possible, what doesn't work for you in detail?