Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I would like to know how I could create a file in which I could associate a word in multiple languages. Let's make an example in XML:

<item key="goodMorning>
    <copy lang="en">Good morning<copy>
    <copy lang="fr">Bon matin<copy>
    <copy lang="nl">Goedemorgen<copy>
</item>

Is there such a file, or many files, that would be available for me to output a certain string to the front end according to the language? (It doesn't have to be XML at all, as long as it works in Wordpress).

This info (http://wpml.org/documentation/getting-started-guide/language-setup/custom-language-switcher/) allows me to get what is the current language, but I'd like to act accordingly.

I already use the WPML (paid) plugin, I asked the question over there as well, to no avail so far. If anyone could help, it'd be appreciated.

share|improve this question
add comment

1 Answer 1

You just need to set your words in a WordPress translation tag in your theme:

<?php _e('Goedemorgen','yourthemename');?>

And with the WPML string translation tool you can scan for these strings and give the appropriate translation. That's how I do it with the paying WPML plugin. Works like a breeze.

No need to make your own pot translation files (that's maybe the answer you were initially looking for, but the WPML plugin makes things easier)

share|improve this answer
    
Thanks for the guidance, with that I managed to translate a lot. However, my child theme requires additional strings, how do I add those strings? I'd rather avoid touching the parent theme. –  jansensan Oct 29 '12 at 17:20
    
You can add that code too to your child theme instead of only the main theme. The 'yourthemename' can be anything. You can also name it 'yourchildthemename'. –  Pieter Nov 7 '12 at 9:39
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.