Add context to "in" t() function call in LengthUnit.php

Created on 15 June 2020, about 4 years ago
Updated 10 April 2024, 3 months ago

The "in" is translated using Drupal t() function as an ordinary word, not as measurement abbreviation. So it would be good to add context for this translation to translate it separately.
The patch is attached.

πŸ› Bug report
Status

RTBC

Version

1.1

Component

Code

Created by

πŸ‡·πŸ‡ΊRussia Hamulus

Live updates comments and jobs are added and updated live.
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.

  • πŸ‡¨πŸ‡³China kongkx

    I think add context to all unit string is better.

          self::MILLIMETER => t('mm', [], ['context' => 'length unit']),
          self::CENTIMETER => t('cm', [], ['context' => 'length unit']),
          self::METER => t('m', [], ['context' => 'length unit']),
          self::KILOMETER => t('km', [], ['context' => 'length unit']),
          self::INCH => t('in', [], ['context' => 'length unit']),
          self::FOOT => t('ft', [], ['context' => 'length unit']),
          self::NAUTICAL_MILE => t('M', [], ['context' => 'length unit']),
    
Production build 0.69.0 2024