mirror of
https://github.com/devcode-it/openstamanager.git
synced 2025-06-05 22:09:38 +02:00
Aggioramento delle traduzioni
Miglioramento della gestione delle traduzioni, con bugfix e inizializzazione della traduzione in inglese.
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -71,7 +71,6 @@ vendor/
|
|||||||
######################
|
######################
|
||||||
*.new
|
*.new
|
||||||
*.old
|
*.old
|
||||||
*.mo
|
|
||||||
.couscous/
|
.couscous/
|
||||||
assets/dist/
|
assets/dist/
|
||||||
backup/*
|
backup/*
|
||||||
|
@@ -176,7 +176,7 @@ if (!empty($module_query) && $module_query != 'menu' && $module_query != 'custom
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Icona
|
// Icona
|
||||||
elseif (preg_match('/^icontr(.+?)$/', trim($field), $m)) {
|
elseif (preg_match('/^icon_(.+?)$/', trim($field), $m)) {
|
||||||
$value = '<i class="'.$r[$field].'"></i> <small>'.$r['icon_title_'.$m[1]].'</small>';
|
$value = '<i class="'.$r[$field].'"></i> <small>'.$r['icon_title_'.$m[1]].'</small>';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
3
core.php
3
core.php
@@ -111,9 +111,10 @@ Translator::setLocaleFormatter($formatter);
|
|||||||
|
|
||||||
// Istanziamento del gestore delle traduzioni del progetto
|
// Istanziamento del gestore delle traduzioni del progetto
|
||||||
$lang = !empty($lang) ? $lang : 'it';
|
$lang = !empty($lang) ? $lang : 'it';
|
||||||
$translator = new Translator($lang);
|
$translator = Translator::getInstance();
|
||||||
$translator->addLocalePath($docroot.'/locale');
|
$translator->addLocalePath($docroot.'/locale');
|
||||||
$translator->addLocalePath($docroot.'/modules/*/locale');
|
$translator->addLocalePath($docroot.'/modules/*/locale');
|
||||||
|
$translator->setLocale($lang);
|
||||||
|
|
||||||
// Individuazione di versione e revisione del progetto
|
// Individuazione di versione e revisione del progetto
|
||||||
$version = Update::getVersion();
|
$version = Update::getVersion();
|
||||||
|
@@ -22,7 +22,7 @@ class FileLoader extends \Symfony\Component\Translation\Loader\FileLoader
|
|||||||
$result = [];
|
$result = [];
|
||||||
|
|
||||||
$extension = strtolower(pathinfo($resource, PATHINFO_EXTENSION));
|
$extension = strtolower(pathinfo($resource, PATHINFO_EXTENSION));
|
||||||
if (!empty($extension) && !empty($this->getLoader($extension))) {
|
if (!empty($extension) && $extension != 'po' && !empty($this->getLoader($extension))) {
|
||||||
$result = $this->getLoader($extension)->loadResource($resource);
|
$result = $this->getLoader($extension)->loadResource($resource);
|
||||||
|
|
||||||
if (!empty($this->include_filename)) {
|
if (!empty($this->include_filename)) {
|
||||||
|
@@ -60,7 +60,7 @@ class Translator extends Util\Singleton
|
|||||||
*/
|
*/
|
||||||
protected function addLocales($path)
|
protected function addLocales($path)
|
||||||
{
|
{
|
||||||
if (!empty($this->$translator)) {
|
if (!empty($this->translator)) {
|
||||||
// Individua i linguaggi disponibili
|
// Individua i linguaggi disponibili
|
||||||
$dirs = glob($path.DIRECTORY_SEPARATOR.'*', GLOB_ONLYDIR);
|
$dirs = glob($path.DIRECTORY_SEPARATOR.'*', GLOB_ONLYDIR);
|
||||||
foreach ($dirs as $dir) {
|
foreach ($dirs as $dir) {
|
||||||
@@ -126,7 +126,7 @@ class Translator extends Util\Singleton
|
|||||||
{
|
{
|
||||||
if (!empty($locale) && $this->isLocaleAvailable($locale)) {
|
if (!empty($locale) && $this->isLocaleAvailable($locale)) {
|
||||||
if (!empty($this->translator)) {
|
if (!empty($this->translator)) {
|
||||||
self::$translator->setLocale($locale);
|
$this->translator->setLocale($locale);
|
||||||
}
|
}
|
||||||
$this->locale = $locale;
|
$this->locale = $locale;
|
||||||
}
|
}
|
||||||
|
BIN
locale/en/en.mo
Normal file
BIN
locale/en/en.mo
Normal file
Binary file not shown.
5386
locale/en/en.po
Normal file
5386
locale/en/en.po
Normal file
File diff suppressed because it is too large
Load Diff
BIN
locale/it/it.mo
Normal file
BIN
locale/it/it.mo
Normal file
Binary file not shown.
@@ -21,13 +21,3 @@
|
|||||||
</table>
|
</table>
|
||||||
<br/>
|
<br/>
|
||||||
</page_header>
|
</page_header>
|
||||||
|
|
||||||
|
|
||||||
<!-- Footer -->
|
|
||||||
<page_footer>
|
|
||||||
<table>
|
|
||||||
<tr><td style="font-size:7pt; color:#999;">
|
|
||||||
Stampato con OpenSTAManager
|
|
||||||
</td></tr>
|
|
||||||
</table>
|
|
||||||
</page_footer>
|
|
||||||
|
@@ -25,16 +25,3 @@
|
|||||||
</table>
|
</table>
|
||||||
<br/>
|
<br/>
|
||||||
</page_header>
|
</page_header>
|
||||||
|
|
||||||
|
|
||||||
<!-- Footer -->
|
|
||||||
<page_footer>
|
|
||||||
<table style="width:200mm; font-size:7pt; color:#999;">
|
|
||||||
<tr><td style="width:100mm;">
|
|
||||||
Stampato con OpenSTAManager
|
|
||||||
</td>
|
|
||||||
<td style="width:100mm; text-align:right;">
|
|
||||||
Pagina [[page_cu]] di [[page_nb]]
|
|
||||||
</td></tr>
|
|
||||||
</table>
|
|
||||||
</page_footer>
|
|
||||||
|
@@ -16,8 +16,8 @@
|
|||||||
$f_email$
|
$f_email$
|
||||||
</td></tr>
|
</td></tr>
|
||||||
</table><br/>
|
</table><br/>
|
||||||
|
|
||||||
|
|
||||||
<!-- Intestazione cliente -->
|
<!-- Intestazione cliente -->
|
||||||
<table $body_table_params$>
|
<table $body_table_params$>
|
||||||
<tr><td style="width:97mm; border:1px solid #777;" valign="top">
|
<tr><td style="width:97mm; border:1px solid #777;" valign="top">
|
||||||
@@ -30,7 +30,7 @@
|
|||||||
$c_codicefiscale$
|
$c_codicefiscale$
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
|
|
||||||
<td valign="top" style="width:96mm; border:1px solid #777;">
|
<td valign="top" style="width:96mm; border:1px solid #777;">
|
||||||
<small><b>DESTINAZIONE</b></small><br/>
|
<small><b>DESTINAZIONE</b></small><br/>
|
||||||
<div style="padding: 4px 20px 20px 20px;">
|
<div style="padding: 4px 20px 20px 20px;">
|
||||||
@@ -41,18 +41,3 @@
|
|||||||
</table>
|
</table>
|
||||||
<br/>
|
<br/>
|
||||||
</page_header>
|
</page_header>
|
||||||
|
|
||||||
|
|
||||||
<!-- Footer -->
|
|
||||||
<page_footer>
|
|
||||||
|footer|
|
|
||||||
<table border="0" style="width:200mm; font-size:7pt; color:#999; border: 0px solid red;">
|
|
||||||
<tr><td style="width:100mm;">
|
|
||||||
Stampato con OpenSTAManager
|
|
||||||
</td>
|
|
||||||
<td style="width:100mm; text-align:right;">
|
|
||||||
Pagina [[page_cu]] di [[page_nb]]
|
|
||||||
</td></tr>
|
|
||||||
|
|
||||||
</table>
|
|
||||||
</page_footer>
|
|
||||||
|
@@ -7,16 +7,3 @@
|
|||||||
</table>
|
</table>
|
||||||
<br/>
|
<br/>
|
||||||
</page_header>
|
</page_header>
|
||||||
|
|
||||||
|
|
||||||
<!-- Footer -->
|
|
||||||
<page_footer>
|
|
||||||
<table style="width:200mm; font-size:7pt; color:#999;">
|
|
||||||
<tr><td style="width:100mm;">
|
|
||||||
Stampato con OpenSTAManager
|
|
||||||
</td>
|
|
||||||
<td style="width:100mm; text-align:right;">
|
|
||||||
Pagina [[page_cu]] di [[page_nb]]
|
|
||||||
</td></tr>
|
|
||||||
</table>
|
|
||||||
</page_footer>
|
|
||||||
|
@@ -12,7 +12,7 @@
|
|||||||
$f_telefono$
|
$f_telefono$
|
||||||
$f_sitoweb$
|
$f_sitoweb$
|
||||||
$f_email$
|
$f_email$
|
||||||
|
|
||||||
</td>
|
</td>
|
||||||
|
|
||||||
<!-- Intestazione cliente -->
|
<!-- Intestazione cliente -->
|
||||||
@@ -33,21 +33,12 @@
|
|||||||
<!-- Footer -->
|
<!-- Footer -->
|
||||||
<page_footer>
|
<page_footer>
|
||||||
<table border="0" style="width:200mm; font-size:7pt; color:#999; border: 0px solid red;">
|
<table border="0" style="width:200mm; font-size:7pt; color:#999; border: 0px solid red;">
|
||||||
<tr>
|
<tr><td style="text-align:center;">
|
||||||
<td colspan="2" style="text-align:center;">
|
$dicitura_fissa_fattura$
|
||||||
|
|
||||||
Ai sensi del D.Lgs. 196/2003 Vi informiamo che i Vs. dati saranno utilizzati esclusivamente per i fini connessi ai rapporti commerciali tra di noi in essere.<br/>
|
|
||||||
Contributo CONAI assolto ove dovuto - Vi preghiamo di controllare i Vs. dati anagrafici, la P. IVA e il Cod. Fiscale. Non ci riteniamo responsabili di eventuali errori.<br/><br/>
|
|
||||||
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
|
|
||||||
<tr><td style="width:100mm;">
|
|
||||||
Stampato con OpenSTAManager
|
|
||||||
</td>
|
|
||||||
<td style="width:100mm; text-align:right;">
|
|
||||||
Pagina [[page_cu]] di [[page_nb]]
|
|
||||||
</td></tr>
|
</td></tr>
|
||||||
|
</table>
|
||||||
</table>
|
|
||||||
|
<br>
|
||||||
|
|
||||||
|
$pagination$
|
||||||
</page_footer>
|
</page_footer>
|
||||||
|
@@ -27,7 +27,7 @@
|
|||||||
$c_codicefiscale$
|
$c_codicefiscale$
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
|
|
||||||
<td valign="top" style="width:96mm; border:1px solid #777;">
|
<td valign="top" style="width:96mm; border:1px solid #777;">
|
||||||
<small><b>DESTINAZIONE</b></small><br/>
|
<small><b>DESTINAZIONE</b></small><br/>
|
||||||
<div style="padding: 4px 20px 20px 20px;">
|
<div style="padding: 4px 20px 20px 20px;">
|
||||||
@@ -44,18 +44,12 @@
|
|||||||
<page_footer>
|
<page_footer>
|
||||||
|footer|
|
|footer|
|
||||||
<table border="0" style="width:200mm; font-size:7pt; color:#999; border: 0px solid red;">
|
<table border="0" style="width:200mm; font-size:7pt; color:#999; border: 0px solid red;">
|
||||||
<tr><td colspan="2" style="text-align:center;">
|
<tr><td style="text-align:center;">
|
||||||
Ai sensi del D.Lgs. 196/2003 Vi informiamo che i Vs. dati saranno utilizzati esclusivamente per i fini connessi ai rapporti commerciali tra di noi in essere.<br/>
|
$dicitura_fissa_fattura$
|
||||||
Vi preghiamo di controllare i Vs. dati anagrafici, la P. IVA e il Cod. Fiscale. Non ci riteniamo responsabili di eventuali errori.<br/><br/>
|
|
||||||
|
|
||||||
</td></tr>
|
</td></tr>
|
||||||
|
</table>
|
||||||
|
|
||||||
<tr><td style="width:100mm;">
|
<br>
|
||||||
Stampato con OpenSTAManager
|
|
||||||
</td>
|
$pagination$
|
||||||
<td style="width:100mm; text-align:right;">
|
|
||||||
Pagina [[page_cu]] di [[page_nb]]
|
|
||||||
</td></tr>
|
|
||||||
|
|
||||||
</table>
|
|
||||||
</page_footer>
|
</page_footer>
|
||||||
|
@@ -7,16 +7,3 @@
|
|||||||
</table>
|
</table>
|
||||||
<br/>
|
<br/>
|
||||||
</page_header>
|
</page_header>
|
||||||
|
|
||||||
|
|
||||||
<!-- Footer -->
|
|
||||||
<page_footer>
|
|
||||||
<table style="width:200mm; font-size:7pt; color:#999;">
|
|
||||||
<tr><td style="width:100mm;">
|
|
||||||
Stampato con OpenSTAManager
|
|
||||||
</td>
|
|
||||||
<td style="width:100mm; text-align:right;">
|
|
||||||
Pagina [[page_cu]] di [[page_nb]]
|
|
||||||
</td></tr>
|
|
||||||
</table>
|
|
||||||
</page_footer>
|
|
||||||
|
@@ -25,17 +25,3 @@
|
|||||||
</table>
|
</table>
|
||||||
<br/>
|
<br/>
|
||||||
</page_header>
|
</page_header>
|
||||||
|
|
||||||
|
|
||||||
<!-- Footer -->
|
|
||||||
<page_footer>
|
|
||||||
<table border="0" style="width:200mm; font-size:7pt; color:#999; border: 0px solid red;">
|
|
||||||
<tr><td style="width:100mm;">
|
|
||||||
Stampato con OpenSTAManager
|
|
||||||
</td>
|
|
||||||
<td style="width:100mm; text-align:right;">
|
|
||||||
Pagina [[page_cu]] di [[page_nb]]
|
|
||||||
</td></tr>
|
|
||||||
|
|
||||||
</table>
|
|
||||||
</page_footer>
|
|
||||||
|
@@ -6,13 +6,13 @@
|
|||||||
<big>STAMPA MASTRINO <small style="font-size:11px; color:#777;">(|period_start| - |period_end|)</small></big><hr>
|
<big>STAMPA MASTRINO <small style="font-size:11px; color:#777;">(|period_start| - |period_end|)</small></big><hr>
|
||||||
<small>|percorso|</small>
|
<small>|percorso|</small>
|
||||||
</td>
|
</td>
|
||||||
|
|
||||||
<td style='text-align:right; width:100mm;'>
|
<td style='text-align:right; width:100mm;'>
|
||||||
|info_fornitore|
|
|info_fornitore|
|
||||||
</td></tr>
|
</td></tr>
|
||||||
</table>
|
</table>
|
||||||
</td></tr>
|
</td></tr>
|
||||||
|
|
||||||
<tr><td style='border-left: 1px solid #777; border-bottom:1px solid #777; border-right: 1px solid #777;'>
|
<tr><td style='border-left: 1px solid #777; border-bottom:1px solid #777; border-right: 1px solid #777;'>
|
||||||
<table style='table-layout:fixed;' cellpadding='0' cellspacing='0'>
|
<table style='table-layout:fixed;' cellpadding='0' cellspacing='0'>
|
||||||
<col width='79'><col width='452'><col width='80'><col width='79'>
|
<col width='79'><col width='452'><col width='80'><col width='79'>
|
||||||
@@ -21,16 +21,3 @@
|
|||||||
</td></tr>
|
</td></tr>
|
||||||
</table>
|
</table>
|
||||||
</page_header>
|
</page_header>
|
||||||
|
|
||||||
|
|
||||||
<!-- Footer -->
|
|
||||||
<page_footer>
|
|
||||||
<table>
|
|
||||||
<tr><td style="width:100mm; color:#888;">
|
|
||||||
Stampato con OpenSTAManager
|
|
||||||
</td>
|
|
||||||
<td style="width:100mm; text-align:right; color:#888;">
|
|
||||||
Pagina [[page_cu]] di [[page_nb]]
|
|
||||||
</td></tr>
|
|
||||||
</table>
|
|
||||||
</page_footer>
|
|
||||||
|
@@ -105,9 +105,30 @@ foreach ($replace as $prefix => $values) {
|
|||||||
$report = str_replace(array_keys($values), array_values($values), $report);
|
$report = str_replace(array_keys($values), array_values($values), $report);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Aggiunta del footer standard
|
||||||
|
if (!str_contains($body, '<page_footer>') && !str_contains($report, '<page_footer>')) {
|
||||||
|
$report .= '
|
||||||
|
<!-- Footer -->
|
||||||
|
<page_footer>
|
||||||
|
$pagination$
|
||||||
|
</page_footer>';
|
||||||
|
}
|
||||||
|
|
||||||
// Valori aggiuntivi per la sostituzione
|
// Valori aggiuntivi per la sostituzione
|
||||||
$values = [
|
$values = [
|
||||||
'dicitura_fissa_fattura' => get_var('Dicitura fissa fattura'),
|
'dicitura_fissa_fattura' => get_var('Dicitura fissa fattura'),
|
||||||
|
'pagination' => '
|
||||||
|
<table style="color:#aaa; font-size:10px;">
|
||||||
|
<tr>
|
||||||
|
<td align="left" style="width:97mm;">
|
||||||
|
'.tr('Stampato con OpenSTAManager').'
|
||||||
|
</td>
|
||||||
|
|
||||||
|
<td align="right" style="width:97mm;">
|
||||||
|
'.str_replace(['_PAGE_', '_TOTAL_'], ['[[page_cu]]', '[[page_nb]]'], tr('Pagina _PAGE_ di _TOTAL_')).'
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>',
|
||||||
];
|
];
|
||||||
|
|
||||||
foreach ($values as $key => $value) {
|
foreach ($values as $key => $value) {
|
||||||
@@ -118,22 +139,3 @@ foreach ($values as $key => $value) {
|
|||||||
// Sostituisce alle variabili del template i valori
|
// Sostituisce alle variabili del template i valori
|
||||||
$body = str_replace(array_keys($values), array_values($values), $body);
|
$body = str_replace(array_keys($values), array_values($values), $body);
|
||||||
$report = str_replace(array_keys($values), array_values($values), $report);
|
$report = str_replace(array_keys($values), array_values($values), $report);
|
||||||
|
|
||||||
// Aggiunta del footer standard
|
|
||||||
if (!str_contains($body, '<page_footer>') && !str_contains($report, '<page_footer>')) {
|
|
||||||
$report .= '
|
|
||||||
<!-- Footer -->
|
|
||||||
<page_footer>
|
|
||||||
<table style="color:#aaa; font-size:10px;">
|
|
||||||
<tr>
|
|
||||||
<td align="left" style="width:97mm;">
|
|
||||||
'.tr('Stampato con OpenSTAManager').'
|
|
||||||
</td>
|
|
||||||
|
|
||||||
<td align="right" style="width:97mm;">
|
|
||||||
'.str_replace(['_PAGE_', '_TOTAL_'], ['[[page_cu]]', '[[page_nb]]'], tr('Pagina _PAGE_ di _TOTAL_')).'
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
</table>
|
|
||||||
</page_footer>';
|
|
||||||
}
|
|
||||||
|
@@ -21,17 +21,3 @@
|
|||||||
</table>
|
</table>
|
||||||
|
|
||||||
</page_header>
|
</page_header>
|
||||||
|
|
||||||
|
|
||||||
<!-- Footer -->
|
|
||||||
<page_footer>
|
|
||||||
|
|
||||||
<table style="width:200mm; font-size:7pt; color:#999;">
|
|
||||||
<tr><td style="width:100mm;">
|
|
||||||
Stampato con OpenSTAManager
|
|
||||||
</td>
|
|
||||||
<td style="width:100mm; text-align:right;">
|
|
||||||
Pagina [[page_cu]] di [[page_nb]]
|
|
||||||
</td></tr>
|
|
||||||
</table>
|
|
||||||
</page_footer>
|
|
||||||
|
@@ -25,16 +25,3 @@
|
|||||||
</table>
|
</table>
|
||||||
<br/>
|
<br/>
|
||||||
</page_header>
|
</page_header>
|
||||||
|
|
||||||
|
|
||||||
<!-- Footer -->
|
|
||||||
<page_footer>
|
|
||||||
<table style="width:200mm; font-size:7pt; color:#999;">
|
|
||||||
<tr><td style="width:100mm;">
|
|
||||||
Stampato con OpenSTAManager
|
|
||||||
</td>
|
|
||||||
<td style="width:100mm; text-align:right;">
|
|
||||||
Pagina [[page_cu]] di [[page_nb]]
|
|
||||||
</td></tr>
|
|
||||||
</table>
|
|
||||||
</page_footer>
|
|
||||||
|
@@ -25,13 +25,3 @@
|
|||||||
</table>
|
</table>
|
||||||
<br/>
|
<br/>
|
||||||
</page_header>
|
</page_header>
|
||||||
|
|
||||||
|
|
||||||
<!-- Footer -->
|
|
||||||
<page_footer>
|
|
||||||
<table>
|
|
||||||
<tr><td style="font-size:7pt; color:#999;">
|
|
||||||
Stampato con OpenSTAManager
|
|
||||||
</td></tr>
|
|
||||||
</table>
|
|
||||||
</page_footer>
|
|
||||||
|
@@ -25,16 +25,3 @@
|
|||||||
</table>
|
</table>
|
||||||
<br/>
|
<br/>
|
||||||
</page_header>
|
</page_header>
|
||||||
|
|
||||||
|
|
||||||
<!-- Footer -->
|
|
||||||
<page_footer>
|
|
||||||
<table>
|
|
||||||
<tr><td style="font-size:7pt; color:#999;">
|
|
||||||
Stampato con OpenSTAManager
|
|
||||||
</td>
|
|
||||||
<td style="width:160mm; text-align:right; font-size:7pt; color:#999;">
|
|
||||||
Pagina [[page_cu]] di [[page_nb]]
|
|
||||||
</td></tr>
|
|
||||||
</table>
|
|
||||||
</page_footer>
|
|
||||||
|
@@ -1,13 +1,3 @@
|
|||||||
<page_header>
|
<page_header>
|
||||||
|
|
||||||
</page_header>
|
</page_header>
|
||||||
|
|
||||||
|
|
||||||
<!-- Footer -->
|
|
||||||
<page_footer>
|
|
||||||
<table>
|
|
||||||
<tr><td style="font-size:7pt; color:#999;">
|
|
||||||
Stampato con OpenSTAManager
|
|
||||||
</td></tr>
|
|
||||||
</table>
|
|
||||||
</page_footer>
|
|
||||||
|
Reference in New Issue
Block a user