How do I translate hard coded words in twig file Is there a way to translate hard coded words in twig when selecting a language from the language dropdown? I have used the |t ({{ myword|t }}) function but it doesn't seem to be work when selecting another language.

Is there a way to do this?
{{ myword }} is a variable, not a string. You need to use {{ 'myword'|t }} (with quotes)