Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove all the occurrences of the verb Toggle from translatable strings #66369

Closed
2 of 6 tasks
afercia opened this issue Oct 23, 2024 · 5 comments · Fixed by #66371
Closed
2 of 6 tasks

Remove all the occurrences of the verb Toggle from translatable strings #66369

afercia opened this issue Oct 23, 2024 · 5 comments · Fixed by #66371
Assignees
Labels
l10n Localization and translations best practices [Type] Bug An existing feature does not function as intended

Comments

@afercia
Copy link
Contributor

afercia commented Oct 23, 2024

Description

Similarly to #65983 and #66334

The verb 'toggle' isn't well translatable in many languages and should not be used. See #42492 and similar trac ticket for Core.

Instead of attempting to fix each occurrence at a time, I'd liek to propose to remove all occurrences from the codebase. It would be great to include this best practice in the dev documentation and the design guidelines.
Cc @wordpress/gutenberg-core @WordPress/gutenberg-design

Props to @AhmarZaidi for reporting some of the occurrences on #66319 (comment)

Step-by-step reproduction instructions

  • Run a regex search through the codebase for the verb toggle inside translatable string. Roughly, something like \( '.*toggle.*' \) should be enough.

Screenshots, screen recording, code snippet

No response

Environment info

No response

Please confirm that you have searched existing issues in the repo.

  • Yes

Please confirm that you have tested with all plugins deactivated except Gutenberg.

  • Yes

Please confirm which theme type you used for testing.

  • Block
  • Classic
  • Hybrid (e.g. classic with theme.json)
  • Not sure
@afercia afercia added [Type] Bug An existing feature does not function as intended l10n Localization and translations best practices labels Oct 23, 2024
@afercia afercia self-assigned this Oct 23, 2024
@github-actions github-actions bot added the [Status] In Progress Tracking issues with work in progress label Oct 23, 2024
@mcsf
Copy link
Contributor

mcsf commented Oct 23, 2024

What do you propose we do with the strings?

@afercia
Copy link
Contributor Author

afercia commented Oct 23, 2024

What do you propose we do with the strings?

@mcsf see #66371 and #66372

In general, I would recommend;

  • When the string is used for a label (accessible name of a control) avoid to change the label dynamically e.g. do not switch the lable depending on the state e.g. 'Show settings / Hide settings'. Just keep it short and use 'Settings'. The state should be communicated visually via soem styling and semantically with appropriate ARIA attribtues.
  • When the string is used for a description e.g. the visible text of a keyboard shortcut in the related modal dialog, I would suggest to use the pattern that is already in place for the Settings:
    • Show or hide the Settings sidebar.
    • So that, for example, Toggle distraction free mode. becomes Enter or exit distraction free mode..

@mcsf
Copy link
Contributor

mcsf commented Oct 23, 2024

Thanks, @afercia.

When the string is used for a label […] just keep it short and use 'Settings'

Agreed, makes perfect sense.

When the string is used for a description [...] e.g. "Show or hide the Settings sidebar." [,] "Enter or exit distraction free mode"

I can get behind this, no strong opinion here.

Still, I have mixed feelings about enforcing that the word not be used, even though we can give it a try. This mostly comes down to opinion and life experience (including having worked as a translator in the past), but I believe translators should be given ample room to make the best decisions for their locale. They ought to produce a version that feels natural and clear, and I don't think a weird word like "toggle" would really get in the way of that. To me, the fact that the French, Italian, Swedish, etc. versions — mentioned in prior issues — resorted to constructs like "open/close" is not so much proof that we should get rid of "toggle" so much as proof that translators will find decent solutions for their locales. In other instances, we see that translators have chosen verbs like "permuter", "basculer", "alternar", "comutar" (sampling across a few Romance languages); some of these are more rigid latinates, others are IMO clever images ("basculer"), but all have their merits. The fact that the source used "toggle" wasn't really an obstacle — except for the Greek community, apparently? Finally, if I may be a little pedantic, sometimes these verbs might strike the reader as uncommon, but qualified translators should feel comfortable promoting certain forms if they believe they are correct and clear.

Digression aside, I'll just reiterate that I'm OK with giving this a try!

The verb 'toggle' isn't well translatable in many languages

(I appreciate the sentiment, but have we meaningfully sampled languages beyond a small pocket of Indo-European languages spoken in Europe?)

Finally, let's take a moment to acknowledge how weird the verb "toggle" is even for English. :)

@afercia
Copy link
Contributor Author

afercia commented Oct 24, 2024

@mcsf Thank you for your interesting considerations. In principle, I agree on some of your points which, in a way, aren't new. However, I think it is necessary to have a pragmatic approach. Anyways, I'd suggest to move your considerations to the GitHub discussion I created on July 2022 or, even better, to the Trac ticket that was created on November 2015 to discuss this issue in a broader way.

Re: the pragmatic approach, the following examples are just not a good UI and don't provide a good user experience:

Image

Strings like the following ones are just too long and add too much cognitive load:

  • Attiva/disattiva la visualizzazioen del filtro
  • Attiva/disatitva l'etichetta di ricerca

To me, we can't blame translators for such less than ideal UI. It's the English string that is less than ideal in the first place.

@mcsf
Copy link
Contributor

mcsf commented Oct 24, 2024

Re: the pragmatic approach, the following examples are just not a good UI and don't provide a good user experience:

I completely agree, but I think those are instances where no verb should even be used. Users don't expect their basic inline formatting buttons to say "Enable/disable bold", it's obvious what "Bold" means.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
l10n Localization and translations best practices [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants