Please Disable Your Browser Adblock Extension for our site and Refresh This Page!

our ads are user friendly, we do not serve popup ads. We serve responsible ads!

Refresh Page
Skip to main content
On . By CodimTh

In Drupal 8, you can put text in certain defined places in various YML files, and it will be picked up as translatable strings and translated automatically:

Module names and descriptions in *.info.yml files are still found as translatable in /admin/config/regional/translate.

_title (coupled with optional _title_context) key values under the defaults section of *.routing.yml files are found in translatable in /admin/config/regional/translate.

title (coupled with optional title_context) key values in *.links.action.yml*.links.task.yml and *.links.contextual.yml files are found as translatable in /admin/config/regional/translate.

That these strings are found as translatable (and later on t()-ed in the process of handling them) also means that any code generating them dynamically should take care of not translating them too soon.

For example, if you need dynamic titles in your local tasks or actions, extend the base class and override the getTitle() method to run the translation the right way.


Add new comment

Restricted HTML


Page Facebook

Become a patron

If you need some help or you search a Drupal freelancer don't hesitate to contact us.


Contact Us

All the content is FREE but I still need your help


Become a patreon