WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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>

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

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

Your Answer


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.