Updated: Comment #9

Problem/Motivation

The strings Enabled & Disabled that are used for both single and multiple items. For example status of a checkbox or as the header of a list of shortcut items (Drupal 7) or a list of disable blocks. In Swedish, a list of enabled items is not the same as one enabled item.

Proposed resolution

Add a context to those cases where Enable or Disable are used for multiple items. Enabled and Disabled for single items is used without a context.

Remaining tasks

  • Identify all applicable occurrences in Drupal 8
  • Decide on the right context string
  • Backport to Drupal 7

User interface changes

Properly translated strings.

API changes

None

Comments

plach’s picture

Component: language system » locale.module

Status: Needs review » Needs work

The last submitted patch, shortcut_string_context.patch, failed testing.

blackdog’s picture

Status: Needs work » Needs review
StatusFileSize
new671 bytes

Hmm, using the git version, maybe this works better.

gábor hojtsy’s picture

Issue tags: +string context

Tagging.

tstoeckler’s picture

If I'm understanding this correctly, maybe the context would be better named 'Plural'?

blackdog’s picture

StatusFileSize
new665 bytes

You might be right. Are there any guide lines for naming contexts?
Attached patch names the context "Plural".

sutharsan’s picture

Issue summary: View changes
Status: Needs review » Reviewed & tested by the community

Discussion about guidelines can be found at #1035716: [policy, no patch] Decide and document guidelines for using string context. But IMO practical cases like these are the best fuel for the discussion.
I can't find a better context in this case. The only alternative I could come up with ("multiple enabled", "multiple disabled") is not reusable and doesn't add a lot of information.

gábor hojtsy’s picture

Version: 7.x-dev » 8.x-dev
Status: Reviewed & tested by the community » Patch (to be ported)
Issue tags: +D8MI, +language-ui

Would need to go to Drupal 8 first though.

sutharsan’s picture

Issue summary: View changes
Status: Patch (to be ported) » Needs review
StatusFileSize
new4.39 KB

The original use case is not applicable to Drupal 8, but I searched the code and came with several others (some of which also apply to D7) where Enables and/or Disabled are used for multiple items. I searched the code for 'Enabled', 'Disabled', "Enabled" and "Disabled".
Some examples: Disabled blocks as admin/structure/block, disabled fields at admin/structure/types/manage/article/form-display, enabled languages as admin/config/regional/language/detection.

alansaviolobo’s picture

StatusFileSize
new2.18 KB

reroll

Status: Needs review » Needs work

The last submitted patch, 10: add_string_context_to-1027074-10.patch, failed testing.

alansaviolobo’s picture

Status: Needs work » Needs review
StatusFileSize
new2.18 KB

ended up exporting a reversed patch.

gábor hojtsy’s picture

Status: Needs review » Reviewed & tested by the community

Looks good as per above discussion.

Status: Reviewed & tested by the community » Needs work

The last submitted patch, 12: add_string_context_to-1027074-12.patch, failed testing.

Status: Needs work » Needs review
gábor hojtsy’s picture

Status: Needs review » Reviewed & tested by the community

Looks like a random fail.

alexpott’s picture

Version: 8.0.x-dev » 7.x-dev
Status: Reviewed & tested by the community » Patch (to be ported)

Strings are not frozen in beta. Committed cf5234a and pushed to 8.0.x. Thanks!

  • alexpott committed cf5234a on 8.0.x
    Issue #1027074 by blackdog, alansaviolobo, Sutharsan: Add string context...

  • alexpott committed cf5234a on 8.1.x
    Issue #1027074 by blackdog, alansaviolobo, Sutharsan: Add string context...

  • alexpott committed cf5234a on 8.3.x
    Issue #1027074 by blackdog, alansaviolobo, Sutharsan: Add string context...

  • alexpott committed cf5234a on 8.3.x
    Issue #1027074 by blackdog, alansaviolobo, Sutharsan: Add string context...

  • alexpott committed cf5234a on 8.4.x
    Issue #1027074 by blackdog, alansaviolobo, Sutharsan: Add string context...

  • alexpott committed cf5234a on 8.4.x
    Issue #1027074 by blackdog, alansaviolobo, Sutharsan: Add string context...

Status: Patch (to be ported) » Closed (outdated)

Automatically closed because Drupal 7 security and bugfix support has ended as of 5 January 2025. If the issue verifiably applies to later versions, please reopen with details and update the version.