Translation context for the word event needed

Created on 12 June 2025, 15 days ago

Problem/Motivation

Dear Daniel, dear Jüergen,

This is obvious but we need some translation context here, please.

When I tried out Danse, I noticed that the user interface currently refers to "Events." This terminology is perfectly appropriate in a programmatic context. However, as soon as I enable the German UI translation for Drupal, the interface uses the term "Veranstaltungen" or, in some cases, "Veranstaltung." It appears that there is currently no specific translation context for the word "Event" within this module.

This is a pitty, of course. So maybe we can create a patch for this, please

Steps to reproduce

Install moduile
enable moduile
enable german translation
configure events eg for nodes.

Proposed resolution

wirte a patch to introduce a translation context

Remaining tasks

write some code
copmmit
rerelease

User interface changes

Events have their own trranslation context in that module when this is done and the tranlation wilkl be difeerent form the german word for imin person meetings for the masses.

API changes

none

Data model changes

TBD

🐛 Bug report
Status

Active

Version

2.3

Component

Code

Created by

🇩🇪Germany joachim namyslo Kulmbach 🇩🇪 🇪🇺

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

  • Issue created by @joachim namyslo
  • 🇮🇳India jeeva r

    jeeva r made their first commit to this issue’s fork.

  • Pipeline finished with Success
    15 days ago
    Total: 146s
    #521267
  • 🇩🇪Germany jurgenhaas Gottmadingen

    @jeeva r this MR is not doing what @joachim namyslo is asking for. We don't want to make technical database fields translatable. What the requirement is, that usages of e.g. $this->t('Event') get some context so that translation knows whether the term "event" is an event like a record in a calendar, or an event like here in DANSE, where event refers to a technical term.

    So, that would e.g. the annotation of the file src/Entity/Event.php which contains label = @Translation("Event"). That string "Event" needs the context information. And we need to make sure that we alter all relevant places in the code, where this and similar things are happening.

  • Pipeline finished with Canceled
    11 days ago
    Total: 83s
    #524000
  • 🇮🇳India jeeva r

    @jurgenhaas, I got the issue, thanks.. I had raised the new MR, please review that..

  • Pipeline finished with Success
    11 days ago
    Total: 150s
    #524001
  • 🇩🇪Germany jurgenhaas Gottmadingen

    Wow, that was quick, thank you @jeeva r

    When it comes to "Notification" and "Notification action", we probably don't require context, as they seem to be distinct in their meaning. @joachim namyslo how do you feel about that?

    Regarding "Event", that is certainly not distinct, but the context is certainly not calendar here. So, here are a couple of questions:

    • What's the correct context for event here, is it "technical" or is it more specific like "danse"?
    • Is that event string in the entity annotation covering all occurrences?
    • Are there other terms that need to be addressed?

    I guess, most of this requires expert feedback like from @joachim namyslo, and all of it will then also require testing.

    Leaving this at NR for now, until we got more feedback to see which direction this should take.

  • 🇮🇳India jeeva r

    @jurgenhaas sure.. thank u

  • 🇩🇪Germany joachim namyslo Kulmbach 🇩🇪 🇪🇺

    Hello Jürgen,
    Hello Jeeva,

    that's a very good question.

    Event

    In the case of the word “event,” the context is definitely technical, as in “logging event.” This is because, in simple terms, Danse actually logs everything first in order to inform users about an event that has occurred. This is not specific to Danse.

    Background Information

    However, it is important to know that Drupal uses the wrong word whenever there is no context.

    This is because Drupal tries to use as few translations as possible so as not to bloat the websites' databases with strings translated into languages other than English. So we don't just have reusable fields in Drupal, we actually have reusable translation strings. Wherever this resampling doesn't work, a translation context is needed.

    Of course, you both know this, but you never know who might stumble across this issue one day.

    Nootification and Notification action

    In the case of Notification and Notification action, I didn't find any cases when searching the translation server that would lead me to conclude that we need context here. A notification is always a notification, and a notification action is always something you do with a notification, for example:

    Edit a notification
    Delete a notification
    Create a notification
    etc.

    None of the modules for which there are currently translations on the Drupal translation server use notification action in a different sense, so we don't need any context here.

  • 🇮🇳India jeeva r

    @joachim namyslo, thanks for your information.. I will update the changes..

  • Pipeline finished with Canceled
    10 days ago
    Total: 90s
    #524914
  • Pipeline finished with Success
    10 days ago
    Total: 150s
    #524915
Production build 0.71.5 2024