dokan , this is also applicable to any other WordPress plug -in and theme.
However, if you are already an experienced WordPress user, then you can directly jump to
\”How to translate\” to take further action.
So let’s start watching the Dokan translation process step by step.
How does translation work in wordpress?
If you are a novice translated by WordPress and do not know, then you may find it difficult to understand, but don’t worry, I understand! You will soon be a professional.
If you set your website language from WordPress for the first time, then you may have noticed that some menu tabs in the left sidebar on the left sidebar of WP-Admin [123
have not been translated.
In addition, if you choose your local language during the installation of WordPress, and then install some plugins You should have noticed that the tab of the newly installed plug -in is still English. Let’s take a look at the following example.
If you observe it carefully, you will find that only the default WordPress menu is automatically translated, and all other string related to the 3rd square plugin is not translated. This is because when you switch the site language, WordPress will create a
\”Language\”
folder in
\”wp-content\” folder.
\”Language\”
folder, you will see the translation file shown below.
folder. The red label file is automatically generated by WordPress. That’s why we see the default WordPress menu of the translation language without doing anything.
However, the third side plug -in or theme cannot be done. Therefore, you must manually place translation files, or you can start from scratch, but remember, you cannot simply place the translation files anywhere. There are some rules that need to be complied with.
Things to be considered before starting the WordPress plug -in translation
01. File name: (text domain)-(localcode)
File name is very important. If there is no correct file name, WordPress will not be able to identify the translation file. Therefore, translation will not be reflected. If you are a novice WordPress, the file name structure mentioned above may be confused. Let’s see some examples:
Assuming you want to translate Dokan Lite plug -in. First of all, you need to know the
Text Domain
and local . So where can I find it? Each plug -in and theme has a
pluginname.php
file in the plug -in folder. Therefore, there should be a file called \”Dokan.php\” in the Dokan Lite plug -in folder.
Let’s go /wp-content/plugins/dokan-like
After opening the file dokan.php, you can accommodateThe text domain of the plug-in is
Now you have a text domain. We have one more thing to deal with. Here, you have a text domain to find the regional settings of the national language so that you can translate your website. For this special situation, when you translate into Spanish. So it is best to find a easier language environment code than the text domain. Therefore, you only need to access here and find the correct WordPress language environment .
Let us find
Spanish (Spain)
According to the list,
Spain (Spain)
. Therefore, you have a text domain and WordPress language environment.
So follow the correct file name of WordPress rules and dokan, the Lite plug-in is: (TextDomain)-(localCode) \u003d Dokan-Lite-ES_ES
Let’s see more examples of other languages.
Spanish (Spain) : Dokan-Lite-ES_ES German: Dokan-Lite-de_de
French (French (French (法国):
dokan-lite-fr_FR
阿拉伯语: dokan-lite-ar
意大利语: dokan-lite- IT_IT
02. File position
Do I still remember the translation file I mentioned in a language folder in the language folder? Well, there are two positions to place files:
For plugins: wp-content/languaGES/Plugins.
For theme:
wp-content/language/themes or
wp-conflic Languages \u200b\u200b
You need middle.
This is a system folder. why is that? Because if you put the file directly in the plug -in/theme folder, your translation file will be deleted. This is why the file is best placed in the system folder so that you will not lose the translation.
How to translate dokan (the best WordPress multi -supplier plug -in)
Now it’s time to see the Dokan translation process here. In order to easily complete the work, please follow the instructions very carefully. 01. Translation Dokan Lite
Turn to
wp-admin \u0026 gt; plugins \u0026 gt; add new
. Search \”
Loco Translator
\”.
After successful installation and activating the plug -in. You should be able to see a menu called \”
- Loco Translator
- \” on the left column.
Translate \u0026 gt; plugins
. You can easily view the plug -in list currently installed on your WordPress website.
- Important Tips
: If you want to translate a theme, you can go to
loco translate \u0026 gt; themes
] From the list above, you can watchThere are two files to the Dokan plug -in (if you have a DOKAN PRO version). Important Tips : Dokan Lite and Dokan Pro depend on each other, but act as a separate plug -in
In this case, you need to translate these two files Essence First, let’s start using
Dokan Lite .
\” option, you will see the following screen.
First, you need to choose a translation language. In our example, we will choose
Spanish (Spain).
Here, you will see the default system location.
In addition, do you notice that Loco Translator can automatically detect the language environment code of TextDomain and WordPress? Therefore, when you use Loco Translator, you don’t need to consider these things too much, unless in some cases.
- Now click \”
to start the translation
button, you will be redirected to the translation management window, you will be able to translate each string of Dokan Lite.
- Now let us try to translate a string from Dokan Lite to see if the translation is effective. For example, you can translate the DOKAN menu string in the left sidebar.
Search the string \”Dokan\” and translate it into your local language.
Spain Word
to see if the translation is really effective.
Okay! Our translation works as expected.
- When trying to translate Dokan Pro , you will notice some kind of error, that is, Template missing .
to create The template
\”to overcome this error, and the final result will be shown below.
- 如您所见,您只有4 Pass string to translate! There may be some problems. right?
- First click \”
Dokan Pro
\” first Exit the translation editor screen.
Advanced
tab. As you can see,
- template file
- is lost. The template file is basically a
POT
file, which contains all the source string of the plugin or theme. POT files can be found in the
language
folder of the corresponding plug -in folder.
So in the case of Dokan Pro , it should be Language/Dokan.pot
.
- In addition, the text domain is incorrect. Loco Translation tries to automatically detect plug -in or theme text domains to make our lives easier.
- After correcting everything, it should be shown below.
- Now let us go back to start translation.
Most most The plug -in has ready -made translation files. Some are completely translated, and some are partial translation. You can use these files so you don’t need to start from scratch.
- If the file is partially translated, then we can use this file and only translate the remaining string. Dokan also has translation projects.
here
.
Dokan Pro’s translation files can be found
Let’s translate with existing files
Dokan Lite
Click the link mentioned above.
As we saw, Spanish translation has been completed 96%, we don’t need to start from scratch. We can this translation file and only translate the remaining 4%.
Click
Spanish (Spain)
, we will be redirected to the screen below. We can choose to develop or stabilize. Since both are the same, we can choose to be stable. Click stable.
要下载文件,请Select \”Only matching filters\” as
, and then click Export.
Similarly, select \”Only matching filters\”
to
\”. Mo\”
, and then click the export.
Now we have two files, the name is as follows:
wp-plugins-dokan-lite-stable-es.po
和wp-plugins-dokan-lite-stable-es.mo
[123 ] If you read this article from scratch, then you already know that the file name is incorrect, we need to repair it.西班牙语的正确文件名是:
dokan-lite-es_ES.po
dokan-lite-es_ES.mo
[ 123] Let’s rename the file first. It should look like this.
Great! We are almost done. Now we only need to put the file in the right position. We have discussed that the translation file should be placed in the system folder. wp-content/language/plug-in/
Now we have placed the file to the above position. Let’s go to Loco Translator to see the results.
If you already have
\”. PO\”
and
\”. Mo\” file, you can, you can Simply put them in the correct position, and the translation should be immediately reflected when the page refreshes.
For this reason, you don’t need a Loco translator. You only need to ensure that the file name is correct. However, if you want to edit or translate the remaining string, then you will need a Loco translator.