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
| Comment | File | Size | Author |
|---|---|---|---|
| #12 | add_string_context_to-1027074-12.patch | 2.18 KB | alansaviolobo |
| #10 | add_string_context_to-1027074-10.patch | 2.18 KB | alansaviolobo |
| #9 | drupal-enabled-disabled-context-1027074-9.patch | 4.39 KB | sutharsan |
| #6 | 1027074_shortcut_string_context_plural.patch | 665 bytes | blackdog |
| #3 | shortcut_string_context.patch | 671 bytes | blackdog |
Comments
Comment #1
plachComment #3
blackdog commentedHmm, using the git version, maybe this works better.
Comment #4
gábor hojtsyTagging.
Comment #5
tstoecklerIf I'm understanding this correctly, maybe the context would be better named 'Plural'?
Comment #6
blackdog commentedYou might be right. Are there any guide lines for naming contexts?
Attached patch names the context "Plural".
Comment #7
sutharsan commentedDiscussion 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.
Comment #8
gábor hojtsyWould need to go to Drupal 8 first though.
Comment #9
sutharsan commentedThe 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.
Comment #10
alansaviolobo commentedreroll
Comment #12
alansaviolobo commentedended up exporting a reversed patch.
Comment #13
gábor hojtsyLooks good as per above discussion.
Comment #16
gábor hojtsyLooks like a random fail.
Comment #17
alexpottStrings are not frozen in beta. Committed cf5234a and pushed to 8.0.x. Thanks!