Rename variable in localization string

Created on 14 November 2022, almost 2 years ago
Updated 23 February 2023, over 1 year ago

https://localize.drupal.org/translate/languages/test/translate?sid=2463898

I just stumbled upon this very good example that nicely illustrates how different approaches are necessary from representatives of both fields:

  • The developer says: “This is an array containing several pieces of data which are IDs, so I call the array as $ids
  • The translator says: “As this variable is called @id so I assume this should be a numeric identification of an item – probably, I hope at least”

Well, not exactly… this variable represents the total sum of all pieces within a batch. Please help translator folks' work by naming variables more meaningfully.

📌 Task
Status

Needs work

Version

1.0

Component

I18n stuff

Created by

🇭🇺Hungary Balu Ertl Budapest 🇪🇺

Live updates comments and jobs are added and updated live.
  • Novice

    It would make a good project for someone who is new to the Drupal contribution process. It's preferred over Newbie.

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.

  • 🇮🇳India urvashi_vora Madhya Pradesh, India

    Hi,
    I have taken a pull of your branch and reviewed the changes.

    The variable "id" is successfully replaced by "count". The changes look great to be merged.

    RTBC++

    Thanks for the work.

  • Status changed to Closed: works as designed over 1 year ago
  • 🇨🇭Switzerland berdir Switzerland

    Well, no, it actually does not represent the count, it really is an ID. we call end() on the ids, which returns the last one in there.

    It's a horrible message and should be replaced with the label or something else, but it's technically correct.

  • Status changed to Needs work over 1 year ago
  • 🇭🇺Hungary Balu Ertl Budapest 🇪🇺

    Thanks to both of you for your time dealing with this issue. However, I have the feeling that the initial pain source had not been addressed at all:

    “[…] Please help translator folks' work by naming variables more meaningfully.”

    @berdir could you please elaborate on the direction in more detail of what piece of the code shall we modify to make the UI string of this message less horrible?

Production build 0.71.5 2024