Require context for one word translatables

Created on 22 January 2020, almost 5 years ago
Updated 23 January 2023, almost 2 years ago

Problem/Motivation

Follow-up to #3064523-11: Add t() context to "Order" string for views module →

When translatable is one word it's often has collisions in meaning, it leads to big confusion for translators

Proposed resolution

Add assert \Drupal\Core\StringTranslation\TranslatableMarkup::__construct() that if $string is one word then $options['context'] must be set.

Remaining tasks

Discuss, patch, commit

User interface changes

no

API changes

TBD

Data model changes

no

Release notes snippet

TBD

📌 Task
Status

Needs work

Version

10.1 ✨

Component
Locale  →

Last updated 5 days ago

Created by

🇫🇷France andypost

Live updates comments and jobs are added and updated live.
  • Needs issue summary update

    Issue summaries save everyone time if they are kept up-to-date. See Update issue summary task instructions.

Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • Status changed to Needs work almost 2 years ago
  • 🇭🇺Hungary Gábor Hojtsy Hungary

    This could also be introduced as a coding standard check? That would be less painful maybe and allow to introduce it without breaking existing things?

Production build 0.71.5 2024