-
-
Notifications
You must be signed in to change notification settings - Fork 6.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Buggy Message console tool #17532
Comments
Thanks for posting in our issue tracker.
Thanks! This is an automated comment, triggered by adding the label |
What specific info do you need? I tried to describe it as detailed as possible. The first three questions are answered in my post. |
|
Your messages config for the component. 'i18n' => [
'translations' => [
'app*' => [
'class' => 'yii\i18n\DbMessageSource',
'enableCaching' => !YII_DEBUG,
'cachingDuration' => $params['cache.medium'], // 10 minutes
],
'api*' => [
'class' => 'yii\i18n\DbMessageSource',
'enableCaching' => !YII_DEBUG,
'cachingDuration' => $params['cache.medium'],
],
'*' => [
'class' => 'yii\i18n\DbMessageSource',
'enableCaching' => !YII_DEBUG,
'cachingDuration' => $params['cache.medium'],
],
],
], Your messages config for the console tool. 'sourcePath' => dirname(DIR) . DIRECTORY_SEPARATOR . '..', Some files you are analyzing. Sequence of running commands. |
The Message tool which extracts translations from source code and creates new translations for given languages works like a charm in those situations
But I came across a situation where there are new translations and new languages since the last run. In this case, the tool doesn’t work properly. When you run it, it end up with SQL error – the tools tries to break
pk_message_id_language
primary key. The result is interesting – the “old” languages got new translations and are complete, but the new languages got only the new translations and the old ones aren’t created.If you run it second time, no sql error but no new messages are created. New languages has translations only for the new messages created in the previous buggy run.
Unfortunately, the source code of the tool is too complicated to me to fix it. My “workaround” for me was (after the broken run) to delete all translations from the new languages. Then I was in the second working example – new languages but no new translations. Then when you run the tool, it works.
I also trid to delete the primary key, but the tool just created duplications.
So clearly, the tool is buggy, but I’m not able to fix it
Additional info
The text was updated successfully, but these errors were encountered: