demo icon indicating copy to clipboard operation
demo copied to clipboard

Flash message translations

Open mpiot opened this issue 2 years ago • 1 comments

Hi everyone, I post that message do discuss about the better way to translate flash messages. In my case, I use symfony/demo as the place were better practices are grouped in a project.

  1. I wonder if it can be interesting to call the t() function in the Controller to have the extractor ? The second case allow to auto-extract the messages in XLIFF, but add complexity in the Controller.
  2. Can it be a good idea to use a cusom domain ?
  3. Is it better to use reusable keyword ? or like actually localized keywords ?

These are questions I am asking myself right now to implement tramslation in a project. I know that questions are not totally related with the demo, it's more best practices.

mpiot avatar May 04 '23 11:05 mpiot

Id' say that (2) we should not use a custom domain (the complication is not worth it) and that (3) we should use keywords as recommended in Symfony best practices (see https://symfony.com/doc/current/best_practices.html#use-keys-for-translations-instead-of-content-strings).

About (1) I'm not sure what should we do. Let's read other opinions. Thanks!

javiereguiluz avatar May 31 '23 15:05 javiereguiluz