How to change theme language

Hello !

I just saw that there are several MO/PO files in the lang directory but I can’t see how to display a specific language for the theme (French). For example the “By author” would be replaced automatically by “Par auteur”.

Thank you in advance for your answers and thanks for this awesome theme !

You download WP with French language. If language exist in theme it will work.

You could try the following plugin if you have time to translate

I have a similar problem.
My Wordpress-installation is in Norwegian; but the translationonly kicks in on certain words/sentences, allthough all sentences seem to be translated in the .po-file.

For example: The search template says “Search results for:” in English, and then “We’re sorry, we could not find etc.” in Norwegian. In the po-file the translations seem correct.

The search results use printf to format the results so make sure the .po file msgid is identical to the Roots string format i.e. Search Results for: %s will work, whereas Search Results for: will not (notice the dropped %s, you may need to double check if there’s a colon or not).

If that is the issue a PR on Github would be very much welcome.

Norwegian was added year ago and it is not updated. So some strings fit some dont. You can do it yourself it is not big file.

Thanks for answering guys.

lautreamont: What do you mean “some strings fit” ? All the strings are there, but just a few of them actually works on the site.

Foxaii: I’ll look into what you said, thanks.

When theme is change some string stay in place and some are changed or removed, so old translations for some strings work (fit) and for some do not.

This doesn’t make much sense.

lautreamont: the file you’re talking about is the .po-file for my language, right?

Some of the strings I can change (for example “Sorry, no results were found.”), and it works, but “Search Results for” I cannot change.

foxaii: I tried adding %s: no luck.

Open roots.pot file with Poedit and old translation with some editor. Copy all good translations and add new ones to Poedit. Save with your language extension.

The simplest way to do so is to set the ‘WPLANG’ field in wp-config.php.

See: Wordpress Codex: Editing wp-config.php

This does not provide you with a language swatch of any means, but it will load the appropriate translations provided your template uses gettext() functions.

If that doesn’t make sense, check out Internationalization for Wordpress Developers