You purchased our NooTheme product. You created a website on your own. Then you think that almost everything met your expectation. If users of your website are not English and they cannot read anything there then you will wonder yourself “How can I change language or translate some words, phrases, sentences or even the whole content of my website?” OR you do not like style of writing sentences in the site and want to change it. You have not come up with the answer to these issues yet.
Our instructions below will definitely help you to solve the problem.
Please make sure that there are at least two prerequisites, which must be accomplished prior to starting to translate:
- You found languages file of the site you created. It contains a file called en_US whose type is compiled translation. Please seek it in conformity with this direction: themes > theme_name > languages > en_US, with theme_name being the folder name of the theme you bought. For JobMonster, it’s noo-jobmonster.
- You installed PoEdit on your computer: you can download this software according to this link https://poedit.net/. After successful installation, the software will support you in opening an available en_US,po file.
Basically, this software will bring two advantages to you. You can modify the way of writing each sentence in the file or you can translate it into other languages.
Note: Before reading these guides below, please remember that we will use languages file in Jobmonster theme to illustrate in this writing.
To rewrite sentences or replace phrases with other ones, please follow these steps:
Step 1: Open PO file, click a line containing the sentence or phrase you want to make some adjustments. Then this sentence or phrase will be displayed in source text section. One tip given to you is that you can find sentences or phrases easily by using Clt+F or function of “Find” in Edit.
Step 2: In translation section, you can replace the chosen sentence with new ones by typing here. You also realize that the new one appears in the line including the old one simultaneously.
Step 3: Remember to click Save.
Now you can come back to your site and see the change:
To convert sentences or phrases to a foreign language, please do the following steps:
Step 1: Open PoEdit and click Create new translation. A window will appear and you will opt PO Translation files (*.PO) in the box opposite to file name box. Then you will choose en_US PO translation file.
Step 2: You can select a new language in Translation Language box and click OK. We take Spanish (Mexico) as an example.
Step 3: You will carry out steps similar to ones when you change style of writing above. It means that you click a line> translate the sentence or phrase in translation section> Save. However, due to having chosen a new language, PoEdit will automatically change your file’s name you have just redesigned. Your file`s name usually includes two parts like en_US. The first one is code of language and the rest one is code of nation. If you don’t know the code for your language, please refer to my note below to find it.
In our example, the file will be named es_MX.
Step 4: The last step you have to do is returning to Admin panel. Please navigate to Settings>general>site language. After that, you can decide on the language you used in file created in step 3. Finally, remember to click Save changes.
- You will need to carry out a further step if the new language is not set up in drop down menu of Site language (admin panel>settings>general>site language).
Please open file wp-config.php. Then in line 36, you will copy and paste name of file just changed into space between quotation marks. See the illustrative image below to better understand.
- You can go to this link https://make.wordpress.org/polyglots/teams/ to see name of file mentioned in step 3. As you see, in this table, the first column from the left is the language you pick to translate, the second one will be displayed in drop-down list of Site language section and the third one is name of file.
- If you try to translate or modify several sentences consisting of $x%, %s or something like that, you will not be allowed to delete these placeholders. You will only be able to change order of them in the translated sentence. These ones will be replaced with data when they are displayed on the website. Thus, you should not bother with this. Please observe the image below to fathom the process:
Brief explanation for the image: When the original sentence (unpublished %s job) is displayed on your site, it will be transformed into this one: unpublished 1 job (click button marked by the red circle then you will see “unpublished 1 job” at the top).
Yet, you would like to make it different, for instance, 1 unpublished job. With placing placeholders %s into the first position of the phrase, you will obtain your desire:
Then you will go back to your site to view the alteration:
- Please take notice of this: titles of pages or anything belonging to a page will be only translated or changed in Pages section. You cannot translate them by PoEdit.
Let’s take advanced search element in Home job 2 page as a typical example:
The initial title in this section is Join us & Explore thousands of Jobs:
BUT now you would like to make some alterations. For instance, it may turn to Become a member and seize job opportunities.
Click edit this element > change title into Become a member and seize job opportunities > Save changes > click Update button.
Next, please come back to Home Job 2 page to witness a new title:
• Both your po and mo files must always have the same saved time
• How to merge the edited Po file with new en_US po file that is included in the updated version
After updating version of the theme, you should remember to merge the edited Po file with new en_US po file so that it can ensure that changes will be applied on your site. Follow these steps:
After you make changes to po file (for example, fr_FR po), please click the left button of the mouse on Catalog which is in the menu of the edited fr_FR po file (this menu is on the left top of the file) > opt Update from POT file > there will be a new window > opt PO Translation Files (*.Po) > click the left button of the mouse on en_US po file > opt Select. See the images below:
• Translate/ change texts in language file of plugins
If you edit texts in the language file of our theme`s plugin, there will be a minor change to the way you give a name to the file. When you go to plugins folder, you will see the default name of the language file, for example, noo-menu-en_US.pot. After you change strings in English (United States) and Save the file, its name will be noo-menu-en_US.po instead en_US.po.