This is the technical support forum for WPML - the multilingual WordPress plugin.

Everyone can read, but only WPML clients can post here. WPML team is replying on the forum 6 days per week, 22 hours per day.

This topic contains 28 replies, has 4 voices.

Last updated by Amir 10 years, 2 months ago.

Author Posts
June 16, 2009 at 4:55 pm #10497

Amir

If you change the default language in wp-config.php, does it affect the display?
WPML should override this, but if the locale is not set, the default from wp-config kicks in.

June 16, 2009 at 6:49 pm #10498

Pieter

nope, also that doesn't change anything... tried it with both language settings...

June 16, 2009 at 8:09 pm #10499

Amir

So, it might be an unrelated problem to the plugin. To debug this, try creating different test blogs (without WPML) and see that the theme localization works correctly. If you include the .mo file in the theme folder and select the locale in wp-config.php, it should work.
Then, once you have that working (without WPML), it would work the same with WPML. The only thing that it does for theme localization is select the locale for you, so that each language gets the right locale.
The rest of the string localization is done by WordPress and GetText. WPML only selects the active locale.

June 16, 2009 at 8:24 pm #10500

Pieter

ok I will test that and let you know!

June 16, 2009 at 9:23 pm #10501

Pieter

Hi again Amir,
Well it indeed looks like it is something not related to your plugin.
What it is and how to solve it is where I am completely clueless about, but that of course is not your concern...
Anyways I want to thank you a lot for your patience and tips pointing me on the right path!
Will let you know once I have it running
Cheers,
Piet

June 16, 2009 at 9:58 pm #10502

Pieter

by the way, to localize the theme I have used the by your website recommended scanner. It says that uploading the zipped themefile works, but actually it doesn't...
It is correct that the translated theme file does not get the name of the theme, right? just the language, so in case of Dutch nl_NL.mo?

June 17, 2009 at 12:17 am #10503

Pieter

OK problems are finally solved 🙂
Inside one file of the theme which is included everytime (e.g. index.php or header.php) the function

<?php load_theme_textdomain('textdomain');?>

should be added.
That is a tiny little step that hardly anyone mentions in the Theme Translation Tutorials... Not unimportant though...
OK off to bed, finally I can start using your great plugin in full!

June 17, 2009 at 1:15 am #10504

Pieter

That was a celebration too early unfortunateky.
As it turns out now, it seems that the items in for example the sidebar will get translated only according to the default language.
So if the default language is Dutch, all is Dutch; if the default language is English, all is English.
The translations of Posts and Pages work perfect with your plugin, but the rest does not.
If you now have a look at <a href="hidden link">the site</a> you will see that it is the main domain with the English language. However, the headers of the sidebar are all in Dutch, because the default language is Dutch.
That obviously is wrong.
Any ideas?

July 1, 2009 at 4:56 pm #10505

Mihai

Looking at your site now and it looks like you got it right eventually. Let me know if you still need help.

July 1, 2009 at 6:08 pm #10506

Pieter

Hi Mihai, yeah thanks Amir helped me getting it right eventually 🙂

July 16, 2009 at 11:20 pm #10507

mariusooms

Oh boy...running a Dutch and English site and would love to hear the solution as I'm scratching my head as well. Followed instructions exactly and even did a clean local install with just wpmu 2.8.1 and wpml 1.0.4. Changed one string with GetText call to get it to translate, nothing so far.
Would you mind sharing what went wrong on your end?
Regards,
Marius

July 17, 2009 at 12:03 am #10508

mariusooms

Adding the following does seem to do the trick:

<?php load_theme_textdomain('textdomain');?>

Why is this not mentioned in the following tutorial?
<a href="http://wpml.org/2009/05/wordpress-theme-localization/">http://wpml.org/2009/05/wordpress-theme-localization/</a&gt;
Are there pitfalls to use that call? It is a little confusing.

July 18, 2009 at 6:50 am #10509

Pieter

hi mariussooms, yeah that was one of the things why it took me some time to get it working too. It is written somewhere in the tutorials, but easily read "over" (overheen gelezen). Glad you have it working now!

July 22, 2009 at 9:34 am #10510

Amir

I finally added it to our <a href="http://wpml.org/2009/05/wordpress-theme-localization/">post that talks about theme localization</a>.
It worked without loading the theme textdomain in our theme out of pure chance. We happen to use the same textdomain for the theme and plugin, we loaded one and both were active.
Thanks for the good catch.
Amir

The topic ‘[Closed] theme mo file present, but nothing translates’ is closed to new replies.