0

According to the documentation, we can use contexts with Drupal.t() since Drupal 8.

Drupal.t('May', {}, {context: "Long month name"}); works fine, but Drupal.t('May', {}, {context: "Abbreviated month name"}); doesn't translate May.

Why?

5
  • 2
    How are you determining it doesn't work?
    – Jaypan
    Jan 20, 2022 at 16:20
  • In French it must return "Mai" ... but it returns "May".
    – fxa
    Jan 20, 2022 at 16:24
  • Have you translated the string in the new context already?
    – leymannx
    Jan 20, 2022 at 16:55
  • Of course... in php the t('May', {}, {context: "Abbreviated month name"}) works fine
    – fxa
    Jan 20, 2022 at 17:07
  • 1
    Please provide more feedback, for example the code, expected output and actual output of what is currently working, the same for what is not working, and maybe a bit more info around it, that helps people here to help you.
    – berliner
    Jan 20, 2022 at 17:11

0

Your Answer

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

Browse other questions tagged or ask your own question.