Reported problem

The string Average: <span !microdata>!stars</span> cannot be translated to another language; a translation like Mitjana: <span !microdata>!stars</span> is rejected with the following message: The submitted string contains disallowed HTML: Mitjana: <span !microdata>!stars</span>.

Implemented solution

The string was replaced with 'Average: !stars'.

CommentFileSizeAuthor
#5 1835476-5.patch844 bytesroderik

Comments

mzwyssig’s picture

Following.

salihcenap’s picture

Following.

torotil’s picture

Project: Voting API » Fivestar
Version: 7.x-2.10 » 7.x-2.x-dev

This seems to be a bug in the fivestar module. A shor grep for "microdata" reveals:

includes/fivestar.theme.inc:262: $output .= '<span class="average-rating">'. t('Average: <span !microdata>!stars</span>', array('!stars' => $average_stars, '!microdata' => $average_rating_microdata)) .'</span>';

hass’s picture

roderik’s picture

Status: Active » Needs review
StatusFileSize
new844 bytes

Luckily,

  • the inner span can be considered 'atomic' (i.e. its order doesn't need to change in other languages)
  • the variables already contain 'safe' values

...so it's not hard to change.

hass’s picture

Status: Needs review » Reviewed & tested by the community

Looks codewise good.

imoreno’s picture

Worked for me. Now i can translate the string.

whiteph’s picture

Issue summary: View changes
Status: Reviewed & tested by the community » Fixed
NStorm’s picture

Version: 7.x-2.x-dev » 7.x-2.0-alpha3
Status: Fixed » Reviewed & tested by the community

Why is this still not in main branch?
After updating to 7.x-2.0-alpha3 I still had to manually fix that issue with patch supplied in this ticket.
Please merge this to next main branch release.

hass’s picture

Version: 7.x-2.0-alpha3 » 7.x-2.x-dev
Status: Reviewed & tested by the community » Fixed
whiteph’s picture

Thanks @hass.

@NStorm, 7.x-2.x-dev is the main branch. 7.x-2.0-alpha3 was a tag that I applied on Feb 1st this year after I became a co-maintainer. It contains just five fixes that been on the dev branch since May 2012. So alpha3 is alpha2 + those five fixes. The current dev version contains 19 fixes applied since alpha3, most of those fixes having been available as patches on Drupal.org for quite some time. I'll be creating a new tag (alpha4 or beta1) soon.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

dercheffe’s picture

Version: 7.x-2.x-dev » 7.x-2.1
Status: Closed (fixed) » Patch (to be ported)

This problem appears still in in my D7 installation where I use version 2.1. I think it's not comitted into version 2.1 or am I wrong?

dercheffe’s picture

Status: Patch (to be ported) » Needs review
roderik’s picture

Issue summary: View changes
Status: Needs review » Closed (fixed)

It is committed to version 2.1. Your includes/fivestar.theme.inc file should contain the green lines, not the red lines, from this link.

This means you should be able to translate the string 'Average: !stars' now.
(And the string in the subject of this page should not be present anymore, or at least it's not used.)

In case you're upgrading from an old version -where the old string is already in your translation system- I can see the confusion, so I added something to the issue summary.