Opened 5 years ago
Last modified 6 weeks ago
#45473 new defect (bug)
Twenty Nineteen: Avoid html code in translatable strings
Reported by: |
|
Owned by: | |
---|---|---|---|
Milestone: | Future Release | Priority: | normal |
Severity: | normal | Version: | |
Component: | Bundled Theme | Keywords: | has-patch 2nd-opinion |
Focuses: | Cc: |
Description
As always only the translatable part should appear for translators to avoid issues.
I came across this one:
<span class="meta-nav">Published in</span><br><span class="post-title">%title</span>
Attachments (6)
Change History (20)
This ticket was mentioned in Slack in #core-themes by kjell. View the logs.
4 years ago
#7
@
4 years ago
- Keywords 2nd-opinion added
Thanks for the report, @Presskopp!
It looks like there's been quite a bit of discussion about the best approach for this issue, shared in Twenty Nineteen GitHub repo, on top of https://github.com/WordPress/twentynineteen/issues/725 shared above:
- https://github.com/WordPress/twentynineteen/pull/274 (looks like the bulk of the conversation happens here)
- https://github.com/WordPress/twentynineteen/pull/733
- https://github.com/WordPress/twentynineteen/pull/734
@kjellr or @allancole -- I'm definitely not up to date where this ended up in Twenty Nineteen. Is there a particular direction that was decided on for HTML in strings marked for translation? From my read it sounds like it may make sense to keep the HTML in some cases, but I could be wrong!
#8
@
4 years ago
- Milestone changed from 5.0.3 to 5.1
It seems like this one could be a bit too involved for 5.0.3, so punting to 5.1.
#9
@
4 years ago
From my read it sounds like it may make sense to keep the HTML in some cases, but I could be wrong!
That's my understanding here too, but I'd defer to the i18n experts.
Regarding @mukesh27's patch above, @grapplerulrich noted that this may not work because some languages may need to have this string rearranged to say "Title published in".
#10
@
4 years ago
- Milestone changed from 5.1 to 5.2
Punting this issue for now, as we figure out exactly what strings need to be updated.
#11
@
4 years ago
Just noting the string in question is not much different from similar "Published in" strings in Twenty Fourteen, Fifteen, and Sixteen, so the issue is not unique to Twenty Nineteen.
#12
@
4 years ago
This still needs work and has not been touched since being punted to 5.2. Moving to Future Release until someone is able to work on this.
@
6 weeks ago
Twenty Nineteen: non-image attachment page has no line break (and no space either) before post title
@
6 weeks ago
Twenty Twenty-One: image attachment template only links the post title, with the parent post text in the article's footer
@
6 weeks ago
Twenty Twenty-One: non-image attachment page uses styling similar to the previous post link but without the SVG
#14
@
6 weeks ago
HTML in a string is sometimes necessary for more accurate translations; [55655] specifically created two of them. Some languages add the title before "Published in" in at least one of the bundled themes. And Kurdish (Kurmanji) includes text outside of either span
tag:
<span class="meta-nav">Di nav</span><br><span class="post-title">%title</span> de hate weşandin
However, I do not like having two different translations for the parent post link, depending on whether the attachment is an image or another type. Both Twenty Nineteen and Twenty Twenty-One have multiple translations, and the styling breaks, too. 45473.1.patch reuses the same string for non-image attachments in Twenty Nineteen, adding the br
tag.
Using 'Published in %s'
for non-image attachment pages in Twenty Twenty-One might require editing both the single.php
template and twenty_twenty_one_entry_meta_footer()
. That could be addressed on another ticket.
I do not find much value in changing the other three themes now. Twenty Fourteen is also inconsistent for different attachment types, though without broken styling. Twenty Fifteen and Twenty Sixteen have consistent links for any attachment type, and the strings are even identical between both of those themes.
Github 725