Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Can't translate "Thank you for shopping at [store:name]. While logged in, you may continue shopping or view your current order status and order history."
I solved this by doing:
uc_cart.module
- $messages['completion_logged_in'] = t('Thank you for shopping at [store:name]. While logged in, you may continue shopping or <a href="[uc_order:url]">view your current order status</a> and order history.');
+ $messages['completion_logged_in'] = t('Thank you for shopping at [store:name]. While logged in, you may continue shopping or <a href="@uc_order">view your current order status</a> and order history.', array("@uc_order" => "[uc_order:url]"));
Comments
Comment #1
longwaveIn 7.x-3.x-dev with the help of i18n and Variable modules you can now translate these messages directly in the admin page. This was changed in #1533286: Add support for Variable module
However we could still change the defaults here, so the messages can be translated by default. I wonder why the [store:name] token is okay here, when the [uc_order:url] one isn't? Or is it because of the double quotes?
Comment #2
zhongguo999999 CreditAttribution: zhongguo999999 commentedNot because of the double quotes.
May be D7 core, I guess.
Because the error is that the submitted string contains disallowed HTML: %string.
Comment #3
longwaveThere is a similar issue open for another string, let's deal with all tokenised strings in the same issue: #1535316: Can't translate "Return to the front page" or other strings containing links to tokens
Comment #4
zhongguo999999 CreditAttribution: zhongguo999999 commentedIn Version 7.x-3.3, I can't translate the string below:
t("Your order is almost complete. Please review the details below and click 'Submit order' if all the information is correct. You may use the 'Back' button to make changes to your order if necessary.");
t('Your order is complete! Your order number is [uc_order:order-number].');
t('Thank you for shopping at [store:name]. While logged in, you may continue shopping or view your current order status and order history.');
t("Thank you for shopping at [store:name]. Your current order has been attached to the account we found matching your e-mail address.\n\nLogin to view your current order status and order history. Remember to login when you make your next purchase for a faster checkout experience!", array('!user_url' => url('user')));
t("Thank you for shopping at [store:name]. A new account has been created for you here that you may use to view your current order status.\n\nLogin to your new account using the following information:\n\nUsername: !new_username\nPassword: !new_password", array('!user_url' => url('user')));
t("Thank you for shopping at [store:name]. A new account has been created for you here that you may use to view your current order status.\n\nYour password and further instructions have been sent to your e-mail address.\n\nFor your convenience, you are already logged in with your newly created account.");
t('Return to the front page.');
My solution: