add translation po file to custom theme

by Matoeil   Last Updated October 11, 2018 15:07 PM

How to add a translation file to a theme?

i did

my_theme.info.yml:

'interface translation project': my_theme
'interface translation server pattern': themes/my_theme/translations/my_theme-%language.po

twig template:

{{ 'status'|t }}

/my_theme/translations/my_theme-fr.po:

msgid "status"
msgstr "statut"

followed by a

drush cr

it does not translate when i am in fr page ( default language being english )



Related Questions






How do I translate hard coded words in twig file

Updated August 02, 2018 17:07 PM