Jump to content

translation not working on custom tpl


Recommended Posts

Hi there

I have  a prestashop site in two languages, italian and english

I can translate everything at the back end but I can't get it to work on a tpl I've modified

Can anyone help with this 

thanks a lot

 

http://www.curiosandoingiardino.it/it/shoponline

<script type="text/javascript">
	$(document).ready(function() {
		$('.desplegable').click(function() {
			$(this).next('ul').slideToggle();	
		})
	})
</script>
<div class="content">
	<div id="imagen_principal">
    	<img src="{$img_dir}shoponline.jpg" />
        <p>{l s='TERMS AND CONDITIONS'} : <a href="#">{l s='SALES'}</a>· <a href="#">{l s='SHIPMENT'}</a></p>
    </div>
    <div class="dklampion">
    	<h2>{l s='Negozio Online'}</h2>
        
    <ul id="categorias">
        {assign var='i' value=0}
        {foreach from=$categorias key=indice item=categoria}
       	<li>	
          {if $i lt 4}
            <a href="{$categoria.id}-{$categoria.link}" class="especiales">{$categoria.name}</a>
           {assign var='i' value=$i +1} 
          {elseif $categoria.hijos eq ''}
          {if $i eq 4}<div style="margin-top: 20px;"></div>{assign var='i' value=$i +1}{/if}
          <a href="{$categoria.id}-{$categoria.link}">{$categoria.name}</a>
          {else}
          <span class="desplegable">{$categoria.name}</span>
          <ul class="oculto">
          	{foreach from=$categoria.hijos  item=subcategoria}
            	<li>
                	<a href="{$subcategoria.id}-{$subcategoria.link}">· {$subcategoria.name}</a>
                </li>
            {/foreach}
          </ul>
          {/if}
        </li>
        {/foreach}
        </ul>
                <p style="font-size:16px;"><br  /><br />categoria e ogetti in aggiornamento periodico</p>

    </div>
</div>
Link to comment
Share on other sites

thanks vekia and smartdatasoft

it's part of a custom theme indeed

if I do translate categories they are displayed only in english at the front end

when entering the category pages transaltion work just fine

 

then if I go to translations

I get the famous issue  max_input_vars

and I can't fix it via php.ini or htacces 

how can I access the translation files via ftp?

 

thanks a lot

 

Front Office translations (Language: Italiano (Italian), Theme: giardino)
 
Warning, your PHP configuration limits the maximum number of fields to post in a form: 1000 for max_input_vars.
Please ask your hosting provider to increase the this limit to 1320 at least or edit the translation file manually.
Link to comment
Share on other sites

hello, if it is not possible to increase the max_input_vars  not possible for you to increase the value then follow this instruction which is possible for manually translate.

 

i think it will guide you if you are able to do manually translation

 

http://smartdatasoft.com/prestashop/documentation/sellya/faq.htm#how_to_and_faq_installed_module_by_prestashop

Link to comment
Share on other sites

hello, if it is not possible to increase the max_input_vars  not possible for you to increase the value then follow this instruction which is possible for manually translate.

 

i think it will guide you if you are able to do manually translation

 

http://smartdatasoft.com/prestashop/documentation/sellya/faq.htm#how_to_and_faq_installed_module_by_prestashop

I'll try and edit category translations manually

Link to comment
Share on other sites

hello, if it is not possible to increase the max_input_vars  not possible for you to increase the value then follow this instruction which is possible for manually translate.

 

i think it will guide you if you are able to do manually translation

 

http://smartdatasoft.com/prestashop/documentation/sellya/faq.htm#how_to_and_faq_installed_module_by_prestashop

 

I don't understand what can I change on the php nag files, I don't see how it affects that

tpl

Link to comment
Share on other sites

hello

 

take a look:

 

 

 Personalizzazione%20del%20file%20PHP.jpgPersonalizzazione del file PHP.INI
Lo strumento è utile per personalizzare e quindi adattare in base agli applicativi da utilizzare il file PHP.INI (un file di configurazione in grado di controllare i diversi aspetti del comportamento del linguaggio php). L'apposito pulsante apre una finestra che consente la selezione del PHP.INI  da adattare a secondo dei CMS da installare nel proprio spazio web. (Funzione disponibile solo per chi utilizza il php5).

 

enjoy ;)

Link to comment
Share on other sites

el patron I've already tried that and it didn't work out

 

vekia, I think that's the solution, thanks

 

what I don't understand is why the transation works in the category pages and not with that particular tpl

 

Category list page (tpl above): http://www.curiosandoingiardino.it/en/shoponline

as you can see it displays furniture in english (the other categories are in italian in both languages)

 

Category page works perfectly well: 

http://www.curiosandoingiardino.it/en/12-furniture (english)

http://www.curiosandoingiardino.it/it/12-arredi (italian)

Link to comment
Share on other sites

figured out the max_input_vars at aruba.it by changing php version to PHP5.2.x

 

buy i still can't get the categories translated, evrything else works fine

as you can see I got variables translated but not what is inside foreach

 

first category is the only one translated at the back office (furniture/arredi) it only dispplays the english version, the other ones ara in italian in both languages

category pages work fine

 

http://www.curiosandoingiardino.it/it/shoponline

http://www.curiosandoingiardino.it/en/shoponline

 

http://www.curiosandoingiardino.it/it/12-arredi

 

can anyone help with this?

 

here's the foreach

 

        {foreach from=$categorias item=categoria}<li>	
            <a href="{$categoria.id}-{$categoria.link}">{$categoria.name}</a>
  {/foreach}
Link to comment
Share on other sites

here's the controller file

 

class ShoponlineControllerCore extends FrontController
{
public $php_self = 'shoponline';
 
/**
* Assign template vars related to page content
* @see FrontController::initContent()
*/
public function initContent()
{
parent::initContent();
 
// Cargamos las categorías
$categorias = Category::getCategories();
unset($categorias[0]);
unset($categorias[1]);
 
$categorias_final = array();
foreach ($categorias as $key => $categoria) {
foreach ($categoria as $key2 => $value) {
if ($value['infos']['id_parent'] == 2) {
// Categoria root
$categorias_final[$value['infos']['id_category']]['id'] = $value['infos']['id_category'];
$categorias_final[$value['infos']['id_category']]['link'] = $value['infos']['link_rewrite'];
$categorias_final[$value['infos']['id_category']]['name'] = $value['infos']['name'];
$categorias_final[$value['infos']['id_category']]['hijos'] = '';
} else {
$categorias_final[$value['infos']['id_parent']]['hijos'][$value['infos']['id_category']]['id'] = $value['infos']['id_category'];
$categorias_final[$value['infos']['id_parent']]['hijos'][$value['infos']['id_category']]['link'] = $value['infos']['link_rewrite'];
$categorias_final[$value['infos']['id_parent']]['hijos'][$value['infos']['id_category']]['name'] = $value['infos']['name'];
}
}
}
/*echo "<pre>";
print_r($categorias_final);
echo "</pre>";*/
$this->context->smarty->assign('categorias', $categorias_final);
 
$this->setTemplate(_PS_THEME_DIR_.'shoponline.tpl');
}
}
Link to comment
Share on other sites

×
×
  • Create New...