G
G
Grisha Nikolsky2015-10-30 21:08:10
WordPress
Grisha Nikolsky, 2015-10-30 21:08:10

What are text domains for in WordPress?

Hello! I studied the plugin code on wordpress and came across the following a couple of times: A
line from the plugin declaration A
* Text Domain: personalize-login
line from the plugin code
'title' => __( 'Вход', 'personalize-login' )
Googled it. It turned out that this is a text domain. But what he gives us and could not understand. Hope you can explain. Thanks in advance!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Mr Crabbz, 2015-10-30
@VoxelGod

This is to localize the plugin into other languages. The domain is needed in order to identify translatable plugin strings in any translation systems (po-edit or codestyle localization for example).
The construction is as follows: __("Translated word", "Domain"). That is, by default, the word "Login" will be displayed. And in the case the site language will be English, for example, and the plugin has the appropriate localization file - instead of it, "Enter" or "Sign in" will be substituted. Well, or how it will be translated.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question