Update exchanger

This commit is contained in:
Dennis Eichhorn 2021-04-24 16:17:30 +02:00
parent b832d7b598
commit 47c06d6743
47 changed files with 921 additions and 515 deletions

0
Docs/Dev/en/SUMMARY.md Normal file → Executable file
View File

0
Docs/Dev/en/structure.md Normal file → Executable file
View File

View File

@ -117,9 +117,13 @@ final class Exporter extends ExporterAbstract
continue; continue;
} }
$module = \trim($module, '/');
$themes = \scandir($themePath); $themes = \scandir($themePath);
foreach ($themes as $theme) { foreach ($themes as $theme) {
$theme = \trim($theme, '/');
$langPath = $themePath . $theme . '/Lang/'; $langPath = $themePath . $theme . '/Lang/';
if (!\is_dir($themePath . $theme) || $theme === '.' || $theme === '..' if (!\is_dir($themePath . $theme) || $theme === '.' || $theme === '..'
|| !\is_dir($langPath) || !\is_dir($langPath)
) { ) {
@ -152,11 +156,11 @@ final class Exporter extends ExporterAbstract
if ($len === 3) { if ($len === 3) {
foreach ($array as $key => $value) { foreach ($array as $key => $value) {
$languageArray[\trim($module, '/')][\trim($theme, '/')][''][$key][$components[0]] = $value; $languageArray[$module][$theme][''][$key][$components[0]] = $value;
} }
} elseif ($len === 4) { } elseif ($len === 4) {
foreach ($array as $key => $value) { foreach ($array as $key => $value) {
$languageArray[\trim($module, '/')][\trim($theme, '/')][$components[0]][$key][$components[1]] = $value; $languageArray[$module][$theme][$components[0]][$key][$components[1]] = $value;
} }
} }
} }
@ -170,6 +174,8 @@ final class Exporter extends ExporterAbstract
continue; continue;
} }
$theme = \trim($theme, '/');
$iterator = new \RecursiveIteratorIterator( $iterator = new \RecursiveIteratorIterator(
new \RecursiveDirectoryIterator($themePath . $theme . '/', \RecursiveDirectoryIterator::SKIP_DOTS), new \RecursiveDirectoryIterator($themePath . $theme . '/', \RecursiveDirectoryIterator::SKIP_DOTS),
\RecursiveIteratorIterator::SELF_FIRST \RecursiveIteratorIterator::SELF_FIRST
@ -182,12 +188,12 @@ final class Exporter extends ExporterAbstract
$template = \file_get_contents($item->getPathname()); $template = \file_get_contents($item->getPathname());
$keys = []; $keys = [];
\preg_match_all('/(\$this\->getHtml\(\')([a-zA-Z:]+)(\'\))/', $template, $keys, \PREG_PATTERN_ORDER); \preg_match_all('/(\$this\->getHtml\(\')([0-9a-zA-Z:]+)(\'\))/', $template, $keys, \PREG_PATTERN_ORDER);
foreach ($keys[2] ?? [] as $key) { foreach ($keys[2] ?? [] as $key) {
$tplKeys[\trim($module, '/')][\trim($theme, '/')][''][$key]['en'] = ''; if (!isset($languageArray[''][$module][$theme][$key])) {
if (!isset($languageArray[''][\trim($module, '/')][\trim($theme, '/')][$key])) { $tplKeys[$module][$theme][''][$key]['en'] = '';
$languageArray[\trim($module, '/')][\trim($theme, '/')][''][$key]['en'] = ''; $languageArray[$module][$theme][''][$key]['en'] = '';
} }
} }
} }
@ -202,7 +208,7 @@ final class Exporter extends ExporterAbstract
foreach ($files as $file => $keys) { foreach ($files as $file => $keys) {
foreach ($keys as $key => $value) { foreach ($keys as $key => $value) {
$content .= "\n\"" . $module . '";"' . $theme . '";"' . $file . '";"'; $content .= "\n\"" . $module . '";"' . $theme . '";"' . $file . '";"';
$content .= (!isset($tplKeys[$module][$theme]['']) ? '*' : '') . $key . '"'; $content .= ($file === '' && isset($tplKeys[$module][$theme][''][$key]) ? '*' : '') . $key . '"';
foreach ($supportedLanguages as $language) { foreach ($supportedLanguages as $language) {
$content .= ';"' . ($value[$language] ?? '') . '"'; $content .= ';"' . ($value[$language] ?? '') . '"';

View File

@ -0,0 +1,20 @@
<?php
/**
* Orange Management
*
* PHP Version 8.0
*
* @package Modules\Localization
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @link https://orange-management.org
*/
declare(strict_types=1);
return ['Navigation' => [
'Dashboard' => '',
'Exchange' => '',
'Export' => '',
'Import' => '',
]];

View File

@ -0,0 +1,20 @@
<?php
/**
* Orange Management
*
* PHP Version 8.0
*
* @package Modules\Localization
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @link https://orange-management.org
*/
declare(strict_types=1);
return ['Navigation' => [
'Dashboard' => '',
'Exchange' => '',
'Export' => '',
'Import' => '',
]];

View File

@ -0,0 +1,20 @@
<?php
/**
* Orange Management
*
* PHP Version 8.0
*
* @package Modules\Localization
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @link https://orange-management.org
*/
declare(strict_types=1);
return ['Navigation' => [
'Dashboard' => '',
'Exchange' => '',
'Export' => '',
'Import' => '',
]];

2
Theme/Backend/Lang/Navigation.de.lang.php Executable file → Normal file
View File

@ -4,7 +4,7 @@
* *
* PHP Version 8.0 * PHP Version 8.0
* *
* @package Modules\Exchange * @package Modules\Localization
* @copyright Dennis Eichhorn * @copyright Dennis Eichhorn
* @license OMS License 1.0 * @license OMS License 1.0
* @version 1.0.0 * @version 1.0.0

View File

@ -0,0 +1,20 @@
<?php
/**
* Orange Management
*
* PHP Version 8.0
*
* @package Modules\Localization
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @link https://orange-management.org
*/
declare(strict_types=1);
return ['Navigation' => [
'Dashboard' => '',
'Exchange' => '',
'Export' => '',
'Import' => '',
]];

2
Theme/Backend/Lang/Navigation.en.lang.php Executable file → Normal file
View File

@ -4,7 +4,7 @@
* *
* PHP Version 8.0 * PHP Version 8.0
* *
* @package Modules\Exchange * @package Modules\Localization
* @copyright Dennis Eichhorn * @copyright Dennis Eichhorn
* @license OMS License 1.0 * @license OMS License 1.0
* @version 1.0.0 * @version 1.0.0

View File

@ -0,0 +1,20 @@
<?php
/**
* Orange Management
*
* PHP Version 8.0
*
* @package Modules\Localization
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @link https://orange-management.org
*/
declare(strict_types=1);
return ['Navigation' => [
'Dashboard' => '',
'Exchange' => '',
'Export' => '',
'Import' => '',
]];

View File

@ -0,0 +1,20 @@
<?php
/**
* Orange Management
*
* PHP Version 8.0
*
* @package Modules\Localization
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @link https://orange-management.org
*/
declare(strict_types=1);
return ['Navigation' => [
'Dashboard' => '',
'Exchange' => '',
'Export' => '',
'Import' => '',
]];

View File

@ -0,0 +1,20 @@
<?php
/**
* Orange Management
*
* PHP Version 8.0
*
* @package Modules\Localization
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @link https://orange-management.org
*/
declare(strict_types=1);
return ['Navigation' => [
'Dashboard' => '',
'Exchange' => '',
'Export' => '',
'Import' => '',
]];

View File

@ -0,0 +1,20 @@
<?php
/**
* Orange Management
*
* PHP Version 8.0
*
* @package Modules\Localization
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @link https://orange-management.org
*/
declare(strict_types=1);
return ['Navigation' => [
'Dashboard' => '',
'Exchange' => '',
'Export' => '',
'Import' => '',
]];

View File

@ -0,0 +1,20 @@
<?php
/**
* Orange Management
*
* PHP Version 8.0
*
* @package Modules\Localization
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @link https://orange-management.org
*/
declare(strict_types=1);
return ['Navigation' => [
'Dashboard' => '',
'Exchange' => '',
'Export' => '',
'Import' => '',
]];

View File

@ -0,0 +1,20 @@
<?php
/**
* Orange Management
*
* PHP Version 8.0
*
* @package Modules\Localization
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @link https://orange-management.org
*/
declare(strict_types=1);
return ['Navigation' => [
'Dashboard' => '',
'Exchange' => '',
'Export' => '',
'Import' => '',
]];

View File

@ -0,0 +1,20 @@
<?php
/**
* Orange Management
*
* PHP Version 8.0
*
* @package Modules\Localization
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @link https://orange-management.org
*/
declare(strict_types=1);
return ['Navigation' => [
'Dashboard' => '',
'Exchange' => '',
'Export' => '',
'Import' => '',
]];

View File

@ -0,0 +1,20 @@
<?php
/**
* Orange Management
*
* PHP Version 8.0
*
* @package Modules\Localization
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @link https://orange-management.org
*/
declare(strict_types=1);
return ['Navigation' => [
'Dashboard' => '',
'Exchange' => '',
'Export' => '',
'Import' => '',
]];

View File

@ -0,0 +1,20 @@
<?php
/**
* Orange Management
*
* PHP Version 8.0
*
* @package Modules\Localization
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @link https://orange-management.org
*/
declare(strict_types=1);
return ['Navigation' => [
'Dashboard' => '',
'Exchange' => '',
'Export' => '',
'Import' => '',
]];

View File

@ -0,0 +1,20 @@
<?php
/**
* Orange Management
*
* PHP Version 8.0
*
* @package Modules\Localization
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @link https://orange-management.org
*/
declare(strict_types=1);
return ['Navigation' => [
'Dashboard' => '',
'Exchange' => '',
'Export' => '',
'Import' => '',
]];

View File

@ -0,0 +1,20 @@
<?php
/**
* Orange Management
*
* PHP Version 8.0
*
* @package Modules\Localization
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @link https://orange-management.org
*/
declare(strict_types=1);
return ['Navigation' => [
'Dashboard' => '',
'Exchange' => '',
'Export' => '',
'Import' => '',
]];

View File

@ -0,0 +1,20 @@
<?php
/**
* Orange Management
*
* PHP Version 8.0
*
* @package Modules\Localization
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @link https://orange-management.org
*/
declare(strict_types=1);
return ['Navigation' => [
'Dashboard' => '',
'Exchange' => '',
'Export' => '',
'Import' => '',
]];

View File

@ -0,0 +1,20 @@
<?php
/**
* Orange Management
*
* PHP Version 8.0
*
* @package Modules\Localization
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @link https://orange-management.org
*/
declare(strict_types=1);
return ['Navigation' => [
'Dashboard' => '',
'Exchange' => '',
'Export' => '',
'Import' => '',
]];

View File

@ -0,0 +1,20 @@
<?php
/**
* Orange Management
*
* PHP Version 8.0
*
* @package Modules\Localization
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @link https://orange-management.org
*/
declare(strict_types=1);
return ['Navigation' => [
'Dashboard' => '',
'Exchange' => '',
'Export' => '',
'Import' => '',
]];

View File

@ -0,0 +1,20 @@
<?php
/**
* Orange Management
*
* PHP Version 8.0
*
* @package Modules\Localization
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @link https://orange-management.org
*/
declare(strict_types=1);
return ['Navigation' => [
'Dashboard' => '',
'Exchange' => '',
'Export' => '',
'Import' => '',
]];

View File

@ -0,0 +1,20 @@
<?php
/**
* Orange Management
*
* PHP Version 8.0
*
* @package Modules\Localization
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @link https://orange-management.org
*/
declare(strict_types=1);
return ['Navigation' => [
'Dashboard' => '',
'Exchange' => '',
'Export' => '',
'Import' => '',
]];

View File

@ -13,27 +13,27 @@
declare(strict_types=1); declare(strict_types=1);
return ['Exchange' => [ return ['Exchange' => [
'Created' => 'Created', 'Created' => '',
'CreatedAt' => 'Created at', 'CreatedAt' => '',
'CreatedBy' => 'Created by', 'CreatedBy' => '',
'Creator' => 'Creator', 'Creator' => '',
'Database' => 'Database', 'Database' => 'Database',
'End' => 'End', 'End' => 'End',
'Exchange' => 'Exchange', 'Exchange' => '',
'Export' => 'Export', 'Export' => 'Export',
'Exports' => 'Exports', 'Exports' => '',
'File' => 'File', 'File' => 'File',
'Host' => 'Host', 'Host' => 'Host',
'Import' => 'Import', 'Import' => 'Import',
'Imports' => 'Imports', 'Imports' => '',
'Login' => 'Login', 'Login' => 'Login',
'Logs' => 'Logs', 'Logs' => '',
'Options' => 'Options', 'Options' => 'Options',
'Password' => 'Password', 'Password' => 'Password',
'Port' => 'Port', 'Port' => 'Port',
'Start' => 'Start', 'Start' => 'Start',
'Subtype' => 'Subtype', 'Subtype' => '',
'Title' => 'Title', 'Title' => '',
'Type' => 'Type', 'Type' => '',
'Website' => 'Website', 'Website' => 'Website',
]]; ]];

View File

@ -29,7 +29,7 @@ return ['Exchange' => [
'Login' => 'Login', 'Login' => 'Login',
'Logs' => 'logs', 'Logs' => 'logs',
'Options' => 'Opzioni', 'Options' => 'Opzioni',
'Password' => 'Parola d\'ordine', 'Password' => 'Parola d\\'ordine',
'Port' => 'Porta', 'Port' => 'Porta',
'Start' => 'Inizio', 'Start' => 'Inizio',
'Subtype' => 'sottotipo', 'Subtype' => 'sottotipo',