Skip to content
Code-Schnipsel Gruppen Projekte
Bestätigt Commit 69c723af erstellt von Henning Leutz's avatar Henning Leutz :martial_arts_uniform:
Dateien durchsuchen

fix: #45

Übergeordneter 401f7292
Keine zugehörigen Branchen gefunden
Keine zugehörigen Tags gefunden
Keine zugehörigen Merge Requests gefunden
...@@ -67,16 +67,17 @@ public function createChild($data = []) ...@@ -67,16 +67,17 @@ public function createChild($data = [])
$NewChild = parent::createChild($data); $NewChild = parent::createChild($data);
$this->createShippingLocale( $this->createShippingLocale(
'shipping.'.$NewChild->getId().'.title', 'shipping.' . $NewChild->getId() . '.title',
$NewChild->getShippingType()->getTitle() $NewChild->getShippingType()->getTitle()
); );
$this->createShippingLocale( $this->createShippingLocale(
'shipping.'.$NewChild->getId().'.workingTitle', 'shipping.' . $NewChild->getId() . '.workingTitle',
$NewChild->getShippingType()->getTitle().' - '.$NewChild->getId() $NewChild->getShippingType()->getTitle() . ' - ' . $NewChild->getId()
); );
$this->createShippingLocale('shipping.'.$NewChild->getId().'.decription', ''); // description
$this->createShippingLocale('shipping.' . $NewChild->getId() . '.description', ' ');
try { try {
QUI\Translator::publish('quiqqer/shipping'); QUI\Translator::publish('quiqqer/shipping');
...@@ -148,19 +149,22 @@ public function getChild($id) ...@@ -148,19 +149,22 @@ public function getChild($id)
*/ */
protected function createShippingLocale($var, $title) protected function createShippingLocale($var, $title)
{ {
$current = QUI::getLocale()->getCurrent();
if (QUI::getLocale()->isLocaleString($title)) { if (QUI::getLocale()->isLocaleString($title)) {
$parts = QUI::getLocale()->getPartsOfLocaleString($title); $parts = QUI::getLocale()->getPartsOfLocaleString($title);
$title = QUI::getLocale()->get($parts[0], $parts[1]); $title = QUI::getLocale()->get($parts[0], $parts[1]);
} }
$data = [];
foreach (QUI::availableLanguages() as $language) {
$data[$language] = $title;
$data[$language . '_edit'] = $title;
}
try { try {
QUI\Translator::addUserVar('quiqqer/shipping', $var, [ QUI\Translator::add('quiqqer/shipping', $var, 'quiqqer/shipping', 'php,js');
$current => $title, QUI\Translator::update('quiqqer/shipping', $var, 'quiqqer/shipping', $data);
'datatype' => 'php,js',
'package' => 'quiqqer/shipping'
]);
} catch (QUI\Exception $Exception) { } catch (QUI\Exception $Exception) {
QUI\System\Log::addNotice($Exception->getMessage()); QUI\System\Log::addNotice($Exception->getMessage());
} }
......
0% Lade oder .
You are about to add 0 people to the discussion. Proceed with caution.
Bearbeitung dieser Nachricht zuerst beenden!
Bitte registrieren oder zum Kommentieren