I am making a website with Craft 3 and I have some static text that needs to be translated.
I followed Craft's documentation on it. I created my translations/fr/site.php
file and use the {{ 'String'|t }}
format to translate my strings.
I tried everything I found on the web, but I can not make it work. My strings stay in english and doesn't translate. It doesn't even seem to access the site.php
file.
I tried to clear my cache, restart my Docker container, change the folder name to fr-CA
instead of fr
...
I found another member here that had the same problem as me, but he updated Craft and it worked. My Craft configuration is up to date...
Is there something I am missing?
Thank you.
{{ welcome_message|t }}
let's saywelcome_message
isWelcome User!
so you replace the dynamic reference as follows{{ 'Welcome User!'|t }}
--- If that works but your other static translations don't, then there's an error with your input string or your translation array having the wrong text as key. – Campiotti Dec 6 '19 at 10:43