B
B
beta-it2016-10-30 22:00:20
Yii
beta-it, 2016-10-30 22:00:20

How to do formatting when translating static text in Yii2?

In code: In file ru/frontend.php
Yii::t('frontend', 'Personal Data')

return[
'Personal Data' => 'Личные данные',
];

How can you bold the word Data and data in both cases...
For example: 'Personal Data' => 'Personal data', then everything is fine in Russian, but even if in the en/frontend file:
'Personal Data' => 'Personal <strong>Data</strong>',

there is a line for translation, it still does not take it into account ...
en - set as the default language.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
V
Vitaliy Orlov, 2016-10-30
@beta-it

the manual says:

You can configure application languages ​​in the application configuration like the following:
return [
// set target language to be Russian
'language' => 'ru-RU',
// set source language to be English
'sourceLanguage' => 'en- US',
......
];
The default value for the source language is en-US, meaning US English.

Try to make sure that all the settings are done correctly, and you set the values ​​for en-US, and then use the English not en-US, but en

B
beta-it, 2016-10-30
@beta-it

Or, for example, I do this:
In file: The
question is how correct is this?

M
Maxim Timofeev, 2016-10-31
@webinar

Or do this:
or specify another language as the main

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question