Impossible to translate "ago" on the list of private messages

Created on 21 December 2023, 12 months ago
Updated 2 August 2024, 5 months ago

Problem/Motivation

Currently, when we have a multilingual site we can't translate "Future format/Past format" for timestamp_ago formatter on the preview page of the private message list:

Steps to reproduce

Add a patch where FormattableMarkup is replaced with TranslatableMarkup that fixes the issue

πŸ› Bug report
Status

Needs work

Version

12.0

Component

Code (back-end)

Created by

πŸ‡ΊπŸ‡¦Ukraine SV

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

Comments & Activities

  • Issue created by @SV
  • Status changed to Needs work 12 months ago
  • πŸ‡³πŸ‡±Netherlands kingdutch

    Note that the patch failed testing (and the way it's currently written won't actually allow it to be picked up by the translation tools for localize.drupal.org so https://www.drupal.org/project/drupal/issues/3410052 πŸ› Impossible to translate "ago" for "timestamp_ago" formatter Active also still needs work).

  • πŸ‡―πŸ‡΅Japan ultrabob Japan

    The status of how to do it via UI is still unclear, and the github issue has been closed, saying that there are details in a JIRA ticket. Here is how I accomplished the translation for french using the config files:

    Create a new file called core.entity_view_display.private_message.private_message.inbox.yml in your default config/language/<langcode_here> directory. In my case, the contents of this file are:

    langcode: fr
    content:
      created:
        settings:
          past_format: 'il y a @interval'

    Make sure to update the langcode value if you are translating a different language.

    Create a new file called core.entity_view_display.private_message.private_message.default.yml in the same directory. Similarly, my contents were:

    content:
      created:
        settings:
          past_format: 'il y a @interval'

    Import config, and the private messages interface should be translated properly. I did not translate the future_format because I never expect to receive a private message from the future. You can translate that by adding the future_format key just above the past_format key.

Production build 0.71.5 2024