Problem/Motivation
Follow-up to #2566503: [meta] Replace remaining !placeholder for Non-URL HTML outputs only
Follow-up to #2560783: Replace !placeholder with :placeholder for URLs in hook_help() implementations
While discussing the removal of !placeholder from most places core, it was determined that these updates would break already translated strings.
Now that most of these updates have been committed, we should determine the best ways to assist the translations teams or if it is possible to update these strings automatically.
Additionally, it should be noted that !placeholder is replaced with :placeholder in URLs and (generally) @placeholder in non-URL situations.
Also, the scope of these patches grew to include replacing @placeholder with :placeholder in URLs for consistency.
Proposed resolution
Discussions on this issue have already occurred in #2560783: Replace !placeholder with :placeholder for URLs in hook_help() implementations starting around comment #25, but since the breaking of translation strings has a larger scope, moving discussion here.
Some suggestions already provided include:
- Creating a SQL query to replace any placeholders
- Creating an update hook
- Providing a list of updated strings to the translations groups and have them make the updates manually
To facilitate the process, a script has been started to determine and indicate which strings that have been updated affect which languages: https://github.com/justAChris/DrupalPlaceholderTranslations
Additionally, the committed patches affecting translated strings are being parsed to determine which strings have changed. These results will be provided soon.
Remaining tasks
| Comment | File | Size | Author |
|---|---|---|---|
| #11 | coreBeta15overview.txt | 5.96 KB | justachris |
| #10 | translated-strings-original.txt | 85.82 KB | justachris |
| #10 | 2506427-combined-translation-breaks.txt | 179.35 KB | justachris |
| #9 | 2572771-additional-translation-breaks.txt | 1.46 KB | justachris |
| #8 | 2571935-2572597-views.inc-mail-translations.txt | 2.1 KB | justachris |
Comments
Comment #2
justachris commentedThe current list of strings updated in #2566503: [meta] Replace remaining !placeholder for Non-URL HTML outputs only, with the associated child issue and patch link. List indicates the original string (-) and what the string became after the patch(+).
Comment #3
justachris commentedThis should be the list from #2560783: Replace !placeholder with :placeholder for URLs in hook_help() implementations, parsed by script this time.
Comment #4
justachris commentedA few of the orderings got flipped
Comment #5
justachris commentedParsed list of strings from #2570355: Replace remaining !placeholder and @placeholder with :placeholder for URLs
Comment #6
justachris commentedList of updated strings from #2506479: Replace !placeholder with @placeholder for non URLs in t() in Views, except for t() output that is used as an attribute value and #2572599: Replace !placeholder with @placeholder in a few remaining places
Comment #7
lomo commentedThere are other such issues which make "trivial" changes to strings, e.g. https://www.drupal.org/node/2551453, which only changes occurrences of "e-mail" to "email". Clearly the .po files could just be updated with the same change and prevent translations getting "orphaned" and need for re-translation. I've seen some other "word inconsistencies" and grammar issues that I'd love to fix before string freeze, but I'd like to also track them. I've mentioned that issue in private with justAChris, but am hesitant to create a ticket/patch until we have further discussed how to deal with this so that it doesn't just make a lot more work for translators (the change I'm talking about would probably not require any changes to translated strings, whatsoever, as long as the original string is simply replaced in all .po files).
Comment #8
justachris commented@LoMo opened #2574981: Fix grammar ("an URL" should be "a URL") and consistent use of URL (not "url" / "Url") in documentation only, part 1 for concerns about similar translation replacements. Hoping that lessons learned here can help with translation cleanup resulting from other patches.
Added !placeholder string updates from #2571935: Fix use of !placeholder for imploding in views.views.inc and #2572597: Replace !placeholder with @placeholder in mail code. Note that the views.views.inc is a weak example since the placeholder is removed from t() and appended outside.
Comment #9
justachris commentedSome additional !placeholder string updates, missed earlier or committed more recently.
Comment #10
justachris commentedCombined all of the string updates from all commited children of #2506427: [meta] !placeholder causes strings to be escaped and makes the sanitization API harder to understand into one file. Only a few occurrences of !placeholder in javascript files are still being worked on. This combination should include all of the above files.
Additionally, parsed this combined file to show only deletions, which represent strings as they should appear in the current translation files. Duplicates should already be removed.
Comment #11
justachris commentedRan the list of original strings across all of the translation files for Drupal 8.0.0-beta16. Choose beta 15 instead of beta 16 since many of the strings are no longer in the translation files in beta 16. Additionally, some of these have been resolved in the beta 16 translation files. I've attached the overview results as coreBeta15overview.txt, but the details for each language as well as the scripts and source files used to create this are on github: https://github.com/justAChris/DrupalPlaceholderTranslations
Added a wrapper script to iterate through a set of languages including downloading the translation files from the server.
Comment #25
smustgrave commentedThank you for creating this issue to improve Drupal.
We are working to decide if this task is still relevant to a currently supported version of Drupal. There hasn't been any discussion here for over 8 years which suggests that this has either been implemented or is no longer relevant. Your thoughts on this will allow a decision to be made.
Since we need more information to move forward with this issue, the status is now Postponed (maintainer needs more info). If we don't receive additional information to help with the issue, it may be closed after three months.
Thanks!
Comment #26
smustgrave commentedWanted to bump 1 more time if still valid.