Problem/Motivation

It is currently not possible to provide different translations for the workflow state "Archive" (noun) and the workflow transition "Archive" (verb). In English, they are the same but not in other languages.

I think core doesn't really expose the transition label anyway at the moment, but https://www.drupal.org/project/issues/moderation_sidebar for example does.

Proposed resolution

Add a translation context so they can be translated separately:

Example:

# PHP Date format string that is translatable.
date_format:
 type: string
 label: 'Date format'
 translatable: true
 translation context: 'PHP date format'

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Berdir created an issue. See original summary.

Gábor Hojtsy’s picture

Makes a lot of sense :)

Version: 8.7.x-dev » 8.8.x-dev

Drupal 8.7.0-alpha1 will be released the week of March 11, 2019, which means new developments and disruptive changes should now be targeted against the 8.8.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Sam152’s picture

Issue tags: +Novice

Adding the novice tag to this.

The schema file in question is located in ./core/modules/workflows/config/schema/workflows.schema.yml. The task is:

  • Add a new item to workflows.state.mapping, underneath label called translation context and assign it to a string "Workflow state label".
  • Add a new item to workflows.transition.mapping, underneath label called translation context and assign it to a string "Workflow transition label".
vadim.hirbu’s picture

Status: Active » Needs review
FileSize
715 bytes

Add translation context for worflow state and workflow transition.

Sam152’s picture

Status: Needs review » Reviewed & tested by the community

Looks great, thanks!

  • larowlan committed 2358d61 on 8.8.x
    Issue #3037906 by vadim.hirbu: Add translation contexts to workflow...
larowlan’s picture

Version: 8.8.x-dev » 8.7.x-dev
Status: Reviewed & tested by the community » Fixed

Committed 2358d61 and pushed to 8.8.x. Thanks!

  • larowlan committed 2f13ee1 on 8.7.x
    Issue #3037906 by vadim.hirbu: Add translation contexts to workflow...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.