Closed mabar closed 6 years ago
Personally I'm against ideas like this. I'd rather have a minimal integration of symfony/translation to nette without any additional features at all (ok with neon adapter as the only exception). So if file and directory names are not optimal for you I'd recommend sending a PR to Symfony instead or implementing it otherwise. Or you can convince Filip to merge this.
@fprochazka What do you think? Is it acceptable solution?
Note: This is not ready yet. Latte macros auto-recognize as domain only characters before first dot. Dots in current state represent nesting in configuration file. It is required to separate domain and message arguments.
Behavior is now correct when using {translator}. For {_} it remains the same. Question is, if it should use default domain (messages) instead or allow domain in its arguments too.
Currently if we have file
translations/sub1/sub2/messages.en_US.neon
domain of this resource is onlymessages
. It is very bad for modularity and forces to make filenames likevendor.package.sub1.sub2.messages.en_US.neon
With this PR domain is builded from key under which is translations folder provided and from subfolders structure. Domain
messages
becomesvendor.package.sub1.sub2.messages
@enumag Before this PR is largely unuseful to use keys and subfolders, but it is still BC break. Should we release new version?