Docs

Using Theme Language Files

language-files

If you’d like to use our themes in another language, it’s pretty easy to do. This tutorial assumes you already have a .mo file in your language and you’re ready to upload it to your AppThemes site.

In this example, we want to change JobRoller to Brazilian Portuguese. Here are the steps you need to take.

Step 1

Download the language file from our language pack page. Unzip the package and inside you’ll find a pt_BR.mo file. Rename that file to “jobroller-pt_BR.mo” and then set it aside. We’ll come back to it later.

Note: If a language pack doesn’t exist for your language, you’ll have to create it yourself. Our How to Translate a WordPress Theme tutorial will explain how to do it.

Step 2

If you haven’t already done so, you’ll need to tell WordPress that it should use Brazilian Portuguese. You declare this in the wp-config.php file usually located in the root on your server. You’ll need to use SFTP or SSH in order to edit this file.

Once you are in edit mode, add the following line anywhere. Make sure this doesn’t already exist, however.

define( 'WPLANG', 'pt_BR' );

Now upload that file back to your server and overwrite the old one.

Step 3

Next you need to upload the .mo file to your server. This file contains the actual text translations for the theme. Before doing so, you’ll need to create a couple of new folders. SFTP/SSH back to your site and go into the wp-content folder.

  1. Create a new folder called “languages”
  2. Go inside that folder and create another folder called “themes”
  3. Copy the “jobroller-pt_BR.mo” file you set aside earlier into this folder

The final new folder structure with the .mo file should look like this.

/wp-content/languages/themes/jobroller-pt_BR.mo

The name of the .mo file is very important. It’s also case sensitive. If it doesn’t match the theme name, language code, and country code it won’t work. Same goes for the define constant in step 2 above. Links to all codes can be found in this post.

File naming format should be as follows:

[THEME NAME]-[LANGUAGE CODE]_[COUNTRY CODE].mo

Now visit your website and refresh any page (clear your cache too if using a caching plugin). You should now see it in Brazilian Portuguese!

FAQ

Why do I have to create new folders for the language file instead of just placing it in the /wp-content/themes/jobroller/ folder?
Because the language file would get deleted if you upgraded to the next version. This wasn’t the case until we moved to two click theme updates back in October, when we had to make this change.

Written by: David on December 8, 2011. Last modified by: scribu on December 18, 2011 7:42 am.

2 Responses to “Using Theme Language Files”

Leave a comment via Facebook or our form below.
  1. 1 Comment

    4/11 Joined

    redixus Apr 6, 2012 11:17 pm
    customer

    Please note after original install

    put into /wp-content/languages/themes

    example language pack:
    classipress-pl_PL.po
    classipress-pl_PL.mo

    Reply

Leave a Comment

Existing customer? Login to post your comment.

← Your Gravatar here. Already have one?
No need to do anything, otherwise get one now!

Support or Pre-Sales Question? - You're in the wrong place.
Head on over to our forum where our dedicated support team can assist you.


css.php