Require context for one word translatables

Created on 22 January 2020, over 4 years ago
Updated 23 January 2023, over 1 year 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 3 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 over 1 year 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.69.0 2024