Support » Developing with WordPress » Developing for non English sites

  • So it seems that English is the lingua franca for WordPress, which is fine. But it leaves me a bit confused on how to approach developing for sites where English isn’t the first language.

    Say I’m developing a theme. This is my nav menu registration.

    register_nav_menu('primary', __('Primary header navigation', 'rut-theme-text-domain'));

    Here I’m developing from a English first standpoint, and forcing myself to have a translation file for the actual main language of the site. I assume I can’t approach it the other way, and translate to English. We are always translating from English right?

    Where I’m getting more confused is actually pregenerated content. My theme might assume a specific post category. Sure I could create that category after site is implemented but I feel it is better to let the theme handle it.

    wp_create_category( __('Articles', 'rut-theme-text-domain'));

    Would this just work the same way? A category name is more like a post title right, not really a translation file type of string.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Hello,

    I think that you can create theme for the specific language without a problem, and translate it to English at the later date. Let’s say you are creating a theme for a Spanish website. Your register_nav_menu could look like
    register_nav_menu('primary_es', __('Primary header navigation in Spanish', 'rut-theme-text-domain'));
    Same goes for everything else you register through the theme. I would suggest creating categories through the Dashboard as it makes it easier to edit it later.

    When WordPress wants to apply en_US, it will do this by NOT USING any translation files. So if your theme/plugin will have users that need en_US, then best approach is to use this language in the plugin. The Polyglots also uses English as the common denominator and source language. Technically you CAN use any language in your code but I wouldn’t expect many translations to pop up from volunteers if the language in the code is Ukrainian, for instance.

    Pregenerated content is a tricky thing. It would typically run some code that would insert strings into a relevant object, and these strings may be translated into the language used by the admin user when enabling/creating the demo content. But after that, this content just stays as content, and won’t be touched by the normal translation system at all. Also note that WordPress in itself doesn’t support multilingual content. You’d always need some kind of additional functionality for this. And various frameworks handle the multilingual content in different ways…

Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.