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 = [])
$NewChild = parent::createChild($data);
$this->createShippingLocale(
'shipping.'.$NewChild->getId().'.title',
'shipping.' . $NewChild->getId() . '.title',
$NewChild->getShippingType()->getTitle()
);
$this->createShippingLocale(
'shipping.'.$NewChild->getId().'.workingTitle',
$NewChild->getShippingType()->getTitle().' - '.$NewChild->getId()
'shipping.' . $NewChild->getId() . '.workingTitle',
$NewChild->getShippingType()->getTitle() . ' - ' . $NewChild->getId()
);
$this->createShippingLocale('shipping.'.$NewChild->getId().'.decription', '');
// description
$this->createShippingLocale('shipping.' . $NewChild->getId() . '.description', ' ');
try {
QUI\Translator::publish('quiqqer/shipping');
......@@ -148,19 +149,22 @@ public function getChild($id)
*/
protected function createShippingLocale($var, $title)
{
$current = QUI::getLocale()->getCurrent();
if (QUI::getLocale()->isLocaleString($title)) {
$parts = QUI::getLocale()->getPartsOfLocaleString($title);
$title = QUI::getLocale()->get($parts[0], $parts[1]);
}
$data = [];
foreach (QUI::availableLanguages() as $language) {
$data[$language] = $title;
$data[$language . '_edit'] = $title;
}
try {
QUI\Translator::addUserVar('quiqqer/shipping', $var, [
$current => $title,
'datatype' => 'php,js',
'package' => 'quiqqer/shipping'
]);
QUI\Translator::add('quiqqer/shipping', $var, 'quiqqer/shipping', 'php,js');
QUI\Translator::update('quiqqer/shipping', $var, 'quiqqer/shipping', $data);
} catch (QUI\Exception $Exception) {
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