0

In my site there are lot of static content such as section headers and random content. I want to translate them.

Can I translate with them {% trans %}my content{% endtrans %} in twig?

If yes, where to insert the translations in the backend?

1 Answer 1

2

Yes - you can do it hardcoded in twig, this can be translated via the user interface translation: /admin/config/regional/translate. The locale module needs to be enabled.

BUT, i would only recommend this method for static content (and maybe random)!

For dynamic content i suggest to use the drupal multilingual feature(s). Start by enabling the module content_translation. Then you can edit a node, and add a translation for it in the backend (node/x/edit). See the docs on d.o. for further information.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.