Move untranslated strings into data-i18n
attributes
#8874
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Closes #8848.
Fix. Makes string translation possible by internationalizing and moving text from JavaScript to HTML.
Technical
Very simple and easy to replicate in similar PR's! Of the various
data-i18n
examples in the codebase, the one I liked most and went with involves just:data-i18n="$json_encode(i18n_strings)"
data-i18n
attribute:messages.pot
file using the relevant Docker command to keep everything up to dateNote: There's a currently un-used string -- "Please enter a valid URL." -- added to the
data-i18n
forweb.html
to prep for that string's addition as part of #8871.Testing
Previously untranslated strings like "Please choose an image or provide a URL" should appear in the
messages.pot
file.Stakeholders
@jimchamp