For example the following template code:

<h3>{{ 'Translate this'|t }}</h3>

The source language is set to English so the text 'Translate this' can be translated to another language and edited through the UI by an administrator. However, the original string 'Translate this' can not be changed to i.e. 'Translate me' by the administrator. If it needs to be changed it must first be changed in the template and then translated through the interface (even if the translation still applies).

Is there a good solution to translate / edit custom strings like this through the UI? I know of other CMS's who do this by using an ID as placeholder and add translations based on the ID that but I can't find anything about such a solution in Drupal.

Comments

Jaypan’s picture

Go to Admin -> Configuration -> Regional and Language -> Languages, then click 'Edit' in the English row, check the 'Enable interface translation to English' box, and click save.

You should be able to 'translate' English strings now, changing text as necessary through the UI.

markwittens’s picture

Wow, that simple :) Thanks!