Answer the question
In order to leave comments, you need to log in
How can I add my own translations for the 'yii' category?
in my config there is such a component with a written TranslationEventHandler that checks if there is a translation from the page and adds it to the database, everything works fine with my categories.
'i18n' => [
'translations' => [
'*' => [
'class' => 'yii\i18n\DbMessageSource',
'sourceLanguage' => 'en',
'sourceMessageTable' => '{{%i18n_source_message}}',
'messageTable' => '{{%i18n_message}}',
'cachingDuration' => 86400,
'enableCaching' => false,
'on missingTranslation' => ['common\components\i18n\TranslationEventHandler', 'handleMissingTranslation'],
],
'translate' => true
],
],
Answer the question
In order to leave comments, you need to log in
figured out why when you specifically specify a rule for the 'yii' category, it does not accept the validation rules in rules when added to the source_message table
'yii' => [
'class' => 'yii\i18n\DbMessageSource',
'sourceLanguage' => 'en',
'sourceMessageTable' => '{{%i18n_source_message}}',
'messageTable' => '{{%i18n_message}}',
'cachingDuration' => 86400,
'enableCaching' => false,
'on missingTranslation' => ['common\components\i18n\TranslationEventHandler', 'handleMissingTranslation'],
],
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question