K
K
Konstantin2018-02-12 18:02:59
WordPress
Konstantin, 2018-02-12 18:02:59

How to work with variables in WP with multilingualism?

Good day to all!
Please tell me about the following question.
I am adding its version in another language to the site. And as such, there is almost no hardcode, everything will be decided by working with WP Multisite, but in some parts there is still hardcode. And it needs to be translated as well. I thought in the direction of adding variables and entering into these variable texts in different languages. And under certain conditions that would show a certain value of the text. Is that possible? if yes, then suggest an idea please
Something like thought:
$epcid = если это штаты ? 'Hello' : ''Hola';

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alexander Aksentiev, 2018-02-12
@Sanasol

https://developer.wordpress.org/plugins/internatio...

O
Orkhan Hasanli, 2018-02-12
@azerphoenix

If I understand you correctly, then you need to study the text domain. Then define the text domain in the plugin or theme. + use load_textdomain()
<?php _e('My text is in Russian', 'my_textdomain') ?>
And then create po mo pot files and that's it. (for the VI itself, a mo file is enough)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question