Skip to content
Code-Schnipsel Gruppen Projekte
Commit 42d206d8 erstellt von Henning Leutz's avatar Henning Leutz :martial_arts_uniform:
Dateien durchsuchen

Merge branch 'next' into 'master'

Next

See merge request !28
Übergeordnete 431d357c f8aa29d8
No related branches found
Tags 1.6.1
3 Merge Requests!52Update 'next-3.x' with latest changes from 'main',!48Add QUIQQER Tooling,!28Next
Pipeline #4761 bestanden mit Phase
in 28 Sekunden
......@@ -62,7 +62,7 @@
</locale>
<locale name="control.currency.sign">
<de><![CDATA[Währungsszeichen]]></de>
<en><![CDATA[Currency code]]></en>
<en><![CDATA[Currency sign]]></en>
</locale>
<locale name="control.currency.rate">
<de><![CDATA[Umrechnungskurs]]></de>
......
......@@ -14,6 +14,7 @@
use function json_decode;
use function json_encode;
use function mb_strtolower;
use function mb_substr;
/**
* Currency class
......@@ -103,6 +104,17 @@ public static function createCurrency(string $currency, $rate = 1, string $type
$textData = QUI\Translator::getVarData($localeGroup, $localeText);
$signData = QUI\Translator::getVarData($localeGroup, $localeSign);
foreach (QUI::availableLanguages() as $language) {
if (!isset($textData[$language])) {
$textData[$language] = $currency;
}
if (!isset($signData[$language])) {
$signData[$language] = mb_substr($currency, 0, 1);
}
}
// text
try {
QUI\Translator::add(
......@@ -113,12 +125,12 @@ public static function createCurrency(string $currency, $rate = 1, string $type
} catch (QUI\Exception $e) {
}
if (empty($textData)) {
if (!empty($textData)) {
QUI\Translator::edit(
'quiqqer/currency',
'currency.' . $currency . '.text',
'quiqqer/currency',
$languageData
$textData
);
}
......@@ -133,7 +145,7 @@ public static function createCurrency(string $currency, $rate = 1, string $type
}
if (empty($signData)) {
if (!empty($signData)) {
QUI\Translator::edit(
'quiqqer/currency',
'currency.' . $currency . '.sign',
......@@ -469,30 +481,6 @@ public static function updateCurrency($currency, $data)
$dbData['customData'] = json_encode($data['customData']);
}
if (isset($data['code'])) {
try {
QUI\Translator::add(
'quiqqer/currency',
'currency.' . $data['code'] . '.sign',
'quiqqer/currency'
);
} catch (QUI\Exception $e) {
}
QUI\Translator::edit(
'quiqqer/currency',
'currency.' . $currency . '.sign',
'quiqqer/currency',
[
'en' => $data['code'],
'de' => $data['code']
]
);
QUI\Translator::publish('quiqqer/currency');
}
if (isset($data['rate'])) {
$dbData['rate'] = floatval($data['rate']);
}
......
0% oder .
You are about to add 0 people to the discussion. Proceed with caution.
Bearbeitung dieser Nachricht zuerst beenden!
Bitte registrieren oder zum Kommentieren