[-] BO : fix #PSCFV-2366 : check if an sentence use an specific syntax
This commit is contained in:
+46
-11
@@ -28,15 +28,6 @@
|
||||
|
||||
{block name="override_tpl"}
|
||||
|
||||
<div class="hint" style="display:block;">
|
||||
{l s='Some sentences to translate uses this syntax: %s...: You must let it in your translations.' 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>
|
||||
|
||||
{if $post_limit_exceeded}
|
||||
<div class="warn">
|
||||
{if $limit_warning['error_type'] == 'suhosin'}
|
||||
@@ -53,6 +44,43 @@
|
||||
{l s='%s at least or edit the translation file manually.' sprintf=$limit_warning['needed_limit']}
|
||||
</div>
|
||||
{else}
|
||||
|
||||
<div class="hint" style="display:block;">
|
||||
{l s='Some sentences to translate uses this syntax: %s...: You must let it in your translations.' 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>
|
||||
|
||||
<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="warn">
|
||||
<p class="syntax">
|
||||
{l s='This expression uses this special syntax:'} <span>%d</span><br />
|
||||
{l s='You must use this syntax in your tanslations. Here are several examples of use:'}
|
||||
</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>
|
||||
|
||||
<form method="post" id="{$table}_form" action="{$url_submit}" class="form">
|
||||
{*{$auto_translate}$*}
|
||||
<input type="hidden" name="lang" value="{$lang}" />
|
||||
@@ -62,9 +90,16 @@
|
||||
<br /><br />
|
||||
<table cellpadding="0" cellspacing="0" class="table">
|
||||
{foreach $errorsArray as $key => $value}
|
||||
<tr {if empty($value)}style="background-color:#FBB"{else}{cycle values='class="alt_row",'}{/if}>
|
||||
<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|regex_replace:'#"#':'"'|stripslashes}" style="width: 380px"></td>
|
||||
<td style="width: 430px">=
|
||||
<input type="text" name="{$key|md5}" value="{$value.trad|regex_replace:'#"#':'"'|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>
|
||||
|
||||
+50
-16
@@ -28,18 +28,6 @@
|
||||
|
||||
{block name="override_tpl"}
|
||||
|
||||
<div class="hint" style="display:block;">
|
||||
<ul style="margin-left:30px;list-style-type:disc;">
|
||||
<li>{l s='Click on the titles to open fieldsets'}.</li>
|
||||
<li>{l s='Some sentences to translate uses this syntax: %s...: You must let it in your translations.' 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|array_sum}<br />
|
||||
</p>
|
||||
|
||||
{if $post_limit_exceeded}
|
||||
<div class="warn">
|
||||
{if $limit_warning['error_type'] == 'suhosin'}
|
||||
@@ -56,12 +44,53 @@
|
||||
{l s='%s at least or edit the translation file manually.' sprintf=$limit_warning['needed_limit']}
|
||||
</div>
|
||||
{else}
|
||||
|
||||
<div class="hint" style="display:block;">
|
||||
<ul style="margin-left:30px;list-style-type:disc;">
|
||||
<li>{l s='Click on the titles to open fieldsets'}.</li>
|
||||
<li>{l s='Some sentences to translate uses this syntax: %s...: You must let it in your translations.' 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|array_sum}<br />
|
||||
</p>
|
||||
|
||||
<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>
|
||||
|
||||
<div id="BoxUseSpecialSyntax">
|
||||
<div class="warn">
|
||||
<p class="syntax">
|
||||
{l s='This expression uses this special syntax:'} <span>%d</span><br />
|
||||
{l s='You must use this syntax in your tanslations. Here are several examples of use:'}
|
||||
</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)}
|
||||
@@ -78,13 +107,18 @@
|
||||
<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)};background:#FBB{/if}"
|
||||
<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|regex_replace:'/"/':'"'|stripslashes}" />
|
||||
value="{$value.trad|regex_replace:'/"/':'"'|stripslashes}" />
|
||||
{else}
|
||||
<textarea rows="{($key|strlen / $textarea_sized)|intval}" style="width: 450px{if empty($value)};background:#FBB{/if}"
|
||||
<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|regex_replace:'/"/':'"'|stripslashes}</textarea>
|
||||
>{$value.trad|regex_replace:'/"/':'"'|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>
|
||||
|
||||
+7
-7
@@ -28,13 +28,6 @@
|
||||
|
||||
{block name="override_tpl"}
|
||||
|
||||
<div class="hint" style="display:block;">
|
||||
<ul style="margin-left:30px;list-style-type:disc;">
|
||||
<li>{l s='Click on the titles to open fieldsets'}.</li>
|
||||
<li>{l s='Some sentences to translate uses this syntax: %s...: You must let it in your translations.' sprintf='%d, %s, %1$s, %2$d'}</li>
|
||||
</ul>
|
||||
</div><br /><br />
|
||||
|
||||
{$tinyMCE}
|
||||
|
||||
{if $post_limit_exceeded}
|
||||
@@ -53,6 +46,13 @@
|
||||
{l s='%s at least or edit the translation file manually.' sprintf=$limit_warning['needed_limit']}
|
||||
</div>
|
||||
{else}
|
||||
|
||||
<div class="hint" style="display:block;">
|
||||
<ul style="margin-left:30px;list-style-type:disc;">
|
||||
<li>{l s='Click on the titles to open fieldsets'}.</li>
|
||||
</ul>
|
||||
</div><br /><br />
|
||||
|
||||
<form method="post" id="{$table}_form" action="{$url_submit}" class="form">
|
||||
{$toggle_button}
|
||||
<input type="hidden" name="lang" value="{$lang}" />
|
||||
|
||||
+55
-19
@@ -28,18 +28,6 @@
|
||||
|
||||
{block name="override_tpl"}
|
||||
|
||||
<div class="hint" style="display:block;">
|
||||
<ul style="margin-left:30px;list-style-type:disc;">
|
||||
<li>{l s='Click on the titles to open fieldsets'}.</li>
|
||||
<li>{l s='Some sentences to translate uses this syntax: %s...: You must let it in your translations.' 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>
|
||||
|
||||
{if $post_limit_exceeded}
|
||||
<div class="warn">
|
||||
{if $limit_warning['error_type'] == 'suhosin'}
|
||||
@@ -56,6 +44,46 @@
|
||||
{l s='%s at least or edit the translation file manually.' sprintf=$limit_warning['needed_limit']}
|
||||
</div>
|
||||
{else}
|
||||
|
||||
<div class="hint" style="display:block;">
|
||||
<ul style="margin-left:30px;list-style-type:disc;">
|
||||
<li>{l s='Click on the titles to open fieldsets'}.</li>
|
||||
<li>{l s='Some sentences to translate uses this syntax: %s...: You must let it in your translations.' 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>
|
||||
|
||||
<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="warn">
|
||||
<p class="syntax">
|
||||
{l s='This expression uses this special syntax:'} <span>%d</span><br />
|
||||
{l s='You must use this syntax in your tanslations. Here are several examples of use:'}
|
||||
</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>
|
||||
|
||||
<form method="post" id="{$table}_form" action="{$url_submit}" class="form">
|
||||
{$toggle_button}
|
||||
<input type="hidden" name="lang" value="{$lang}" />
|
||||
@@ -70,9 +98,12 @@
|
||||
<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)}
|
||||
{$occurrences = $newLang|array_count_values}
|
||||
{if isset($occurrences[''])}
|
||||
{$missing_translations_module = $occurrences['']}
|
||||
{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}
|
||||
@@ -90,13 +121,18 @@
|
||||
{capture assign="name"}{strtolower($module_name)}_{strtolower($theme_name)}_{strtolower($template_name)}_{md5($key)}{/capture}
|
||||
{if $key|strlen < $textarea_sized}
|
||||
<input type="text"
|
||||
style="width: 450px{if empty($value)};background:#FBB{/if}"
|
||||
style="width: 450px{if empty($value.trad)};background:#FBB{/if}"
|
||||
name="{$name|md5}"
|
||||
value="{$value|regex_replace:'#"#':'"'|stripslashes}" />
|
||||
value="{$value.trad|regex_replace:'#"#':'"'|stripslashes}" />
|
||||
{else}
|
||||
<textarea rows="{($key|strlen / $textarea_sized)|intval}"
|
||||
style="width: 450px{if empty($value)};background:#FBB{/if}"
|
||||
name="{$name|md5}">{$value|regex_replace:'#"#':'"'|stripslashes}</textarea>
|
||||
style="width: 450px{if empty($value.trad)};background:#FBB{/if}"
|
||||
name="{$name|md5}">{$value.trad|regex_replace:'#"#':'"'|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>
|
||||
|
||||
@@ -709,16 +709,17 @@ class AdminTranslationsControllerCore extends AdminController
|
||||
if (!in_array($module_key, $array_check_duplicate))
|
||||
{
|
||||
$array_check_duplicate[] = $module_key;
|
||||
if (!isset($this->modules_translations[$theme_name][$module_name][$template_name][$key]))
|
||||
if (!isset($this->modules_translations[$theme_name][$module_name][$template_name][$key]['trad']))
|
||||
$this->total_expression++;
|
||||
|
||||
if (array_key_exists($module_key, $GLOBALS[$name_var]))
|
||||
$this->modules_translations[$theme_name][$module_name][$template_name][$key] = html_entity_decode($GLOBALS[$name_var][$module_key], ENT_COMPAT, 'UTF-8');
|
||||
$this->modules_translations[$theme_name][$module_name][$template_name][$key]['trad'] = html_entity_decode($GLOBALS[$name_var][$module_key], ENT_COMPAT, 'UTF-8');
|
||||
else
|
||||
{
|
||||
$this->modules_translations[$theme_name][$module_name][$template_name][$key] = '';
|
||||
$this->modules_translations[$theme_name][$module_name][$template_name][$key]['trad'] = '';
|
||||
$this->missing_translations++;
|
||||
}
|
||||
$this->modules_translations[$theme_name][$module_name][$template_name][$key]['use_sprintf'] = $this->checkIfKeyUseSprintf($key);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1336,6 +1337,19 @@ class AdminTranslationsControllerCore extends AdminController
|
||||
return $return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Find sentence which use %d, %s, %%, %1$d, %1$s...
|
||||
*
|
||||
* @param $key : english sentence
|
||||
* @return array|bool return list of matches
|
||||
*/
|
||||
public function checkIfKeyUseSprintf($key)
|
||||
{
|
||||
if (preg_match_all('#(?:%%|%(?:[0-9]+\$)?[+-]?(?:[ 0]|\'.)?-?[0-9]*(?:\.[0-9]+)?[bcdeufFosxX])#', $key, $matches))
|
||||
return implode(', ', $matches[0]);
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method generate the form for front translations
|
||||
*/
|
||||
@@ -1380,18 +1394,19 @@ class AdminTranslationsControllerCore extends AdminController
|
||||
{
|
||||
// Caution ! front has underscore between prefix key and md5, back has not
|
||||
if (isset($GLOBALS[$name_var][$prefix_key.'_'.md5($key)]))
|
||||
$new_lang[$key] = stripslashes(html_entity_decode($GLOBALS[$name_var][$prefix_key.'_'.md5($key)], ENT_COMPAT, 'UTF-8'));
|
||||
$new_lang[$key]['trad'] = stripslashes(html_entity_decode($GLOBALS[$name_var][$prefix_key.'_'.md5($key)], ENT_COMPAT, 'UTF-8'));
|
||||
else
|
||||
{
|
||||
if (!isset($new_lang[$key]))
|
||||
if (!isset($new_lang[$key]['trad']))
|
||||
{
|
||||
$new_lang[$key] = '';
|
||||
$new_lang[$key]['trad'] = '';
|
||||
if (!isset($missing_translations_front[$prefix_key]))
|
||||
$missing_translations_front[$prefix_key] = 1;
|
||||
else
|
||||
$missing_translations_front[$prefix_key]++;
|
||||
}
|
||||
}
|
||||
$new_lang[$key]['use_sprintf'] = $this->checkIfKeyUseSprintf($key);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1453,18 +1468,19 @@ class AdminTranslationsControllerCore extends AdminController
|
||||
{
|
||||
// Caution ! front has underscore between prefix key and md5, back has not
|
||||
if (isset($GLOBALS[$name_var][$prefix_key.md5($key)]))
|
||||
$tabs_array[$prefix_key][$key] = stripslashes(html_entity_decode($GLOBALS[$name_var][$prefix_key.md5($key)], ENT_COMPAT, 'UTF-8'));
|
||||
$tabs_array[$prefix_key][$key]['trad'] = stripslashes(html_entity_decode($GLOBALS[$name_var][$prefix_key.md5($key)], ENT_COMPAT, 'UTF-8'));
|
||||
else
|
||||
{
|
||||
if (!isset($tabs_array[$prefix_key][$key]))
|
||||
if (!isset($tabs_array[$prefix_key][$key]['trad']))
|
||||
{
|
||||
$tabs_array[$prefix_key][$key] = '';
|
||||
$tabs_array[$prefix_key][$key]['trad'] = '';
|
||||
if (!isset($missing_translations_back[$prefix_key]))
|
||||
$missing_translations_back[$prefix_key] = 1;
|
||||
else
|
||||
$missing_translations_back[$prefix_key]++;
|
||||
}
|
||||
}
|
||||
$tabs_array[$prefix_key][$key]['use_sprintf'] = $this->checkIfKeyUseSprintf($key);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1484,18 +1500,19 @@ class AdminTranslationsControllerCore extends AdminController
|
||||
{
|
||||
// Caution ! front has underscore between prefix key and md5, back has not
|
||||
if (isset($GLOBALS[$name_var][$prefix_key.md5($key)]))
|
||||
$tabs_array[$prefix_key][$key] = stripslashes(html_entity_decode($GLOBALS[$name_var][$prefix_key.md5($key)], ENT_COMPAT, 'UTF-8'));
|
||||
$tabs_array[$prefix_key][$key]['trad'] = stripslashes(html_entity_decode($GLOBALS[$name_var][$prefix_key.md5($key)], ENT_COMPAT, 'UTF-8'));
|
||||
else
|
||||
{
|
||||
if (!isset($tabs_array[$prefix_key][$key]))
|
||||
if (!isset($tabs_array[$prefix_key][$key]['trad']))
|
||||
{
|
||||
$tabs_array[$prefix_key][$key] = '';
|
||||
$tabs_array[$prefix_key][$key]['trad'] = '';
|
||||
if (!isset($missing_translations_back[$prefix_key]))
|
||||
$missing_translations_back[$prefix_key] = 1;
|
||||
else
|
||||
$missing_translations_back[$prefix_key]++;
|
||||
}
|
||||
}
|
||||
$tabs_array[$prefix_key][$key]['use_sprintf'] = $this->checkIfKeyUseSprintf($key);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1551,18 +1568,19 @@ class AdminTranslationsControllerCore extends AdminController
|
||||
$trans_key = $prefix_key.md5($english_string);
|
||||
|
||||
if (isset($GLOBALS[$name_var][$trans_key]))
|
||||
$new_lang[$english_string] = html_entity_decode($GLOBALS[$name_var][$trans_key], ENT_COMPAT, 'UTF-8');
|
||||
$new_lang[$english_string]['trad'] = html_entity_decode($GLOBALS[$name_var][$trans_key], ENT_COMPAT, 'UTF-8');
|
||||
else
|
||||
{
|
||||
if (!isset($new_lang[$english_string]))
|
||||
if (!isset($new_lang[$english_string]['trad']))
|
||||
{
|
||||
$new_lang[$english_string] = '';
|
||||
$new_lang[$english_string]['trad'] = '';
|
||||
if (!isset($missing_translations_back[$prefix_key]))
|
||||
$missing_translations_back[$prefix_key] = 1;
|
||||
else
|
||||
$missing_translations_back[$prefix_key]++;
|
||||
}
|
||||
}
|
||||
$new_lang[$english_string]['use_sprintf'] = $this->checkIfKeyUseSprintf($key);
|
||||
}
|
||||
}
|
||||
if (isset($tabs_array[$prefix_key]))
|
||||
@@ -1663,13 +1681,14 @@ class AdminTranslationsControllerCore extends AdminController
|
||||
foreach ($matches as $key)
|
||||
{
|
||||
if (array_key_exists(md5($key), $GLOBALS[$name_var]))
|
||||
$string_to_translate[$key] = html_entity_decode($GLOBALS[$name_var][md5($key)], ENT_COMPAT, 'UTF-8');
|
||||
$string_to_translate[$key]['trad'] = html_entity_decode($GLOBALS[$name_var][md5($key)], ENT_COMPAT, 'UTF-8');
|
||||
else
|
||||
{
|
||||
$string_to_translate[$key] = '';
|
||||
$string_to_translate[$key]['trad'] = '';
|
||||
if (!isset($count_empty[$key]))
|
||||
$count_empty[$key] = 1;
|
||||
}
|
||||
$string_to_translate[$key]['use_sprintf'] = $this->checkIfKeyUseSprintf($key);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1717,16 +1736,17 @@ class AdminTranslationsControllerCore extends AdminController
|
||||
{
|
||||
if (isset($rules['validate']))
|
||||
foreach ($rules['validate'] as $key => $value)
|
||||
{
|
||||
if (isset($GLOBALS[$name_var][$prefix_key.'_'.md5($key)]))
|
||||
{
|
||||
$tabs_array[$prefix_key][$key] = html_entity_decode($GLOBALS[$name_var][$prefix_key.'_'.md5($key)], ENT_COMPAT, 'UTF-8');
|
||||
$tabs_array[$prefix_key][$key]['trad'] = html_entity_decode($GLOBALS[$name_var][$prefix_key.'_'.md5($key)], ENT_COMPAT, 'UTF-8');
|
||||
$count++;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!isset($tabs_array[$prefix_key][$key]))
|
||||
if (!isset($tabs_array[$prefix_key][$key]['trad']))
|
||||
{
|
||||
$tabs_array[$prefix_key][$key] = '';
|
||||
$tabs_array[$prefix_key][$key]['trad'] = '';
|
||||
if (!isset($missing_translations_fields[$prefix_key]))
|
||||
$missing_translations_fields[$prefix_key] = 1;
|
||||
else
|
||||
@@ -1734,21 +1754,23 @@ class AdminTranslationsControllerCore extends AdminController
|
||||
$count++;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (isset($rules['validateLang']))
|
||||
foreach ($rules['validateLang'] as $key => $value)
|
||||
{
|
||||
if (isset($GLOBALS[$name_var][$prefix_key.'_'.md5($key)]))
|
||||
{
|
||||
$tabs_array[$prefix_key][$key] = '';
|
||||
$tabs_array[$prefix_key][$key]['trad'] = '';
|
||||
if (array_key_exists($prefix_key.'_'.md5(addslashes($key)), $GLOBALS[$name_var]))
|
||||
$tabs_array[$prefix_key][$key] = html_entity_decode($GLOBALS[$name_var][$prefix_key.'_'.md5(addslashes($key))], ENT_COMPAT, 'UTF-8');
|
||||
$tabs_array[$prefix_key][$key]['trad'] = html_entity_decode($GLOBALS[$name_var][$prefix_key.'_'.md5(addslashes($key))], ENT_COMPAT, 'UTF-8');
|
||||
|
||||
$count++;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!isset($tabs_array[$prefix_key][$key]))
|
||||
if (!isset($tabs_array[$prefix_key][$key]['trad']))
|
||||
{
|
||||
$tabs_array[$prefix_key][$key] = '';
|
||||
$tabs_array[$prefix_key][$key]['trad'] = '';
|
||||
if (!isset($missing_translations_fields[$prefix_key]))
|
||||
$missing_translations_fields[$prefix_key] = 1;
|
||||
else
|
||||
@@ -1756,6 +1778,7 @@ class AdminTranslationsControllerCore extends AdminController
|
||||
$count++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$this->tpl_view_vars = array_merge($this->tpl_view_vars, array(
|
||||
@@ -2308,16 +2331,19 @@ class AdminTranslationsControllerCore extends AdminController
|
||||
$matches = $this->userParseFile($content, $this->type_selected, $file_type);
|
||||
|
||||
foreach ($matches as $key)
|
||||
{
|
||||
if (stripslashes(array_key_exists($tab.md5(addslashes($key)), $lang_array)))
|
||||
$tabs_array[$tab][$key] = html_entity_decode($lang_array[$tab.md5(addslashes($key))], ENT_COMPAT, 'UTF-8');
|
||||
$tabs_array[$tab][$key]['trad'] = html_entity_decode($lang_array[$tab.md5(addslashes($key))], ENT_COMPAT, 'UTF-8');
|
||||
else
|
||||
{
|
||||
$tabs_array[$tab][$key] = '';
|
||||
$tabs_array[$tab][$key]['trad'] = '';
|
||||
if (!isset($count_missing[$tab]))
|
||||
$count_missing[$tab] = 1;
|
||||
else
|
||||
$count_missing[$tab]++;
|
||||
}
|
||||
$tabs_array[$tab][$key]['use_sprintf'] = $this->checkIfKeyUseSprintf($key);
|
||||
}
|
||||
|
||||
return $tabs_array;
|
||||
}
|
||||
@@ -2376,19 +2402,22 @@ class AdminTranslationsControllerCore extends AdminController
|
||||
$matches = $this->userParseFile($content, $this->type_selected, 'tpl');
|
||||
|
||||
foreach ($matches as $key)
|
||||
{
|
||||
if (isset($GLOBALS[$name_var][$prefix_key.md5($key)]))
|
||||
$tabs_array[$prefix_key][$key] = (html_entity_decode($GLOBALS[$name_var][$prefix_key.md5($key)], ENT_COMPAT, 'UTF-8'));
|
||||
$tabs_array[$prefix_key][$key]['trad'] = (html_entity_decode($GLOBALS[$name_var][$prefix_key.md5($key)], ENT_COMPAT, 'UTF-8'));
|
||||
else
|
||||
{
|
||||
if (!isset($tabs_array[$prefix_key][$key]))
|
||||
if (!isset($tabs_array[$prefix_key][$key]['trad']))
|
||||
{
|
||||
$tabs_array[$prefix_key][$key] = '';
|
||||
$tabs_array[$prefix_key][$key]['trad'] = '';
|
||||
if (!isset($missing_translations_pdf[$prefix_key]))
|
||||
$missing_translations_pdf[$prefix_key] = 1;
|
||||
else
|
||||
$missing_translations_pdf[$prefix_key]++;
|
||||
}
|
||||
}
|
||||
$tabs_array[$prefix_key][$key]['use_sprintf'] = $this->checkIfKeyUseSprintf($key);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
|
||||
@@ -2343,4 +2343,22 @@ margin-bottom:7px;
|
||||
.datepicker{
|
||||
position: relative;
|
||||
z-index:20;
|
||||
}
|
||||
|
||||
#BoxUseSpecialSyntax{
|
||||
position:fixed;
|
||||
z-index:10;
|
||||
width:100%;
|
||||
bottom:50px;
|
||||
display:none;
|
||||
}
|
||||
|
||||
#BoxUseSpecialSyntax .warn{
|
||||
margin:0 auto;
|
||||
width:500px;
|
||||
}
|
||||
|
||||
#BoxUseSpecialSyntax ul{
|
||||
margin-left:30px;
|
||||
list-style-type:disc;
|
||||
}
|
||||
@@ -2129,7 +2129,6 @@ $_LANGADM['AdminOrderscc61945cbbf46721a053467c395c666f'] = 'Remboursé';
|
||||
$_LANGADM['AdminOrderscce5cb6b3f30f3c7c23e056782be13e2'] = 'Recherche de clients :';
|
||||
$_LANGADM['AdminOrdersce26601dac0dea138b7295f02b7620a7'] = 'Client';
|
||||
$_LANGADM['AdminOrdersd11de921f7d92649726cb018ece43f13'] = 'Rechercher un produit en tapant les premières lettres de son nom';
|
||||
$_LANGADM['AdminOrdersd3791adb95b19897037a0e3153ff6356'] = 'Réinitialiser le prix du transporteur';
|
||||
$_LANGADM['AdminOrdersd460ec1b52f16b50d55978c3d4bfdc97'] = '< Précédent';
|
||||
$_LANGADM['AdminOrdersd5bd22327f46800fbd839c6fae3eaa49'] = 'Si vous décidez de créer cette remise pour toutes les factures, une remise sera créée par commande et leurs factures.';
|
||||
$_LANGADM['AdminOrdersd98a07f84921b24ee30f86fd8cd85c3c'] = 'de';
|
||||
@@ -3964,6 +3963,7 @@ $_LANGADM['AdminTranslations1e6d57e813355689e9c77e947d73ad8f'] = 'Depuis :';
|
||||
$_LANGADM['AdminTranslations20598c87f2ea54c7f466c33acc8cb36d'] = 'Aucune donnée à copier ! (langue et thème identiques)';
|
||||
$_LANGADM['AdminTranslations217ee9d15130fbaa142f0cf7fd4d8643'] = 'E-mails du coeur';
|
||||
$_LANGADM['AdminTranslations2303c057afcbe798a5d9811d36e88050'] = 'Modifier les traductions';
|
||||
$_LANGADM['AdminTranslations24f4b4e58327af6b347c2894f3af7b63'] = 'Cette expression utilise ces syntaxes spécifiques :';
|
||||
$_LANGADM['AdminTranslations26a8ee44d835a6301f1ffa7686749633'] = 'Demandez à votre hébergeur d\'augmenter les limites POST et REQUEST à';
|
||||
$_LANGADM['AdminTranslations27ca1be964154831467c8a36787a0499'] = 'Modifier ce modèle d\'e-mail';
|
||||
$_LANGADM['AdminTranslations282d961c3071465db42647be8f662671'] = 'Traductions nom des champs';
|
||||
@@ -3995,12 +3995,15 @@ $_LANGADM['AdminTranslations6e4fd86b4ea240672daa3c2fe1118fe0'] = 'Déplier tous
|
||||
$_LANGADM['AdminTranslations7084cbcddaa2af4a713a1727727b86f8'] = 'E-mails du coeur :';
|
||||
$_LANGADM['AdminTranslations72d6d7a1885885bb55a565fd1070581a'] = 'Importer';
|
||||
$_LANGADM['AdminTranslations763d71969e7ee9bff4e5dc8976501f33'] = 'Ajouter / Mettre à jour une langue';
|
||||
$_LANGADM['AdminTranslations763f68f236492be71ec6283e6bab527d'] = 'sera remplacé par une chaine';
|
||||
$_LANGADM['AdminTranslations7cefb4829c6de24b63f7a05716b43bec'] = 'Cette expression utilise une syntaxe spécifique :';
|
||||
$_LANGADM['AdminTranslations7f157dee2812fc655d003e16cc2cb4f0'] = 'Une erreur est survenue lors de la copie des données';
|
||||
$_LANGADM['AdminTranslations8a4e2d14aa85ccb1aced124f8d793708'] = 'Traductions du Back-Office';
|
||||
$_LANGADM['AdminTranslations8dd4faeaa7ce20bb9166de613f5ad756'] = 'Traductions des modules installés';
|
||||
$_LANGADM['AdminTranslations8f2a5434bb1c382919249941c915b5e3'] = 'Traductions fichiers PDF';
|
||||
$_LANGADM['AdminTranslations8f553fc697fcb0fe16a71f401e2021f5'] = 'Si le nom du pack de langue est au format \"isocode.gzip\" (exemple : \"fr.gzip\") et que la langue correspondante n\'existe pas, celle-ci sera créée automatiquement.';
|
||||
$_LANGADM['AdminTranslations921fbb1f4137ebeb5e354dd559c08b1e'] = 'Les fichiers de la langue source doivent être complets (comme précisé dans Outils >> Langues >> Modification) afin d\'autoriser la copie de traductions.';
|
||||
$_LANGADM['AdminTranslations93364201c6b9ef55096169eacc70eebd'] = 'est utilisé pour l\'ordre des arguments';
|
||||
$_LANGADM['AdminTranslations943922bf7e0ff51289246b23d74f9949'] = 'E-mails des modules :';
|
||||
$_LANGADM['AdminTranslations961e2bc7e3f570a3209546330de84a00'] = 'pour suhosin.request.max_vars.';
|
||||
$_LANGADM['AdminTranslations984d484fbf1842b487f67cdfa7408a53'] = 'Le sujet du mail ne figure pas dans ce fichier : \"%s\"';
|
||||
@@ -4010,6 +4013,7 @@ $_LANGADM['AdminTranslations9ea67be453eaccf020697b4654fc021a'] = 'Enregistrer et
|
||||
$_LANGADM['AdminTranslationsa03365570c1c73391cb62cf9330957da'] = 'Modifier et rester';
|
||||
$_LANGADM['AdminTranslationsa3869e077ff7d9419f84b4f248e043cb'] = 'Sélectionnez votre thème :';
|
||||
$_LANGADM['AdminTranslationsa577e13cac9ee85d6f298e0a8deffeee'] = 'Exporter les données d\'une langue vers un fichier (pack de langue).';
|
||||
$_LANGADM['AdminTranslationsa755805f59b18b9cd17836c2f82175a0'] = 'sera remplacé par un chiffre';
|
||||
$_LANGADM['AdminTranslationsa8622ec6e2159afa9df81b5bd69a3e95'] = 'Une chaîne vide trouvée, s\'il vous plaît modifier: \"%s\"';
|
||||
$_LANGADM['AdminTranslationsa9b6eaa5ff754aa46d30f5547a0edbf2'] = 'Importez un pack de langue manuellement';
|
||||
$_LANGADM['AdminTranslationsa9e4402481bd9b8e36752bf731f67eb6'] = 'Thème :';
|
||||
@@ -4019,6 +4023,7 @@ $_LANGADM['AdminTranslationsb3cb7b15aa2fb2cb6675414233a3aa1b'] = 'Objet pour %s
|
||||
$_LANGADM['AdminTranslationsc06a778aeea1249390e1e61d4772e96d'] = 'Aucun sujet n\'a été trouvé pour %s, ou le sujet est généré depuis la base de données.';
|
||||
$_LANGADM['AdminTranslationsc21f969b5f03d33d43e04f8f136e7682'] = 'par défaut';
|
||||
$_LANGADM['AdminTranslationsc55cb507e1107a57a37791ec42635ca4'] = 'Si nécessaire';
|
||||
$_LANGADM['AdminTranslationsc95ceccd47239766e52e0345da697eb6'] = 'Vous devez utilisé cette syntaxe dans vos traductions. Voici quelques exemples d\'utilisations :';
|
||||
$_LANGADM['AdminTranslationscab84f79f4bb552ebe0a62fa1965ec7b'] = 'Si vous décidez de mettre à jour une langue existante, toutes les modifications de traduction que vous avez apportées au thème \"prestashop\" pour cette langue seront perdues. Cela inclus les traductions du front-office et des e-mails par défaut.';
|
||||
$_LANGADM['AdminTranslationscb7c902e308b5e3a793da2256253cec6'] = 'Attention, votre configuration PHP limite le nombre maximum de champs d\'un formulaire';
|
||||
$_LANGADM['AdminTranslationsd2298f4722b53d97039abbe9d1c11a44'] = 'Veuillez vous assurer que les fichiers anglais existent dans le dossier %s';
|
||||
|
||||
Reference in New Issue
Block a user