// update localization tab

This commit is contained in:
Sarah Lorenzini
2013-07-30 17:45:50 +02:00
parent faafe4167a
commit 635076a7ad
11 changed files with 281 additions and 257 deletions
@@ -25,27 +25,31 @@
</table>
{if $bulk_actions}
<p>
<div class="row">
{if $bulk_actions|count > 1}
<select id="select_submitBulk" name="select_submitBulk">
{foreach $bulk_actions as $key => $params}
<option value="{$key}">{$params.text}</option>
{/foreach}
</select>
<input type="submit" class="button" name="submitBulk" id="submitBulk" value="{l s='Apply'}" />
<div class="col-lg-11">
<select id="select_submitBulk" name="select_submitBulk">
{foreach $bulk_actions as $key => $params}
<option value="{$key}">{$params.text}</option>
{/foreach}
</select>
</div>
<input type="submit" class="btn btn-primary" name="submitBulk" id="submitBulk" value="{l s='Apply'}" />
{else}
{foreach $bulk_actions as $key => $params}
{if $key == 'affectzone'}
<select id="zone_to_affect" name="zone_to_affect">
{foreach $zones as $z}
<option value="{$z['id_zone']}">{$z['name']}</option>
{/foreach}
</select>
<div class="col-lg-11">
<select id="zone_to_affect" name="zone_to_affect">
{foreach $zones as $z}
<option value="{$z['id_zone']}">{$z['name']}</option>
{/foreach}
</select>
</div>
{/if}
<input type="submit" class="button" name="submitBulk{$key}{$table}" value="{$params.text}" {if isset($params.confirm)}onclick="return confirm('{$params.confirm}');"{/if} />
<input type="submit" class="btn btn-primary" name="submitBulk{$key}{$table}" value="{$params.text}" {if isset($params.confirm)}onclick="return confirm('{$params.confirm}');"{/if} />
{/foreach}
{/if}
</p>
</div>
{/if}
</td>
</tr>
@@ -25,27 +25,29 @@
</table>
{if $bulk_actions}
<p>
{if $bulk_actions|count > 1}
<select id="select_submitBulk" name="select_submitBulk">
{if $bulk_actions|count > 1}
<div class="col-lg-11">
<select id="select_submitBulk" name="select_submitBulk" >
{foreach $bulk_actions as $key => $params}
<option value="{$key}">{$params.text}</option>
{/foreach}
</select>
<input type="submit" class="button" name="submitBulk" id="submitBulk" value="{l s='Apply'}" />
{else}
{foreach $bulk_actions as $key => $params}
{if $key == 'affectzone'}
</div>
<input type="submit" class="btn btn-primary" name="submitBulk" id="submitBulk" value="{l s='Apply'}" />
{else}
{foreach $bulk_actions as $key => $params}
{if $key == 'affectzone'}
<div class="col-lg-11">
<select id="zone_to_affect" name="zone_to_affect">
{foreach $zones as $z}
<option value="{$z['id_zone']}">{$z['name']}</option>
{/foreach}
</select>
{/if}
<input type="submit" class="button" name="submitBulk{$key}{$table}" value="{$params.text}" {if isset($params.confirm)}onclick="return confirm('{$params.confirm}');"{/if} />
{/foreach}
{/if}
</p>
</div>
{/if}
<input type="submit" class="btn btn-primary" name="submitBulk{$key}{$table}" value="{$params.text}" {if isset($params.confirm)}onclick="return confirm('{$params.confirm}');"{/if} />
{/foreach}
{/if}
{/if}
</td>
</tr>
@@ -70,9 +70,9 @@
{l s='Here you can modify translations for every line of code inside PrestaShop.'}<br />
{l s='First, select a section (such as Back Office or Installed modules), and then click the flag representing the language you want to edit.'}
</p>
<input type="hidden" name="controller" value="AdminTranslations" />
<input type="hidden" name="lang" id="translation_lang" value="0" />
<div class="row">
<input type="hidden" name="controller" value="AdminTranslations" />
<input type="hidden" name="lang" id="translation_lang" value="0" />
<label class="control-label col-lg-3">{l s='Type of translation:'}</label>
<div class="col-lg-6">
<select name="type">
@@ -211,8 +211,8 @@
{l s='Choose which theme you\'d like to export your translations to. '}
</p>
<div class="row">
<label class="control-label col-lg-3">{l s='Language:'}</label>
<div class="col-lg-6">
<label class="control-label col-lg-4">{l s='Language:'}</label>
<div class="col-lg-5">
<select name="iso_code">
{foreach $languages as $language}
<option value="{$language['iso_code']}">{$language['name']}</option>
@@ -221,8 +221,8 @@
</div>
</div>
<div class="row">
<label class="control-label col-lg-3">{l s='Choose your theme:'}</label>
<div class="col-lg-6">
<label class="control-label col-lg-4">{l s='Choose your theme:'}</label>
<div class="col-lg-5">
<select name="theme">
{foreach $themes as $theme}
<option value="{$theme->directory}" {if $id_theme_current == $theme->id}selected=selected{/if}>{$theme->name}</option>
@@ -231,7 +231,7 @@
</div>
</div>
<div class="row">
<div class="col-lg-9 pull-right">
<div class="col-lg-8 pull-right">
<input type="submit" class="btn btn-default" name="submitExport" value="{l s='Export'}" />
</div>
</div>
@@ -44,14 +44,13 @@
</div>
{else}
<div class="alert alert-info" style="display:block;">
<div class="alert alert-info">
{l s='Some sentences to translate use this syntax: %s... These are variables, and PrestaShop take care of replacing them before displaying your translation. You must leave these in your translations, and place them appropriately in your sentence.' sprintf='%d, %s, %1$s, %2$d'}
</div><br /><br />
<p>
{l s='Expressions to translate: %d.' sprintf=$count}<br />
{l s='Total missing expresssions: %d.' sprintf=$missing_translations|array_sum}<br />
</p>
</div>
<fieldset>
<p>{l s='Expressions to translate:'} <span class="badge">{l s='%d' sprintf=$count}</span></p>
<p>{l s='Total missing expresssions:'} <span class="badge">{l s='%d' sprintf=$missing_translations|array_sum}</p>
</fieldset>
<script type="text/javascript">
$(document).ready(function(){
@@ -68,11 +67,11 @@
<div id="BoxUseSpecialSyntax">
<div class="alert alert-block">
<p class="syntax">
<p>
{l s='This expression uses this special syntax:'} <span>%d.</span><br />
{l s='You must use this syntax in your translations. Here are several examples:'}
</p>
<ul>
<ul class="nav">
<li><em>There are <strong>%d</strong> products</em> ("<strong>%d</strong>" {l s='will be replaced by a number'}).</li>
<li><em>List of pages in <strong>%s</strong>:</em> ("<strong>%s</strong>" {l s='will be replaced by a string'}).</li>
<li><em>Feature: <strong>%1$s</strong> (<strong>%2$d</strong> values)</em> ("<strong>n$</strong>" {l s='is used for the order of the arguments'}).</li>
@@ -80,28 +79,33 @@
</div>
</div>
<form method="post" id="{$table}_form" action="{$url_submit}" class="form">
{*{$auto_translate}$*}
<input type="hidden" name="lang" value="{$lang}" />
<input type="hidden" name="type" value="{$type}" />
<input type="hidden" name="theme" value="{$theme}" />
<input type="submit" id="{$table}_form_submit_btn" name="submitTranslations{$type|ucfirst}" value="{l s='Update translations'}" class="button" />
<br /><br />
<table cellpadding="0" cellspacing="0" class="table">
{foreach $errorsArray as $key => $value}
<tr {if empty($value.trad)}style="background-color:#FBB"{else}{cycle values='class="alt_row",'}{/if}>
<td>{$key|stripslashes}</td>
<td style="width: 430px">=
<input type="text" name="{$key|md5}" value="{$value.trad|regex_replace:'#"#':'&quot;'|stripslashes}" style="width: 380px">
{if isset($value.use_sprintf) && $value.use_sprintf}
<a class="useSpecialSyntax" title="{l s='This expression uses a special syntax:'} {$value.use_sprintf}" style="cursor:pointer">
<img src="{$smarty.const._PS_IMG_}admin/error.png" alt="{$value.use_sprintf}" />
</a>
{/if}
</td>
</tr>
{/foreach}
</table>
<form method="post" id="{$table}_form" action="{$url_submit}" class="form-horizontal">
<fieldset>
{*{$auto_translate}$*}
<input type="hidden" name="lang" value="{$lang}" />
<input type="hidden" name="type" value="{$type}" />
<input type="hidden" name="theme" value="{$theme}" />
<input type="submit" id="{$table}_form_submit_btn" name="submitTranslations{$type|ucfirst}" value="{l s='Update translations'}" class="btn btn-default" />
<table class="table">
{foreach $errorsArray as $key => $value}
<tr {if empty($value.trad)}style="background-color:#FBB"{else}{cycle values='class="alt_row",'}{/if}>
<td width="40%">{$key|stripslashes}</td>
<td width="40%">
<input type="text" name="{$key|md5}" value="{$value.trad|regex_replace:'#"#':'&quot;'|stripslashes}"' style="width: 450px{if empty($value.trad)};background:#FBB{/if}">
</td>
<td width="18%">
{if isset($value.use_sprintf) && $value.use_sprintf}
<a class="useSpecialSyntax" title="{l s='This expression uses a special syntax:'} {$value.use_sprintf}" style="cursor:pointer">
<img src="{$smarty.const._PS_IMG_}admin/error.png" alt="{$value.use_sprintf}" />
</a>
{/if}
</td>
</tr>
{/foreach}
</table>
</fieldset>
</form>
{/if}
@@ -44,89 +44,91 @@
</div>
{else}
<div class="alert alert-info" style="display:block;">
<ul style="margin-left:30px;list-style-type:disc;">
<div class="alert alert-info">
<ul class="nav">
<li>{l s='Click on titles to open fieldsets'}.</li>
<li>{l s='Some sentences to translate use this syntax: %s... These are variables, and PrestaShop take care of replacing them before displaying your translation. You must leave these in your translations, and place them appropriately in your sentence.' sprintf='%d, %s, %1$s, %2$d'}</li>
</ul>
</div>
<fieldset>
<p>{l s='Expressions to translate:'} <span class="badge">{l s='%d' sprintf=$count}</span></p>
<p>{l s='Total missing expresssions:'} <span class="badge">{l s='%d' sprintf=$missing_translations|array_sum}</p>
</fieldset>
<p>
{l s='Expressions to translate: %d.' sprintf=$count}<br />
{l s='Total missing expresssions: %d.' sprintf=$missing_translations|array_sum}<br />
</p>
<form method="post" id="{$table}_form" action="{$url_submit}" class="form-horizontal">
<fieldset>
{$toggle_button}
<input type="hidden" name="lang" value="{$lang}" />
<input type="hidden" name="type" value="{$type}" />
<input type="hidden" name="theme" value="{$theme}" />
<input type="submit" id="{$table}_form_submit_btn" name="submitTranslations{$type|ucfirst}" value="{l s='Update translations'}" class="btn btn-default" />
<form method="post" id="{$table}_form" action="{$url_submit}" class="form">
{$toggle_button}
<input type="hidden" name="lang" value="{$lang}" />
<input type="hidden" name="type" value="{$type}" />
<input type="hidden" name="theme" value="{$theme}" />
<input type="submit" id="{$table}_form_submit_btn" name="submitTranslations{$type|ucfirst}" value="{l s='Update translations'}" class="button" />
<script type="text/javascript">
$(document).ready(function(){
$('a.useSpecialSyntax').click(function(){
var syntax = $(this).find('img').attr('alt');
$('#BoxUseSpecialSyntax .syntax span').html(syntax+".");
$('#BoxUseSpecialSyntax').toggle(1000);
});
$('#BoxUseSpecialSyntax').click(function(){
$('#BoxUseSpecialSyntax').toggle(1000);
});
});
</script>
<script type="text/javascript">
$(document).ready(function(){
$('a.useSpecialSyntax').click(function(){
var syntax = $(this).find('img').attr('alt');
$('#BoxUseSpecialSyntax .syntax span').html(syntax+".");
$('#BoxUseSpecialSyntax').toggle(1000);
});
$('#BoxUseSpecialSyntax').click(function(){
$('#BoxUseSpecialSyntax').toggle(1000);
});
});
</script>
<div id="BoxUseSpecialSyntax">
<div class="alert alert-block">
<p class="syntax">
{l s='This expression uses this special syntax:'} <span>%d.</span><br />
{l s='You must use this syntax in your translations. Here are several examples:'}
</p>
<ul>
<li><em>There are <strong>%d</strong> products</em> ("<strong>%d</strong>" {l s='will be replaced by a number'}).</li>
<li><em>List of pages in <strong>%s</strong>:</em> ("<strong>%s</strong>" {l s='will be replaced by a string'}).</li>
<li><em>Feature: <strong>%1$s</strong> (<strong>%2$d</strong> values)</em> ("<strong>n$</strong>" {l s='is used for the order of the arguments'}).</li>
</ul>
</div>
</div>
<br /><br />
{foreach $tabsArray as $k => $newLang}
{if !empty($newLang)}
<fieldset>
<legend style="cursor : pointer" onclick="$('#{$k}-tpl').slideToggle();">
{$k} - <font color="blue">{$newLang|count}</font> {l s='expressions'}
{if isset($missing_translations[$k])}(<font color="red">{$missing_translations[$k]} {l s='missing'}</font>){/if}
</legend>
<div name="{$type}_div" id="{$k}-tpl" style="display:{if isset($missing_translations[$k])}block{else}none{/if}">
<table cellpadding="2" cellspacing="0">
{counter start=0 assign=irow}
{foreach $newLang as $key => $value}{counter}
<tr class="{if $irow % 2 == 0}alt_row{/if}">
<td style="width:40%">{$key|stripslashes}</td>
<td>= {*todo : md5 is already calculated in AdminTranslationsController*}
{if $key|strlen < $textarea_sized}
<input type="text" style="width: 450px{if empty($value.trad)};background:#FBB{/if}"
name="{if in_array($type, array('front', 'fields'))}{$k}_{$key|md5}{else}{$k}{$key|md5}{/if}"
value="{$value.trad|regex_replace:'/"/':'&quot;'|stripslashes}"' />
{else}
<textarea rows="{($key|strlen / $textarea_sized)|intval}" style="width: 450px{if empty($value.trad)};background:#FBB{/if}"
name="{if in_array($type, array('front', 'fields'))}{$k}_{$key|md5}{else}{$k}{$key|md5}{/if}"
>{$value.trad|regex_replace:'/"/':'&quot;'|stripslashes}</textarea>
{/if}
{if isset($value.use_sprintf) && $value.use_sprintf}
<a class="useSpecialSyntax" title="{l s='This expression uses a special syntax:'} {$value.use_sprintf}" style="cursor:pointer">
<img src="{$smarty.const._PS_IMG_}admin/error.png" alt="{$value.use_sprintf}" />
</a>
{/if}
</td>
</tr>
{/foreach}
</table>
<div id="BoxUseSpecialSyntax">
<div class="alert alert-block">
<p>
{l s='This expression uses this special syntax:'} <strong>%d.</strong>
{l s='You must use this syntax in your translations. Here are several examples:'}
</p>
<ul class="nav">
<li><em>There are <strong>%d</strong> products</em> ("<strong>%d</strong>" {l s='will be replaced by a number'}).</li>
<li><em>List of pages in <strong>%s</strong>:</em> ("<strong>%s</strong>" {l s='will be replaced by a string'}).</li>
<li><em>Feature: <strong>%1$s</strong> (<strong>%2$d</strong> values)</em> ("<strong>n$</strong>" {l s='is used for the order of the arguments'}).</li>
</ul>
</div>
</fieldset>
{/if}
{/foreach}
</div>
</fieldset>
{foreach $tabsArray as $k => $newLang}
{if !empty($newLang)}
<fieldset>
<h3 onclick="$('#{$k}-tpl').slideToggle();">
{$k} - <span class="badge">{$newLang|count}</span> {l s='expressions'}
{if isset($missing_translations[$k])} <span class="label label-danger">{$missing_translations[$k]} {l s='missing'}</span>{/if}
</h3>
<div name="{$type}_div" id="{$k}-tpl" style="display:{if isset($missing_translations[$k])}block{else}none{/if}">
<table class="table">
{counter start=0 assign=irow}
{foreach $newLang as $key => $value}{counter}
<tr>
<td width="40%">{$key|stripslashes}</td>
<td width="2%">=</td>
<td width="40%"> {*todo : md5 is already calculated in AdminTranslationsController*}
{if $key|strlen < $textarea_sized}
<input type="text" style="width: 450px{if empty($value.trad)};background:#FBB{/if}"
name="{if in_array($type, array('front', 'fields'))}{$k}_{$key|md5}{else}{$k}{$key|md5}{/if}"
value="{$value.trad|regex_replace:'/"/':'&quot;'|stripslashes}"' />
{else}
<textarea rows="{($key|strlen / $textarea_sized)|intval}" style="width: 450px{if empty($value.trad)};background:#FBB{/if}"
name="{if in_array($type, array('front', 'fields'))}{$k}_{$key|md5}{else}{$k}{$key|md5}{/if}"
>{$value.trad|regex_replace:'/"/':'&quot;'|stripslashes}</textarea>
{/if}
</td>
<td width="18%">
{if isset($value.use_sprintf) && $value.use_sprintf}
<a class="useSpecialSyntax" title="{l s='This expression uses a special syntax:'} {$value.use_sprintf}">
<img src="{$smarty.const._PS_IMG_}admin/error.png" alt="{$value.use_sprintf}" />
</a>
{/if}
</td>
</tr>
{/foreach}
</table>
</div>
</fieldset>
{/if}
{/foreach}
</form>
{/if}
@@ -46,56 +46,66 @@
</div>
{else}
<div class="alert alert-info" style="display:block;">
<ul style="margin-left:30px;list-style-type:disc;">
<div class="alert alert-info">
<ul class="nav">
<li>{l s='Click on titles to open fieldsets'}.</li>
<li>{l s='Some sentences to translate use this syntax: %s... These are variables, and PrestaShop take care of replacing them before displaying your translation. You must leave these in your translations, and place them appropriately in your sentence.' sprintf='%d, %s, %1$s, %2$d'}</li>
</ul>
</div><br /><br />
</div>
<form method="post" id="{$table}_form" action="{$url_submit}" class="form">
{$toggle_button}
<input type="hidden" name="lang" value="{$lang}" />
<input type="hidden" name="type" value="{$type}" />
<input type="hidden" name="theme" value="{$theme}" />
<input type="submit" id="{$table}_form_submit_btn" name="submitTranslations{$type|ucfirst}" value="{l s='Update translations'}" class="button" />
<form method="post" id="{$table}_form" action="{$url_submit}" class="form-horizontal">
<fieldset>
{$toggle_button}
<input type="hidden" name="lang" value="{$lang}" />
<input type="hidden" name="type" value="{$type}" />
<input type="hidden" name="theme" value="{$theme}" />
<input type="submit" id="{$table}_form_submit_btn" name="submitTranslations{$type|ucfirst}" value="{l s='Update translations'}" class="button" />
<script type="text/javascript">
$(document).ready(function(){
$('a.useSpecialSyntax').click(function(){
var syntax = $(this).find('img').attr('alt');
$('#BoxUseSpecialSyntax .syntax span').html(syntax+".");
$('#BoxUseSpecialSyntax').toggle(1000);
<script type="text/javascript">
$(document).ready(function(){
$('a.useSpecialSyntax').click(function(){
var syntax = $(this).find('img').attr('alt');
$('#BoxUseSpecialSyntax .syntax span').html(syntax+".");
$('#BoxUseSpecialSyntax').toggle(1000);
});
$('#BoxUseSpecialSyntax').click(function(){
$('#BoxUseSpecialSyntax').toggle(1000);
});
});
$('#BoxUseSpecialSyntax').click(function(){
$('#BoxUseSpecialSyntax').toggle(1000);
});
});
</script>
</script>
<div id="BoxUseSpecialSyntax">
<div class="alert alert-block">
<p class="syntax">
{l s='This expression uses this special syntax:'} <span>%d.</span><br />
{l s='You must use this syntax in your translations. Here are several examples:'}
</p>
<ul>
<li><em>There are <strong>%d</strong> products</em> ("<strong>%d</strong>" {l s='will be replaced by a number'}).</li>
<li><em>List of pages in <strong>%s</strong>:</em> ("<strong>%s</strong>" {l s='will be replaced by a string'}).</li>
<li><em>Feature: <strong>%1$s</strong> (<strong>%2$d</strong> values)</em> ("<strong>n$</strong>" {l s='is used for the order of the arguments'}).</li>
</ul>
<div id="BoxUseSpecialSyntax">
<div class="alert alert-block">
<p>
{l s='This expression uses this special syntax:'} <span>%d.</span><br />
{l s='You must use this syntax in your translations. Here are several examples:'}
</p>
<ul class="nav">
<li><em>There are <strong>%d</strong> products</em> ("<strong>%d</strong>" {l s='will be replaced by a number'}).</li>
<li><em>List of pages in <strong>%s</strong>:</em> ("<strong>%s</strong>" {l s='will be replaced by a string'}).</li>
<li><em>Feature: <strong>%1$s</strong> (<strong>%2$d</strong> values)</em> ("<strong>n$</strong>" {l s='is used for the order of the arguments'}).</li>
</ul>
</div>
</div>
</div>
<h2>{l s='Core emails:'}</h2>
<p class="preference_description">{l s='List of emails in the folder'} <strong>"mails/{$lang|strtolower}/"</strong></p>
{$mail_content}
<h2>{l s='Module emails:'}</h2>
<p class="preference_description">{l s='List of emails in the folder'} <strong>"modules/name_of_module/mails/{$lang|strtolower}/"</strong></p>
{foreach $module_mails as $module_name => $mails}
{$mails['display']}
{/foreach}
</fieldset>
<fieldset>
<h3>
<i class="icon-envelope"></i>
{l s='Core emails:'}
</h3>
<p>{l s='List of emails in the folder'} <strong>"mails/{$lang|strtolower}/"</strong></p>
{$mail_content}
</fieldset>
<fieldset>
<h3>
<i class="icon-envelope"></i>
{l s='Module emails:'}
</h3>
<p>{l s='List of emails in the folder'} <strong>"modules/name_of_module/mails/{$lang|strtolower}/"</strong></p>
{foreach $module_mails as $module_name => $mails}
{$mails['display']}
{/foreach}
</fieldset>
</form>
{/if}
@@ -44,17 +44,16 @@
</div>
{else}
<div class="alert alert-info" style="display:block;">
<ul style="margin-left:30px;list-style-type:disc;">
<div class="alert alert-info">
<ul class="nav">
<li>{l s='Click on titles to open fieldsets'}.</li>
<li>{l s='Some sentences to translate use this syntax: %s... These are variables, and PrestaShop take care of replacing them before displaying your translation. You must leave these in your translations, and place them appropriately in your sentence.' sprintf='%d, %s, %1$s, %2$d'}</li>
</ul>
</div><br /><br />
<p>
{l s='Expressions to translate: %d.' sprintf=$count}<br />
{l s='Total missing expresssions: %d.' sprintf=$missing_translations}<br />
</p>
</div>
<fieldset>
<p>{l s='Expressions to translate:'} <span class="badge">{l s='%d' sprintf=$count}</span></p>
<p>{l s='Total missing expresssions:'} <span class="badge">{l s='%d' sprintf=$missing_translations}</p>
</fieldset>
<script type="text/javascript">
$(document).ready(function(){
@@ -71,7 +70,7 @@
<div id="BoxUseSpecialSyntax">
<div class="alert alert-block">
<p class="syntax">
<p>
{l s='This expression uses this special syntax:'} <span>%d.</span><br />
{l s='You must use this syntax in your translations. Here are several examples:'}
</p>
@@ -83,66 +82,69 @@
</div>
</div>
<form method="post" id="{$table}_form" action="{$url_submit}" class="form">
{$toggle_button}
<input type="hidden" name="lang" value="{$lang}" />
<input type="hidden" name="type" value="{$type}" />
<input type="hidden" name="theme" value="{$theme}" />
<input type="submit" id="{$table}_form_submit_btn" name="submitTranslations{$type|ucfirst}" value="{l s='Update translations'}" class="button" />
<br />
<form method="post" id="{$table}_form" action="{$url_submit}" class="form-horizontal">
{$toggle_button}
<input type="hidden" name="lang" value="{$lang}" />
<input type="hidden" name="type" value="{$type}" />
<input type="hidden" name="theme" value="{$theme}" />
<input type="submit" id="{$table}_form_submit_btn" name="submitTranslations{$type|ucfirst}" value="{l s='Update translations'}" class="button" />
<br />
{foreach $modules_translations as $theme_name => $theme}
{if $theme_name}<h2>&gt;{l s='Theme:'} <a name="{$theme_name}">{$theme_name}</h2>{/if}
{foreach $theme as $module_name => $module}
<h3>{l s='Module:'} <a name="{$module_name}" style="font-style:italic">{$module_name}</a></h3>
{foreach $module as $template_name => $newLang}
{if !empty($newLang)}
{assign var=occurrences value=0}
{foreach $newLang as $key => $value}
{if empty($value['trad'])}{assign var=occurrences value=$occurrences+1}{/if}
{/foreach}
{if $occurrences > 0}
{$missing_translations_module = $occurrences}
{else}
{$missing_translations_module = 0}
{foreach $modules_translations as $theme_name => $theme}
{if $theme_name}<h2>&gt;{l s='Theme:'} <a name="{$theme_name}">{$theme_name}</h2>{/if}
{foreach $theme as $module_name => $module}
<h3>{l s='Module:'} <a name="{$module_name}">{$module_name}</a></h3>
{foreach $module as $template_name => $newLang}
{if !empty($newLang)}
{assign var=occurrences value=0}
{foreach $newLang as $key => $value}
{if empty($value['trad'])}{assign var=occurrences value=$occurrences+1}{/if}
{/foreach}
{if $occurrences > 0}
{$missing_translations_module = $occurrences}
{else}
{$missing_translations_module = 0}
{/if}
<fieldset>
<h3 onclick="$('#{$theme_name}_{$module_name}_{$template_name|replace:'.':'_'}').slideToggle();">{if $theme_name}{$theme_name} - {/if}{$template_name}
<span class="badge">{$newLang|count}</span> {l s='expressions'} <span class="label label-danger">{$missing_translations_module}</span>
</h3>
<div name="{$type}_div" id="{$theme_name}_{$module_name}_{$template_name|replace:'.':'_'}" style="display:{if $missing_translations_module}block{else}none{/if}">
<table class="table">
{foreach $newLang as $key => $value}
<tr>
<td width="40%">{$key|stripslashes}</td>
<td>=</td>
<td>
{* Prepare name string for md5() *}
{capture assign="name"}{strtolower($module_name)}{if $theme_name}_{strtolower($theme_name)}{/if}_{strtolower($template_name)}_{md5($key)}{/capture}
{if $key|strlen < $textarea_sized}
<input type="text"
style="width: 450px{if empty($value.trad)};background:#FBB{/if}"
name="{$name|md5}"
value="{$value.trad|regex_replace:'#"#':'&quot;'|stripslashes}"' />
{else}
<textarea rows="{($key|strlen / $textarea_sized)|intval}"
style="width: 450px{if empty($value.trad)};background:#FBB{/if}"
name="{$name|md5}">{$value.trad|regex_replace:'#"#':'&quot;'|stripslashes}</textarea>
{/if}
</td>
<td>
{if isset($value.use_sprintf) && $value.use_sprintf}
<a class="useSpecialSyntax" title="{l s='This expression uses a special syntax:'} {$value.use_sprintf}">
<img src="{$smarty.const._PS_IMG_}admin/error.png" alt="{$value.use_sprintf}" />
</a>
{/if}
</td>
</tr>
{/foreach}
</table>
</div>
</fieldset>
{/if}
<fieldset>
<legend style="cursor : pointer" onclick="$('#{$theme_name}_{$module_name}_{$template_name|replace:'.':'_'}').slideToggle();">{if $theme_name}{$theme_name} - {/if}{$template_name}
<font color="blue">{$newLang|count}</font> {l s='expressions'} (<font color="red">{$missing_translations_module}</font>)
</legend>
<div name="{$type}_div" id="{$theme_name}_{$module_name}_{$template_name|replace:'.':'_'}" style="display:{if $missing_translations_module}block{else}none{/if}">
<table cellpadding="2">
{foreach $newLang as $key => $value}
<tr>
<td style="width: 40%">{$key|stripslashes}</td>
<td>=
{* Prepare name string for md5() *}
{capture assign="name"}{strtolower($module_name)}{if $theme_name}_{strtolower($theme_name)}{/if}_{strtolower($template_name)}_{md5($key)}{/capture}
{if $key|strlen < $textarea_sized}
<input type="text"
style="width: 450px{if empty($value.trad)};background:#FBB{/if}"
name="{$name|md5}"
value="{$value.trad|regex_replace:'#"#':'&quot;'|stripslashes}" />
{else}
<textarea rows="{($key|strlen / $textarea_sized)|intval}"
style="width: 450px{if empty($value.trad)};background:#FBB{/if}"
name="{$name|md5}">{$value.trad|regex_replace:'#"#':'&quot;'|stripslashes}</textarea>
{/if}
{if isset($value.use_sprintf) && $value.use_sprintf}
<a class="useSpecialSyntax" title="{l s='This expression uses a special syntax:'} {$value.use_sprintf}" style="cursor:pointer">
<img src="{$smarty.const._PS_IMG_}admin/error.png" alt="{$value.use_sprintf}" />
</a>
{/if}
</td>
</tr>
{/foreach}
</table>
</div>
</fieldset><br />
{/if}
{/foreach}
{/foreach}
{/foreach}
{/foreach}
{/if}
{/if}
{/block}