Empty cart message is not translatable.

print $configuration['empty_cart_message'];

In dc-ajax-shopping-cart.tpl.php this is not translateble to other languages.

CommentFileSizeAuthor
#11 multilingual-2399273-11.patch1.56 KBnbchip

Comments

subhojit777’s picture

Please provide more description while creating issue. Others can have this issue as well, this will help others.

anikitin35’s picture

print $configuration['empty_cart_message']; in template is not translateble to other languages.

anikitin35’s picture

I just added t to line 590 and the issue is resolved:

$variables['configuration']['empty_cart_message'] = check_plain(variable_get(t('DC_AJAX_ADD_CART_EMPTY_CART_MESSAGE'), t('Shopping cart is empty')));

joe huggans’s picture

Yes I was also having issues using string overrides module for the "shopping cart is empty" text, and this is seemingly why

subhojit777’s picture

@anikitin35 I dont think that will be the correct approach. Does this helps Variable translation.

subhojit777’s picture

Status: Active » Needs work
subhojit777’s picture

Issue summary: View changes
subhojit777’s picture

Assigned: anikitin35 » Unassigned
Status: Needs work » Closed (works as designed)

The empty cart message comes from a variable setting. You can set its value from here admin/commerce/config/ajax-cart. Since this is a variable, you need to enable variable translation to translate empty cart message.

This is not a bug of this module, and it can be fixed by enabling variable translation. Therefore, I am closing this issue.

nbchip’s picture

Status: Closed (works as designed) » Active

As i see in the module there is no implementation of the hook_variable_info() so variables are not translatable by just enabling Variable module.
Or did I misunderstood smtg.

Thx.

subhojit777’s picture

Status: Active » Needs work

good catch! Can you please write a patch for this, please include tests as well :) Thanks

nbchip’s picture

Status: Needs work » Needs review
StatusFileSize
new1.56 KB

Patch without Tests uploaded

  • subhojit777 committed a6c17e4 on 7.x-2.x authored by nbchip
    Issue #2399273 by nbchip, anikitin35: Fixed can't translate a message "...
subhojit777’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

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