We all know that most of the website in world is created in English language. Because this is the most used language in the world. But to spread our website in each corner of the world we need to translate it to other language also. There are many plugin available to translate theme. But in this post i will explain you how to translate your theme with Loco Translate. This is a free plugin and you can get it directly from “WordPress.org“.
Here i picked Loco Translate because if there is no language file (.pot) in your theme then this will help you to create that also. So in this post i will cover following points. What is loco translate, How you can install and activate plugin, How to create .pot file, How to translate strings.
So let’s get started.
What is Loco Translate
Loco translate is an easy to use translating plugin which helps you to translate your theme or plugin in other language. It is very easy to use and user friendly plugin. It has some amazing features, you can check this list below
- POT file generator
- It can extract translatable sting from theme or plugin
- Protected language directory for saving custom translations
- PO features supportable
- Built in WordPress Locale codes
- Local MO compilation
Now let us discuss how we can translate our theme with Loco translate. Here i will use “Featured Pro” theme
Installing Loco Translate
To install “Loco Translate” login to your dashboard and navigate to “Plugins > Add New” here you can see a “Search Field” at the top right of page. Type “Loco Translate” here and you will see first plugin is “Loco translate” in result page.
Click on “Install Now” button and then activate it. Now plugin is installed in your dashboard and you can start translating it from “Loco translate” available in dashboard.
How to create .pot file
Before translating to your theme to other language please make sure it contains ‘translation template’ i.e. .pot file, If not then before translating it you need to create that file.
For that navigate to “Loco translate > Themes” here you will get lists of all themes available in your dashboard, Select the theme for which you want to create .pot file.
There you will get option to “Create template”, Click on that option, It will create a .pot file which contains all the translatable strings available in theme.
As soon as your template is created you are ready to translate your string to other language.
Now again navigate to “Loco Translate > Themes” and select “Featured Pro”, Here you will get option for “New Language”. A new popup will be shown in this you can see list of available languages in “Choose a language” option. You need to choose your language, In this we are going to take example of “French” language.
After that you have to choose destination folder where your file will be saved. Here i will suggest you to select “Custom” option. I am suggesting this because it will prevent your file from automatic update.
Then click on “Start Translating” button.
As soon as you click on start translating it will open a window of all the strings which can be translated. You can use search field to get your text which you want to translate. Here i am going to translate “Leave a Reply” text.
Just select that text and it will show below in “Source Text” and below that you will get a field “French Translation”. Here you have to write your french text.
Similarly you can translate all your text which you want in your language. After that click on “Save” button. All your text will be saved and will show on your site.
Note : To see all your translated text in your language you need to choose that language from your WordPress dashboard.
i.e. Settings > General > Site Language.
Now let’s check our translated text.
In this post i covered all the steps which is necessary to translate theme string to your language. If still you have any confusion then just ask me by filling comment box below, I will reply you back.