HTML in translation

Pixelstyle - June 21, 2009 - 13:55
Project:ecard
Version:6.x-1.6
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:active
Description

The confirmation message for a sent e-card contains html. If I try to translate the strings (there are actually two string cut in half on a link) Drupal tells me it contains html which is not allowed.

Can the two strings just become one and implement the html in another way?

#1

Eric_A - June 26, 2009 - 08:45

I too ran into this today. I needed a custom Dutch text.

This code works for me (ecard.module):

  drupal_set_message(t('Your message has been sent and a copy is stored for your reference.<br />you can view the copy <a href="@card_copy_url">here</a>', array('@card_copy_url' => $card_copy_url)));

Original code:
  drupal_set_message(t("Your message has been sent and a copy is stored for your reference.<br />you can view the copy <a href='") . $card_copy_url . t("'>here</a>"));

There is an example just like this here: http://api.drupal.org/api/function/t/6

#2

Pixelstyle - August 18, 2009 - 08:02

Works great! thanks!

 
 

Drupal is a registered trademark of Dries Buytaert.