I don't understand how translation works in Wordpress. I made my first wordress using Baskerville 2 theme and I would like it to be translated in French.

How does it work ?

up vote 2 down vote accepted

It's quite well explained here: https://developer.wordpress.org/themes/functionality/internationalization/

Basically ensure that all plain text uses the get_text functions with a text domain for your theme: https://developer.wordpress.org/themes/functionality/internationalization/#basic-functions

Add code to 'Load' any translations https://developer.wordpress.org/themes/functionality/internationalization/#loading-translations.

Once you have done that, IF translations exist they will be used. THEN to get the translations.

This is also useful https://codex.wordpress.org/I18n_for_WordPress_Developers

There are a number of tools/plugins available to actually provide the translated texts. See here for some: https://make.wordpress.org/polyglots/handbook/tools/other-translation-tools/. Often the non-english users of a plugin or theme will voluntarily contribute a translation .po file to the developer.

I used to like the 'wordpress-plugin-codestyling-localization' as easiest for people new to translating, but sadly it's been not that usable for a few years. I don't have a preferred tool at the moment for actually translating the texts, but googling indicates various ideas from others for alternatives if non of the tools in the link above suit you.

You should use the WPLMS plugin for translation

  • Why? Why should you? WordPress has gettext support and you should use it for translating themes. – Krzysiek Dróżdż Jul 23 at 8:25
  • @KrzysiekDróżdż sorry i didn't know more about gettext support – Trilok Jul 24 at 7:07

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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