Native Multilingual CMS Feature Suggestion | WordPress Suggestion
Components
Don't get me wrong, I love WordPress and make my living with it for many years. But when I start building large sites in multiple languages I start hating WordPress being oriented to only one language. I've heavily used these plugins - Polylang, WPML, qTranslate, tested all the rest. Each of them has good and bad sides. So here's the best of all words and how I see it.
Proposal
I would like to propose a suggestion to WordPress to make it easy for use to make our website multilingual. This could really help website owners to make it easy for their country to read their articles. Plus it will result in higher user experience.
How To Achieve It?
Add built-in kind-of-taxonomy language, which can be attached to any WP Object - post/page/CPT, taxonomy/CT, nav_menu etc. Make it the first part of URL: example.com/%language%/
Add relations to connect any WP Object to another one as a translation (corresponding object in another language). The way it is done in Polylang is pretty nice.
Make slugs for any WP Object NOT UNIQUE. WPML plugin allows to have pages and posts in different languages with translated titles and SAME slugs. But it can't do this with tags, categories and custom taxonomies. If we have a language super-taxonomy as a highest hierarchy level (first part of url) then we can differentiate between objects with same slugs. For all internal operations consider slug to be %language_code%-%slug%. This is UNIQUE. But the slug itself is not.
Modify core functions to work with translations. For example, wp_insert_term() or wp_insert_post() should accept some extra args, like:
$args = array
'alias_of' => '',
'description' => '',
'parent' => '',
);
$terms = array(
array(
'language' => 'en',
'name' => 'Example',
'slug' => 'example', // Non-unique, or unique - for us to decide.
),
array(
'language' => 'de',
'name' => 'Beispiel',
'slug' => 'example', // Non-unique, or unique - for us to decide.
),
array(
'language' => 'ru',
'name' => 'Пример',
'slug' => 'example', // Non-unique, or unique - for us to decide.
),
);
wp_insert_terms( $terms, $taxonomy, $args );
// OR, insert only one term at a time:
$args = array(
'slug' => '',
'alias_of' => '',
'translation_of' => '',
'description' => '',
'parent' => '',
);
wp_insert_term( $term, $taxonomy, $language, $args );
This is not the complete list of changes, of course, but a good point to start from. It will make lives of all non-US developers and users much easier.
Benefits
Here's why it would be useful. Just one example of many use cases.
Example: Let's pretend we have a site in 2 languages - English, and Russian. And we have a countries custom taxonomy. Russian names are transliterated to latin characters.
example.com/country/russia
example.com/country/rossiya
It's possible to achieve right now, because term slugs are different. But what about Laos (and many other countries as well)? Transliteration will be exactly the same.
example.com/country/laos
example.com/country/laos
Houston, we have a problem! But if we add and parse the language code in front of our url, we will get:
example.com/en/country/laos
example.com/ru/country/laos
Now this allows us possible to filter posts in one language for the given country. But term slug must be NOT unique.
Posted on Utopian.io - Rewarding Open Source Contributors
Hello @spyde, your contribution can not be verified as it was discovered that this idea was actually stolen/plagiarised from here. This act is not something that is welcomed in this community.
You will no longer be able to post via utopian as this account has banned.
Thank you.
Need help? Write a ticket on https://support.utopian.io.
Chat with us on Discord.
[utopian-moderator]
Congratulations @spyde! You have completed some achievement on Steemit and have been rewarded with new badge(s) :
Award for the number of upvotes
Click on any badge to view your own Board of Honor on SteemitBoard.
To support your work, I also upvoted your post!
For more information about SteemitBoard, click here
If you no longer want to receive notifications, reply to this comment with the word
STOP
Congratulations @spyde! You received a personal award!
You can view your badges on your Steem Board and compare to others on the Steem Ranking
Do not miss the last post from @steemitboard:
Vote for @Steemitboard as a witness to get one more award and increased upvotes!