Sometimes it is more beneficial and rewarding for a website owner to have a website in his or her own language. For example, if a person wants to attract the local people of his community, it might always be a good idea to create a website in that local language. WordPress provides the facility to undertake this task. Although the standard language of WordPress is US English, it has the built-in capability to be used in any language. Two methods can be adopted to have your WordPress website in your own language:
1- You can choose the language already listed in the options of WordPress.
2- If the language option for your specific language is not available, you would have to follow the following manual instructions:
First of all, you need to download the .mo language file for your language. The naming convention of the .mo files is based on the ISO-639 language code (e.g. pt for Portuguese) followed by the ISO-3166 country code (e.g. _PT for Portugal or _BR for Brazil). So, the Brazilian Portuguese file would be called pt_BR.mo, and a non-specific Portuguese file would be called pt.mo. Similarly, the option of language codes and country cods for all renowned languages is available.
Now, open your wp-config.php file in a text editor and search for:
1 |
Define ('WPLANG', ''); |
Edit this line according to the .mo file you’ve just downloaded, e.g. for the Portuguese spoken in Brazil you must add:
1 |
Define ('WPLANG', 'pt_BR'; |
If the .mo and .po files don’t exist for a language code called for in wp-config.php then there is no error message, but the code is still used in language_attributes(). This usually happens when your language is quite similar to en-US and does not really require any translation. But in case you want some other variant of English, you can use this piece of code:
1 |
Define ('WPLANG', 'en-GB'); |
Now follow these steps:
– After adding the language, save the notepad file.
– On the site server, create a new folder in your /wp-content OR /wp-includes directory called /languages.
– On this servier, you need to upload the .mo file to the languages folder you just created.
– Now open your WordPress website. Content of the website should be displayed in your language.
– In case you want to customize the translations, you need to download the .po file corresponding to the .mo language file you installed.
That’s pretty much it. The above process would make the content of your WordPress website be displayed in your desired language.