Multilanguage "no image available" picture

here is first part of how to show “no image available” picture depending on cart language.


  1. replace in core\fn.init.php


Registry::set('config.no_image_path', Registry::get('config.full_host_name') . Registry::get('config.images_path') . 'no_image.gif');


WITH:

Registry::set('config.no_image_path', Registry::get('config.full_host_name') . Registry::get('config.images_path') . 'no_image_'.CART_LANGUAGE.'.gif');

2. rename images\no_image.gif to images\no_image_EN.gif

3. create new image no_image_XX.gif for each language you are using where XX is your language code.



For the second part I definitely need help.



in file skins\basic\admin\common_templates\attach_images.tpl

there is code:

```php {if !“SMARTY_ATTACH_IMAGES_LOADED”|defined}

{assign var=“tmp” value=“SMARTY_ATTACH_IMAGES_LOADED”|define:true}


{/if} ```



we are interested in this line:

$('#' + p.result_ids).replaceWith('');



Unfortunately I don't know javascript and have no idea how to detect current cart language using it.

Could someone help with this?



Please take a note, I am using SEO with “Show language in the URL” disabled, so get language from URL is not an option



Thanks

One way woud be:


$('#' + p.result_ids).replaceWith('');

[quote name=‘tbirnseth’ timestamp=‘1330295471’ post=‘132142’]

One way woud be:

<br />
$('#' + p.result_ids).replaceWith('<img border="0" src="' + images_dir + '/no_image.gif{/literal}_{$smarty.const.CART_LANGUAGE}{literal}" />');<br />

```<br />
[/quote]<br />
<br />
Right, I just realized that this is smarty rendering javacript code, my bad <img src="upload://nMBtKsE7kuDHGvTX96IWpBt1rTb.gif" class="bbc_emoticon" alt=":-("><br />
<br />
So, the second part is for admin side:<br />
1. replace in skins\basic\admin\common_templates\attach_images.tpl<br />
```php
$('#' + p.result_ids).replaceWith('<img border="0" src="' + images_dir + '/no_image.gif" />');
```<br />
WITH:<br />
```php
$('#' + p.result_ids).replaceWith('<img border="0" src="' + images_dir + '/no_image{/literal}_{$smarty.const.CART_LANGUAGE}{literal}.gif" />');
```<br />
<br />
Again, thank you tbirnseth for your help!