On current dev-master (post beta.16) when you php flarum cache:clear the storage/locale directory is cleared. When you now use the Translator by resolving it from ioc it can no longer use translations.
The reason for this is that:
the service providers for Admin and Forum bind the Assets into ioc and there call AddTranslations for their specific frontend.
through the AddTranslations the Locale Manager is resolved (causing extensions to load their files) and the catalogue to be cached to disk
the console service provider has no logic at all related to this and as such is unable to restore the translations.
Understand that this bugs affects anything executed in cli, including scheduled tasks, cli command but also every single queue job that runs a non-default sync driver. Now usually this does not have a huge impact, because most forums regenerate their assets whenever the forum has visitors, but this will result in edge cases that are very hard to explain.
Steps to Reproduce
run php flarum cache:clear
create a command that uses the translator to parse a locale string
Bug Report
Current Behavior
On current dev-master (post beta.16) when you
php flarum cache:clear
thestorage/locale
directory is cleared. When you now use the Translator by resolving it from ioc it can no longer use translations.The reason for this is that:
Understand that this bugs affects anything executed in cli, including scheduled tasks, cli command but also every single queue job that runs a non-default
sync
driver. Now usually this does not have a huge impact, because most forums regenerate their assets whenever the forum has visitors, but this will result in edge cases that are very hard to explain.Steps to Reproduce
php flarum cache:clear