Translate large paragraph


I’m looking for internationalization and found that it can be done by following:

echo \Yii::t('app', 'This is a string to translate!');

but how to apply this for large amount of texts, like paragraph? does each line needed to be separated? or is there any better ways available?

Thanks in advance!

Hi Nishu,

echo \Yii::t('app',''); //app -> represents the file name of the language you represent typically app.php inside your internationalized 2 digit lower case language key as folder name 

The above code is to deliver the translated to text to the users.

The actual logic behind is the key "" represents a short message key to identify the related translations. For example if you want to translate in English.

Your source folder > messages > en > app.php

return [

'' => 'This is a strong to translate'


Please read the document for more info

Hi Nishu,

You may consider translating the whole view when you have to translate a large amount of texts.

Guide > i18n > View Translation