When I was importing translation to Drupal, I get this notice:

25 translation strings were skipped because they contain disallowed HTML.

Cheers
Wojtha

CommentFileSizeAuthor
#6 angle_brackets.patch4.05 KBIsland Usurper

Comments

rszrama’s picture

Interesting... is there a difference between HTML and disallowed HTML? For example, I was under the impression that the proper use of t() when the strings contained a link was something like this:

$output = t('Find more information on the <a href="!url">administrative page</a>.', array('!url' => url('admin')));
Island Usurper’s picture

I bet it has something to do with locale_string_is_safe(). I hadn't heard of this function before this morning, when it was mentioned on the dev list.

I guess fixing this will involve going through all of the .pot files for the bad strings. :(

Island Usurper’s picture

Status: Active » Postponed (maintainer needs more info)

Based on the idea that locale_string_is_safe() is causing that error, can you check some places where I think Ubercart wasn't translated?

Look in the Conditional Actions settings, and add a product weight condition. The select box that lists your products has an option called "<All products>" and it is also mentioned in the description of that field. If these aren't translated, I guess we'll have to figure out how Drupal got around it.

Just had a thought that it might have been the actual translations that were bad. I only found 10 places in the newly extracted strings that used angle brackets badly.

cha0s’s picture

You could try "- All products -", like I think I've seen CCK do.

Island Usurper’s picture

Assigned: Unassigned » Island Usurper
Status: Postponed (maintainer needs more info) » Active

Yeah, taxonomy uses that format, too. I'll write up a quick patch to fix that.

Island Usurper’s picture

Status: Active » Needs review
StatusFileSize
new4.05 KB

There was also malformed HTML in uc_google_checkout.module, so this patch fixes it too.

Island Usurper’s picture

Status: Needs review » Postponed (maintainer needs more info)

I'm going to go ahead and commit the patch from #6, but that doesn't mean it actually fixes the problem. I suspect it's the actual translations, even though they were probably just following the bad HTML in the templates.

rszrama’s picture

Issue tags: +i18n
cha0s’s picture

Well, I tried importing and I didn't get an error.

wojtha, what language did you import to get this error? I'd like to reproduce/fix it.

wojtha’s picture

Hi cha0s,

It was Czech language pack created by translation server (I'm one of the translators...). I can try to generate a new one and upload here if you wish to try it.

cha0s’s picture

I greatly appreciate any file you can provide that will show this bug... I downloaded the czech file from the privnet server... However, all I got was:

* The language Czech has been created and can now be used. More information is available on the help screen.
* 29 translation files imported for the enabled modules.

Island Usurper’s picture

Status: Postponed (maintainer needs more info) » Fixed

Unless we get some more input about something being wrong, I guess this issue is fixed. I noticed that I hadn't committed all of the changes in the patch in #6, but no one seemed to complain before. *shrug*

Status: Fixed » Closed (fixed)
Issue tags: -i18n

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