Third party plugin localization should be in the apps Locale
folder
Your assumption that the files should be in the plugin folder is not necessarily correct. Custom localizations for third party code should be in the applications Locale
folder, otherwise they would get lost everytime the code package is being updated.
You may want to report the behavior that the shell by default wants to extract all plugin localization into the plugins Locale
folder as an issue. Personally I think it would be good if it wouldn't try that in case the plugin lives in the vendors
folder.
Until that, you should use the --output
option to specifiy the proper path to your applications Locale
folder.
First party plugin localization might go in the plugins Locale
folder
If it were your own plugin, and you wanted to ship it with ready made translations, then they should be in the plugins Locale
folder, however nothing should be added afterwards if the plugin is a standalone plugin that is being included via composer, because again, these changes would get lost on update.
You should only add further localizations in a plugins Locale
folder in case the plugin is tied directly to your application, and therefore lives in the applications plugins
folder.
cakemanager/cakephp-users
doesn't follow the conventions
All that being said, cakemanager/cakephp-users
is a special case, it doesn't follow the conventions of using domain translation methods like __d()
, and supplying a domain name that is the lowercased, underscored variant of the plugin name, like __d('users', 'message text')
.
Instead it uses domain less translation calls, ie __('message text')
, see for example
https://github.com/cakemanager/cakephp-users/...src/Controller/UsersController.php#L75
Therefore CakePHPs message file loader will never try to load any localization files from the plugins Locale
folder in the first place, and it also won't look up proper separate localization files in your apps Locale
folder.
So with this specific plugin, in its current form, the translations have to go in your applications default translation file.
See also