Discussions

Translation of strings with URL

I am putting the finishing touches on a Drupal Commerce webshop... (@ all contributors... you guys rock!), now one of the main things I need to do is get the translations setup for the front and backend.

When returning to the website after successfully completing a payment there is a text on screen which uses links. Using l10n modules I can not seem to translate those because there are hardcoded links inside the text.

EG:

Return to the front page.

When trying to translate the string Drupal returns a msg that the entered string contains html which is not allowed. My question is if it is possible to change the strings so we can translate them in the usual way.

Posted: Sep 21, 2011

Comments

rfay Randy Fay on September 21, 2011

That string can be configured in the UI (admin/commerce/config/checkout/form/pane/checkout_completion_message) if you have only one language.

When translating for more than one language, the default message is translatable (commerce_checkout_completion_message_default()): t('Your order is number [commerce-order:order-number]. You can view your order on your account page when logged in.'). So you can just translate that as an interface change.

Finally, the *configured* string is a variable, commerce_checkout_completion_message, so you can use the i18n "variable translation" scheme, where you enter the variable name in settings.php and then can translate it in the interface. (I haven't done that in D7; that's the way it worked in i18n in D6)