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 ?
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It only takes a minute to sign up.
Sign up to join this communityI 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 ?
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