It's been discussed many times and voted high. No significant changes since. 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.
1. 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%/
2. 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.
3. 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.
4. 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.
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.
I hope you get the idea.