Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
By jberiksen on
In my language danish the word order is translated different dependens on the meaning.
Eg.
order -> rækkefølge
order -> ordre
order -> kommando
Is there a way to translate the word different dependens on the context or page?
Comments
Words aren't translated in
Words aren't translated in Drupal, strings are. So you can translate the string however you want.
Although D8 may be different, I haven't looked into it. You didn't say what version of Drupal.
You can however add context to translations if necessary. Just pass the context key for the third argument in the t() function: https://api.drupal.org/api/drupal/includes%21bootstrap.inc/function/t/7.x