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;
}
$module = \trim($module, '/');
$themes = \scandir($themePath);
foreach ($themes as $theme) {
$theme = \trim($theme, '/');
$langPath = $themePath . $theme . '/Lang/';
if (!\is_dir($themePath . $theme) || $theme === '.' || $theme === '..'
|| !\is_dir($langPath)
) {
@ -152,11 +156,11 @@ final class Exporter extends ExporterAbstract
if ($len === 3) {
foreach ($array as $key => $value) {
$languageArray[\trim($module, '/')][\trim($theme, '/')][''][$key][$components[0]] = $value;
$languageArray[$module][$theme][''][$key][$components[0]] = $value;
}
} elseif ($len === 4) {
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;
}
$theme = \trim($theme, '/');
$iterator = new \RecursiveIteratorIterator(
new \RecursiveDirectoryIterator($themePath . $theme . '/', \RecursiveDirectoryIterator::SKIP_DOTS),
\RecursiveIteratorIterator::SELF_FIRST
@ -182,12 +188,12 @@ final class Exporter extends ExporterAbstract
$template = \file_get_contents($item->getPathname());
$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) {
$tplKeys[\trim($module, '/')][\trim($theme, '/')][''][$key]['en'] = '';
if (!isset($languageArray[''][\trim($module, '/')][\trim($theme, '/')][$key])) {
$languageArray[\trim($module, '/')][\trim($theme, '/')][''][$key]['en'] = '';
if (!isset($languageArray[''][$module][$theme][$key])) {
$tplKeys[$module][$theme][''][$key]['en'] = '';
$languageArray[$module][$theme][''][$key]['en'] = '';
}
}
}
@ -202,7 +208,7 @@ final class Exporter extends ExporterAbstract
foreach ($files as $file => $keys) {
foreach ($keys as $key => $value) {
$content .= "\n\"" . $module . '";"' . $theme . '";"' . $file . '";"';
$content .= (!isset($tplKeys[$module][$theme]['']) ? '*' : '') . $key . '"';
$content .= ($file === '' && isset($tplKeys[$module][$theme][''][$key]) ? '*' : '') . $key . '"';
foreach ($supportedLanguages as $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
*
* @package Modules\Exchange
* @package Modules\Localization
* @copyright Dennis Eichhorn
* @license OMS License 1.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
*
* @package Modules\Exchange
* @package Modules\Localization
* @copyright Dennis Eichhorn
* @license OMS License 1.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);
return ['Exchange' => [
'Created' => 'Created',
'CreatedAt' => 'Created at',
'CreatedBy' => 'Created by',
'Creator' => 'Creator',
'Created' => '',
'CreatedAt' => '',
'CreatedBy' => '',
'Creator' => '',
'Database' => 'Database',
'End' => 'End',
'Exchange' => 'Exchange',
'Exchange' => '',
'Export' => 'Export',
'Exports' => 'Exports',
'Exports' => '',
'File' => 'File',
'Host' => 'Host',
'Import' => 'Import',
'Imports' => 'Imports',
'Imports' => '',
'Login' => 'Login',
'Logs' => 'Logs',
'Logs' => '',
'Options' => 'Options',
'Password' => 'Password',
'Port' => 'Port',
'Start' => 'Start',
'Subtype' => 'Subtype',
'Title' => 'Title',
'Type' => 'Type',
'Subtype' => '',
'Title' => '',
'Type' => '',
'Website' => 'Website',
]];

View File

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