importTranslation example

'country_state_id' => $countryStateId,
                'name' => $state['nameDE'],
            ][
                'country_state_id' => $countryStateId,
                'name' => $state['nameEN'],
            ]);
        }

        $queue->execute();

        foreach ($countryStateTranslations as $translations) {
            $this->importTranslation('country_state_translation', $translations$connection);
        }
    }

    public function updateDestructive(Connection $connection): void
    {
    }
}
$translations = new Translations(
            [
                'import_export_profile_id' => $id,
                'label' => 'Standardprofil Bestellungen',
            ],
            [
                'import_export_profile_id' => $id,
                'label' => 'Default orders',
            ]
        );

        $this->importTranslation(ImportExportProfileTranslationDefinition::ENTITY_NAME, $translations$connection);
    }

    public function updateDestructive(Connection $connection): void
    {
        // implement update destructive     }
}
$pageTranslations = new Translations(
            [
                'cms_page_id' => $page['id'],
                'name' => 'Standard Produktseite-Layout',
            ],
            [
                'cms_page_id' => $page['id'],
                'name' => 'Default product page Layout',
            ]
        );

        $this->importTranslation('cms_page_translation', $pageTranslations$connection);

        $section = [
            'id' => Uuid::randomBytes(),
            'cms_page_id' => $page['id'],
            'position' => 0,
            'type' => 'default',
            'created_at' => (new \DateTime())->format(Defaults::STORAGE_DATE_TIME_FORMAT),
        ];

        $connection->insert('cms_section', $section);

        
$translations = new Translations(
                    [
                        'mail_template_type_id' => $values['typeId'],
                        'name' => $values['nameDe'],
                    ],
                    [
                        'mail_template_type_id' => $values['typeId'],
                        'name' => $values['name'],
                    ]
                );

                $this->importTranslation('mail_template_type_translation', $translations$connection);
            }

            $connection->insert(
                'mail_template',
                [
                    'id' => $values['templateId'],
                    'mail_template_type_id' => $values['typeId'],
                    'system_default' => 1,
                    'created_at' => (new \DateTime())->format(Defaults::STORAGE_DATE_TIME_FORMAT),
                ]
            );

            
'salutation_id' => Uuid::fromHexToBytes(self::DEFAULT_SALUTATION_ID),
                'display_name' => self::SALUTATION_DISPLAY_NAME_DE,
                'letter_name' => '',
            ],
            [
                'salutation_id' => Uuid::fromHexToBytes(self::DEFAULT_SALUTATION_ID),
                'display_name' => self::SALUTATION_DISPLAY_NAME_EN,
                'letter_name' => '',
            ]
        );

        $this->importTranslation('salutation_translation', $translation$connection);
    }

    public function updateDestructive(Connection $connection): void
    {
        // implement update destructive     }
}
$translations = new Translations(
            [
                'import_export_profile_id' => $id,
                'label' => 'Standardprofil Erweiterte Preise',
            ],
            [
                'import_export_profile_id' => $id,
                'label' => 'Default advanced prices',
            ]
        );

        $this->importTranslation(ImportExportProfileTranslationDefinition::ENTITY_NAME, $translations$connection);
    }

    public function updateDestructive(Connection $connection): void
    {
        // implement update destructive     }
}
$translations = new Translations(
                [
                    'mail_template_type_id' => $typeId,
                    'name' => 'Produktbewertung',
                ],
                [
                    'mail_template_type_id' => $typeId,
                    'name' => 'Product review',
                ]
            );

            $this->importTranslation('mail_template_type_translation', $translations$connection);
        }

        $connection->insert(
            'mail_template',
            [
                'id' => $templateId,
                'mail_template_type_id' => $typeId,
                'system_default' => 1,
                'created_at' => (new \DateTime())->format(Defaults::STORAGE_DATE_TIME_FORMAT),
            ]
        );

        
$numberRangeTypeTranslations = new Translations(
            [
                'number_range_type_id' => $numberRangeTypeId,
                'type_name' => 'Beispiel',
            ],
            [
                'number_range_type_id' => $numberRangeTypeId,
                'type_name' => 'Example',
            ]
        );

        $this->importTranslation(
            'number_range_translation',
            $numberRangeTranslations,
            $connection
        );

        $this->importTranslation(
            'number_range_type_translation',
            $numberRangeTypeTranslations,
            $connection
        );
    }

    
'min_search_length' => 2,
                'excluded_terms' => json_encode($deStopwords, \JSON_THROW_ON_ERROR),
            ],
            [
                'id' => $searchConfigEnId,
                'and_logic' => 1,
                'min_search_length' => 2,
                'excluded_terms' => $enLanguageId ? json_encode($enStopwords, \JSON_THROW_ON_ERROR) : null,
            ]
        );

        $writeResult = $this->importTranslation(ProductSearchConfigDefinition::ENTITY_NAME, $translations$connection);

        $createdAt = (new \DateTime())->format(Defaults::STORAGE_DATE_TIME_FORMAT);

        $defaultSearchData = [];
        if ($writeResult->hasWrittenEnglishTranslations()) {
            $defaultSearchData = $this->getConfigFieldDefaultData($searchConfigEnId$createdAt);
        }

        if ($writeResult->hasWrittenGermanTranslations()) {
            $defaultSearchData = [...$defaultSearchData, ...$this->getConfigFieldDefaultData($searchConfigDeId$createdAt)];
        }

        
$translation = new Translations(
            [
                'delivery_time_id' => $downloadDeliveryTime,
                'name' => self::DELIVERY_TIME_NAME_DE,
            ],
            [
                'delivery_time_id' => $downloadDeliveryTime,
                'name' => self::DELIVERY_TIME_NAME_EN,
            ]
        );

        $this->importTranslation('delivery_time_translation', $translation$connection);
    }

    public function updateDestructive(Connection $connection): void
    {
    }
}

                'mail_header_footer_id' => $id,
                'name' => 'Default email footer',
                'description' => 'Default email footer derived from basic information',
                'header_html' => null,
                'header_plain' => null,
                'footer_plain' => (string) \file_get_contents(__DIR__ . '/../Fixtures/mails/defaultMailFooter/en-plain.twig'),
                'footer_html' => (string) \file_get_contents(__DIR__ . '/../Fixtures/mails/defaultMailFooter/en-html.twig'),
            ]
        );

        $this->importTranslation(MailHeaderFooterTranslationDefinition::ENTITY_NAME, $translations$connection);
    }

    public function updateDestructive(Connection $connection): void
    {
        // implement update destructive     }
}
$translations = $sorting['translations'];

            unset($sorting['translations']);

            $connection->insert(ProductSortingDefinition::ENTITY_NAME, $sorting);

            $translations = new Translations(
                ['product_sorting_id' => $sorting['id'], 'label' => $translations['de-DE']],
                ['product_sorting_id' => $sorting['id'], 'label' => $translations['en-GB']]
            );

            $this->importTranslation('product_sorting_translation', $translations$connection);
        }
    }

    private function createTable(Connection $connection): void
    {
        $connection->executeStatement(' CREATE TABLE IF NOT EXISTS `product_sorting` ( `id` BINARY(16) NOT NULL, `url_key` VARCHAR(255) NOT NULL, `priority` INT(11) unsigned NOT NULL, `active` TINYINT(1) NOt NULL DEFAULT 1, `fields` JSON NOT NULL, `created_at` DATETIME(3) NOT NULL, `locked` TINYINT(1) NOT NULL DEFAULT 0, `updated_at` DATETIME(3) NULL, PRIMARY KEY (`id`), CONSTRAINT `uniq.product_sorting.url_key` UNIQUE (`url_key`), CONSTRAINT `json.product_sorting.fields` CHECK (JSON_VALID(`fields`)) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; ');
$translations = new Translations(
            [
                'import_export_profile_id' => $id,
                'label' => 'Standardprofil Aktionsrabatte',
            ],
            [
                'import_export_profile_id' => $id,
                'label' => 'Default promotion discounts',
            ]
        );

        $this->importTranslation(ImportExportProfileTranslationDefinition::ENTITY_NAME, $translations$connection);
    }

    public function updateDestructive(Connection $connection): void
    {
        // implement update destructive     }
}
$id = Uuid::randomBytes();

        $this->connection->insert(
            StateMachineDefinition::ENTITY_NAME,
            [
                'id' => $id,
                'technical_name' => $stateMachineMigration->getTechnicalName(),
                'created_at' => (new \DateTime())->format(Defaults::STORAGE_DATE_TIME_FORMAT),
            ]
        );

        $this->importTranslation(
            StateMachineTranslationDefinition::ENTITY_NAME,
            new Translations(
                ['state_machine_id' => $id, 'name' => $stateMachineMigration->getDe()],
                ['state_machine_id' => $id, 'name' => $stateMachineMigration->getEn()]
            ),
            $this->connection
        );

        return Uuid::fromBytesToHex($id);
    }

    
$translations = new Translations(
            [
                'import_export_profile_id' => $id,
                'label' => 'Standardprofil Kunde',
            ],
            [
                'import_export_profile_id' => $id,
                'label' => 'Default customer',
            ]
        );

        $this->importTranslation(ImportExportProfileTranslationDefinition::ENTITY_NAME, $translations$connection);
    }

    public function updateDestructive(Connection $connection): void
    {
        // implement update destructive     }
}
Home | Imprint | This part of the site doesn't use cookies.