Opened 11 years ago
Closed 11 years ago
#32817 closed defect (bug) (fixed)
Avoid HTML tags in translation strings (WP_Customize_Themes_Section)
| Reported by: | henrikakselsen | Owned by: | SergeyBiryukov |
|---|---|---|---|
| Priority: | normal | Milestone: | 4.3 |
| Component: | Customize | Version: | 4.3 |
| Severity: | normal | Keywords: | has-patch needs-refresh |
| Cc: | Focuses: |
Description
I have setup the translation to only evaluate the text, not the html tags.
Attachments (3)
Change History (11)
#1
@
11 years ago
Hi @henrikakselsen, thanks for submitting your first report and patch!
A couple of points:
- The first pair of
echohave got a pair of()around the content - these are not needed and should be removed. - Instead of using
.to echo, you can use,, which has a slight performance benefit, as it echos the values straight away, instead of building up into a single string first.
If you do a new patch, just upload it as the same name (leave the existing one there for historical reference), and Trac will append a suffix so that it becomes a new file name.
#3
@
11 years ago
- Keywords has-patch added
- Milestone Awaiting Review → 4.3
I've never seen , as opposed to . used in core, but I'm not personally opposed. This looks like it should be fine for 4.3 if it gets committed in a reasonably timely manner. Only possible issue would be if you wanted to move the theme placeholder, but not sure that that would be needed (this isn't my area of expertise).
#4
follow-up:
↓ 5
@
11 years ago
- Milestone 4.3
- Resolution → wontfix
- Status new → closed
We need the placeholder for RTL languages to be able to shift that value around.
Generally it should be avoided to use HTML in translation strings, but things like a single anchor or scenarios like this are exceptions to that rule.
#5
in reply to: ↑ 4
@
11 years ago
- Milestone → 4.3
- Resolution wontfix
- Status closed → reopened
Replying to obenland:
We need the placeholder for RTL languages to be able to shift that value around.
.customize-action is a block element, so there's no need to move the placeholder here: 32817.rtl.png.
Generally, I don't think RTL languages have to shift placeholders often, text direction should take care of that.
Replying to GaryJ:
Instead of using
.to echo, you can use,, which has a slight performance benefit, as it echos the values straight away, instead of building up into a single string first.
I'd suggest leaving this discussion for #31950 and using concatenation for now for consistency with other core files.
#6
follow-up:
↓ 7
@
11 years ago
- Keywords needs-refresh added
I agree that it's safe to remove the placeholder here. We should do the same in WP_Customize_Themes_Section::render().
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
Only translate text portion of strings