// fixed parsing and display for back office translations

// die2Exception in AdminTranslationsController
This commit is contained in:
mMarinetti
2011-11-20 23:35:21 +00:00
parent 6d6645b761
commit ac6cc5f13e
2 changed files with 200 additions and 52 deletions
@@ -26,6 +26,7 @@
<h2>{l s='Language'} : {$lang} - {$translation_type}</h2>
{l s='Expressions to translate'} : <b>{$count}</b>. {l s='Click on the titles to open fieldsets'}.<br /><br />
<p>{l s='total missing expresssions:'} {$missing_translations|array_sum} </p>
{$limit_warning}
{if !$suoshin_exceeded}
<form method="post" action="{$url_submit}" class="form">
@@ -36,36 +37,32 @@
<br /><br />
{foreach $tabsArray as $k => $newLang}
{if !empty($newLang)}
{$occurrences = $newLang|array_count_values}
{if isset($occurrences[''])}
{$missing_translations = $occurrences['']}
{else}
{$missing_translations = 0}
{/if}
<fieldset>
<legend style="cursor : pointer" onclick="$('#{$k}-tpl').slideToggle();">{$k} - <font color="blue">{$newLang|count}</font> {l s='expressions'} (<font color="red">{$missing_translations}</font>)</legend>
<div name="{$type}_div" id="{$k}-tpl" style="display:{if $missing_translations}block{else}none{/if}">
<table cellpadding="2">
{foreach $newLang as $key => $value}
<tr>
<td style="width: 40%">{$key|stripslashes}</td>
<td>=
{if $key|strlen < $textarea_sized}
<input type="text"
style="width: 450px"
name="{if $type == 'front' || $type == 'fields'}{$k}_{$key|md5}{else}{$k}{$key|md5}{/if}"
value="{$value|regex_replace:'#"#':'&quot;'|stripslashes}" />
{else}
<textarea rows="{($key|strlen / $textarea_sized)|intval}"
style="width: 450px"
name="{if $type == 'front' || $type == 'fields'}{$k}_{$key|md5}{else}{$k}{$key|md5}{/if}">
{$value|regex_replace:'#"#':'&quot;'|stripslashes}
</textarea>
{/if}
</td>
</tr>
{/foreach}
</table>
<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">
{foreach $newLang as $key => $value}
<tr>
<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"
name="{if in_array($type, array('front', 'fields'))}{$k}_{$key|md5}{else}{$k}{$key|md5}{/if}"
value="{$value|htmlentitiesUTF8}" />
{else}
<textarea rows="{($key|strlen / $textarea_sized)|intval}"
style="width: 450px"
name="{if in_array($type, array('front', 'fields'))}{$k}_{$key|md5}{else}{$k}{$key|md5}{/if}"
>{$value}</textarea>
{/if}
</td>
</tr>
{/foreach}
</table>
</div>
</fieldset><br />
{/if}