Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The slug should be translatable #20

Open
davidperezgar opened this issue Nov 5, 2019 · 6 comments
Open

The slug should be translatable #20

davidperezgar opened this issue Nov 5, 2019 · 6 comments

Comments

@davidperezgar
Copy link
Member

Hey! Congratulations for the plugin! It's seems awesome!

I'm wondering that the slug will be better if it can be translated.

This is the line:
https://github.com/WordPress/slides/blob/master/register.php#L35

What do you think?

@ellatrix
Copy link
Member

ellatrix commented Nov 6, 2019

I think that makes sense. Is this usually done for custom post types? Do you have an example of another plugin doing this? I just want to be careful with breaking permalinks when you switch the language.

@davidperezgar
Copy link
Member Author

davidperezgar commented Nov 7, 2019

Hello @ellatrix !
Yes, I give you the exact code:
array( 'slug' => _x('presentation', 'slug', 'slide')),

Only will change for the translations made in translate.wordpress.org. But I think, it's a better option because we will have translated urls ... 😉

@ellatrix
Copy link
Member

ellatrix commented Nov 7, 2019

Thanks. Could you link another plugin doing it this way?

@davidperezgar
Copy link
Member Author

Yes, you can see it in this plugin:
https://plugins.trac.wordpress.org/browser/strong-testimonials/trunk/includes/post-types.php#L105

For example. (It has +80.000 installations)

@davidperezgar
Copy link
Member Author

I've made a pull request 😉

@zengxiaoluan
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants