Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 293910

The word "Second" needs translation context

$
0
0

Problem/Motivation

The string "second" in English can mean two different things:
- Unit of time (second, minute, hour)
- Order indicator (first, second, third).

In some languages, such as German, the word "second" is translated differently depending on which meaning it has -- "Sekunde" for the time unit, and "zweite/r/s" for second place.

In addition to that it depends on the noun's grammatical gender to use "zweiter" (m), "zweite" (f), or "zweites" (n).

Examples:

  • masculinum: second block - "zweiter Block"
  • femininum: second region - "zweite Region"
  • neutrum: second field - "zweites Feld"

Therefore 3 contexts would be ideal.

So, when it is used in t() in Drupal, it needs translation context. See
https://api.drupal.org/api/drupal/core%21lib%21Drupal%21Core%21Language%...
for information about string context (scroll down the page to the section about context).

Currently, there is no translation context for this word in Drupal.

Proposed resolution

Add a context to all uses of the word "Second" in t(), where it might not be clear whether it means a time unit or an ordering.

Remaining tasks

  1. Identify all applicable occurrences in Drupal 8
  2. Decide on the right context string
  3. Backport to Drupal 7 and to other projects

For the first task, we are looking for the bare word "Second". For instance, this string does not need context:

t('Second item')

because it is pretty clear that it means second in order. But t('Second') by itself does need context. Also,

t('Seconds'),

does not need context, because it is plural and should be the unit of time in this case.

User interface changes

The string "Second" will be properly translatable in all contexts in all languages.

API changes

None.

Data model changes

None.

Release notes snippet


Viewing all articles
Browse latest Browse all 293910

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>