While English is the default language for many websites, there are plenty other for which it’s not.

Yes, believe it or not, some people manage just fine without English 😉

Until now, WPML gave these folks a hard time and made String Translation almost impossible for them. This developers release offers a fix.

sitepress-multilingual-cms-179RC2.zip

WPML’s String Translation Versus .mo Files

WPML includes an interface for translating strings. Strings are anything that doesn’t belong to a specific post or taxonomy (tags, categories, etc.).

For example, texts in the theme are strings. The blog title, tagline and text widgets are strings too.

The difference is between theme texts and admin-entered texts is that theme texts are static and admin texts are dynamic. If you’re using .mo files, you can only translate static texts. WPML’s String Translation allows translating both.

Da Bug

WPML made an unfortunate assumption that all the site’s strings are entered in the default language. There was good reasoning for this assumption, but it made translation for static texts impossible, when these texts are not in English.

So, if you have a site in French and you’re translating to German, none of your contents are in English. Except the texts in the theme and all plugins.

That’s where the problem is.

Since WPML assumed that strings are in French already, it didn’t allow you to enter translation to French.

Explicitly Specifying Strings Language

Now, WPML no longer assumes anything. You can choose the original language of strings.

English is the default language for strings and only very rarely should you change it.

All the texts in WordPress itself, any plugin you download and 99% of the themes is written in English. In order to get them translated, you’ll need to keep English as the language for strings.

To choose the language of the strings in your site, go to WPML->String translation. Scroll down to where it says Translate general settings texts. Then, change the language and click on Save.

Language selection for strings

New Gotcha – How To Translate Admin Strings

If you’re listening to a podcast or reading news, you better close them. This part requires 100% of your concentration. It’s tricky, confusing and working.

A quick recap:

  1. All string have the same ‘from language’.
  2. Your theme’s texts are in English.
  3. Admin texts (like tagline and text widgets) are translated like theme texts.

The outcome is that if you want to use WPML’s String Translation to translate admin strings, they have to be in English.

That’s right. Even if your site is in French and you’re translating to German and there’s no English involved.

You will enter the admin texts in English (just like texts in the theme). Then, translate them using WPML’s string translation to both French and German.

We realize this is extra work for everyone, but that’s the way it’s working. The String Translation mechanism is an extension of GetText. It translates from one language to others. And, if that one language is English, it’s English everywhere.

Kudus

We managed to track down the problem and fix it thanks to one of you folks who purchased a support subscription. It took a lot of time to debug and fix and we couldn’t have spent the resources for it without that extra push.

Thanks!

17 Responses to “Default Language Other Than English”

      • I have tested it and it worked very fine as I excpected. This new feature (translate the strings from English into the default language other than English) is what I have been looking for. Well done and thanks, Amir!

  1. I have tested this release and all work fine. Thanks !

    But I think we can go further. Here is my example (need concentration) : the default language of my website is French. And there is also English and Spanish.

    The default texts in theme files are in French.

    If I choose French as the “Strings Language”, I can edit English and Spanish translations. And on my website, all work fine, but I cannot change French texts (modifications done while switching are still there if I switch again the “Strings language”, but do not appear).

    If I choose English as the “Strings Language”, I can edit French and Spanish translations. And on my website, all work fine, but I cannot change English texts (modifications done while switching are still there if I switch again the “Strings language”, but do not appear).

    Why do not allow to change all the three languages directly, even the default one, and search for a traduction on the front website even for the default language ?

    So, not only the translations will be dynamic, but the default texts themselves.

    It would be a very nice feature, because for now, I can tell my editors (who do not know how to edit a theme file) they can change the texts in English and Spanish, but not in the main language (French), which is frustating.

    Thanks !

    Cyrille

    • Hi Cyrille,

      IMHO, it is strongly not recommended to modify the default strings language you use. Why? Because the default strings language is the default reference that will be used to translate to another language.

      If you want to change or modify the strings in the default language you use, you should modify them directly from the .po file and or via the theme files themselves. Afterwards, you have to re-scan your theme files in order to get the newest translation strings you have just changed, then re-translate them again to another language.

      • Hi Masino,

        I am not sure we understand each other.

        I think the default reference is the texts which are in the theme files, in the _e() and __() functions. Not the data in WPML database, which has, I think, an ID primary key to refer to.

        What I suggest is to consider the default language as a translation. For example, if there is _e(“Test”, ‘theme_name’) in the theme file, and we are in the default language, it displays “Test” if nothing has been changed or configured in the WPML administration, but displays “Whatever” if changed in admin.

        Cyrille

        • Cyrille,

          I think I understand your point by discussing your following question: “Why do not allow to change all the three languages directly, even the default one, and search for a traduction on the front website even for the default language ?”

          The reason why you are not allowed to change only the default one, since the others two language will have to refer to the default strings you are currently using.

          As we know, WPML will scan your original strings that located in your theme and plugin files based on (mostly) the _e() and __() function. This original theme and plugin strings will have to be similar with the original ones that being save in WPML table (I will explain it below). WPML will keep those strings in exact-match condition.

          Here is the example based on my experiences.

          I usually use “Translate theme by WPML” option in order to scan and get the original string from the theme and or plugin files I use. This will make WPML keep/save the original strings (default one) into wp_icl_strings table, whereas the translation strings will be saved separately in wp_icl_strings_translations table.

          Since the original strings being saved in the different table, then we can only change the strings that located in wp_icl_strings_translation table from the “Strings Translation” sub menu of WPML.

          If you want to change or modify the default strings that being saved in wp_icl_strings table, then you have to change them first directly from the themes and plugin files, afterwards, let WPML re-scan your theme and plugin files in order to update the newest value in your wp_icl_strings table. Then, you will be able to re-adjust the other two new translations with the newest update strings you have just already done.

          The conclusion: each time you modify your default strings by modifying them directly in your theme and plugin files, then you have to re-scan them via ”
          Theme and plugins localization” menu of WPML, and then re-translate the newest string that recommended by WPML from “String translation” menu.

          Another advantages why you should modify the original/default strings directly to your theme and plugin files, since when you want to use the “Using a .mo file in the theme directory.” option in “Theme and plugins localization” menu, then you can easily create the .mo file based on the newest changes you made in the files.

          At least, I took this conclusion based on my experience until now.

          People, let me know whether you find something new that I don’t know. Also, correct me if I’m wrong, and let me know your additional comment to explain further more about this. Thanks.

          • OK, I understand the difference between “wp_icl_strings” and “wp_icl_strings_translations” tables and why they are both needed.

            So, why not insert the default language strings in “wp_icl_strings_translations” table too, so they could be changed too, without change of the “wp_icl_strings” table ?

  2. Dear Amir:

    Is this new version 179TC2 including Buddypress Multilingual Plugin. I read somewhere both will be merged. If not, is there a link to new BP Multilingual Plugin version ?

    Regards,

  3. There’s a problem with your new assumption.

    I make my websites in french. The original strings in my theme are in french, but the original strings in my plugins are in english.

    If only I could specify a language for each context, but unfortunately, I’m left with only one choice,

    One other thing, ever thought that I might need to correct a typo in the original version of the string, without having to rescan my theme and copy-paste the old translation back into the new original string?

    These are little things I’ve been dealing with for years and unfortunately are still not fixed in September 2011, AFTER you’ve gone commercial and I paid my share.

    • You should be able to specify a language for your strings that can be different than the default language.
      Please add details about all the other technical issues that you have on the forum and we’ll try to address them as soon as possible. Thanks!