init
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
<?xml version="1.0"?>
|
||||
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:noNamespaceSchemaLocation="urn:magento:framework:Acl/etc/acl.xsd">
|
||||
<acl>
|
||||
<resources>
|
||||
<resource id="Magento_Backend::admin">
|
||||
<resource id="Esun_MultiLocaleTranslation::translation" title="Locale Translate" sortOrder="90">
|
||||
<resource id="Esun_MultiLocaleTranslation::translate_product" title="Translate Product" sortOrder="10"/>
|
||||
<resource id="Esun_MultiLocaleTranslation::translate_category" title="Translate Category" sortOrder="20"/>
|
||||
<resource id="Esun_MultiLocaleTranslation::translate_cms" title="Translate CMS" sortOrder="30"/>
|
||||
<resource id="Esun_MultiLocaleTranslation::translate_blog" title="Translate Blog Post" sortOrder="35"/>
|
||||
<resource id="Esun_MultiLocaleTranslation::translate_wiki" title="Translate Wiki" sortOrder="36"/>
|
||||
<resource id="Esun_MultiLocaleTranslation::translation_queue" title="Translation Queue" sortOrder="40">
|
||||
<resource id="Esun_MultiLocaleTranslation::queue_add" title="Add Translation Queue Tasks" sortOrder="10"/>
|
||||
<resource id="Esun_MultiLocaleTranslation::queue_retry" title="Retry Translation Queue Tasks" sortOrder="20"/>
|
||||
<resource id="Esun_MultiLocaleTranslation::queue_delete" title="Delete Translation Queue Tasks" sortOrder="30"/>
|
||||
</resource>
|
||||
<resource id="Esun_MultiLocaleTranslation::translation_log" title="Translation API Log" sortOrder="50">
|
||||
<resource id="Esun_MultiLocaleTranslation::translation_log_delete" title="Delete Translation Logs" sortOrder="10"/>
|
||||
</resource>
|
||||
</resource>
|
||||
<resource id="Esun_MultiLocaleTranslation::config" title="Multi-Locale Translation Configuration" sortOrder="91"/>
|
||||
</resource>
|
||||
</resources>
|
||||
</acl>
|
||||
</config>
|
||||
@@ -0,0 +1,44 @@
|
||||
<?xml version="1.0"?>
|
||||
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
|
||||
<type name="Magento\Cms\Model\Page\DataProvider">
|
||||
<plugin name="esun_localetranslation_cms_page_form_data"
|
||||
type="Esun\MultiLocaleTranslation\Plugin\Adminhtml\CmsPageDataProvider"
|
||||
sortOrder="20"/>
|
||||
</type>
|
||||
<type name="Magento\Cms\Controller\Adminhtml\Page\Save">
|
||||
<plugin name="esun_localetranslation_cms_page_scope_save"
|
||||
type="Esun\MultiLocaleTranslation\Plugin\Adminhtml\CmsPageSave"
|
||||
sortOrder="10"/>
|
||||
</type>
|
||||
<type name="Magento\Cms\Model\Block\DataProvider">
|
||||
<plugin name="esun_localetranslation_cms_block_form_data"
|
||||
type="Esun\MultiLocaleTranslation\Plugin\Adminhtml\CmsBlockDataProvider"
|
||||
sortOrder="20"/>
|
||||
</type>
|
||||
<type name="Magento\Cms\Controller\Adminhtml\Block\Save">
|
||||
<plugin name="esun_localetranslation_cms_block_scope_save"
|
||||
type="Esun\MultiLocaleTranslation\Plugin\Adminhtml\CmsBlockSave"
|
||||
sortOrder="10"/>
|
||||
</type>
|
||||
<type name="Mageplaza\Blog\Block\Adminhtml\Post\Edit">
|
||||
<plugin name="esun_localetranslation_blog_post_translate_button"
|
||||
type="Esun\MultiLocaleTranslation\Plugin\Adminhtml\BlogPostEditButton"
|
||||
sortOrder="20"/>
|
||||
</type>
|
||||
<type name="Mageplaza\Blog\Controller\Adminhtml\Post\Save">
|
||||
<plugin name="esun_localetranslation_blog_post_scope_save"
|
||||
type="Esun\MultiLocaleTranslation\Plugin\Adminhtml\BlogPostSave"
|
||||
sortOrder="10"/>
|
||||
</type>
|
||||
<type name="Esun\Wiki\Block\Adminhtml\Category\EditBlock">
|
||||
<plugin name="esun_localetranslation_wiki_category_translate_button"
|
||||
type="Esun\MultiLocaleTranslation\Plugin\Adminhtml\WikiCategoryTranslateButton"
|
||||
sortOrder="20"/>
|
||||
</type>
|
||||
<type name="Esun\Wiki\Block\Adminhtml\Homepage\EditBlock">
|
||||
<plugin name="esun_localetranslation_wiki_homepage_translate_button"
|
||||
type="Esun\MultiLocaleTranslation\Plugin\Adminhtml\WikiHomepageTranslateButton"
|
||||
sortOrder="20"/>
|
||||
</type>
|
||||
</config>
|
||||
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0"?>
|
||||
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd">
|
||||
<event name="adminhtml_blog_edit_form_prepare_form">
|
||||
<observer name="esun_multilocale_prepare_blog_post_form"
|
||||
instance="Esun\MultiLocaleTranslation\Observer\Adminhtml\PrepareBlogPostForm"/>
|
||||
</event>
|
||||
</config>
|
||||
@@ -0,0 +1,40 @@
|
||||
<?xml version="1.0"?>
|
||||
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Backend:etc/menu.xsd">
|
||||
<menu>
|
||||
<add id="Esun_MultiLocaleTranslation::translation_management"
|
||||
title="Translation Management"
|
||||
module="Esun_MultiLocaleTranslation"
|
||||
sortOrder="60"
|
||||
parent="Esun_ImageManager::esun"
|
||||
resource="Esun_MultiLocaleTranslation::translation"/>
|
||||
<add id="Esun_MultiLocaleTranslation::batch_translation"
|
||||
title="Batch Translation"
|
||||
module="Esun_MultiLocaleTranslation"
|
||||
sortOrder="10"
|
||||
parent="Esun_MultiLocaleTranslation::translation_management"
|
||||
action="localetranslate/queue/new"
|
||||
resource="Esun_MultiLocaleTranslation::queue_add"/>
|
||||
<add id="Esun_MultiLocaleTranslation::translation_queue"
|
||||
title="Translation Queue"
|
||||
module="Esun_MultiLocaleTranslation"
|
||||
sortOrder="20"
|
||||
parent="Esun_MultiLocaleTranslation::translation_management"
|
||||
action="localetranslate/queue/index"
|
||||
resource="Esun_MultiLocaleTranslation::translation_queue"/>
|
||||
<add id="Esun_MultiLocaleTranslation::translation_log"
|
||||
title="Translation API Log"
|
||||
module="Esun_MultiLocaleTranslation"
|
||||
sortOrder="30"
|
||||
parent="Esun_MultiLocaleTranslation::translation_management"
|
||||
action="localetranslate/log/index"
|
||||
resource="Esun_MultiLocaleTranslation::translation_log"/>
|
||||
<add id="Esun_MultiLocaleTranslation::translation_configuration"
|
||||
title="Configuration"
|
||||
module="Esun_MultiLocaleTranslation"
|
||||
sortOrder="40"
|
||||
parent="Esun_MultiLocaleTranslation::translation_management"
|
||||
action="adminhtml/system_config/edit/section/esun_multilocale_translation"
|
||||
resource="Esun_MultiLocaleTranslation::config"/>
|
||||
</menu>
|
||||
</config>
|
||||
@@ -0,0 +1,9 @@
|
||||
<?xml version="1.0"?>
|
||||
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Backend:etc/routes.xsd">
|
||||
<router id="admin">
|
||||
<route id="localetranslate" frontName="localetranslate">
|
||||
<module name="Esun_MultiLocaleTranslation"/>
|
||||
</route>
|
||||
</router>
|
||||
</config>
|
||||
@@ -0,0 +1,154 @@
|
||||
<?xml version="1.0"?>
|
||||
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Config:etc/system_file.xsd">
|
||||
<system>
|
||||
<tab id="esun" translate="label" sortOrder="300">
|
||||
<label>Esun</label>
|
||||
</tab>
|
||||
<section id="esun_multilocale_translation" translate="label" type="text" sortOrder="920"
|
||||
showInDefault="1" showInWebsite="0" showInStore="0">
|
||||
<label>Multi-Locale Translation</label>
|
||||
<tab>esun</tab>
|
||||
<resource>Esun_MultiLocaleTranslation::config</resource>
|
||||
<group id="general" translate="label" type="text" sortOrder="5"
|
||||
showInDefault="1" showInWebsite="0" showInStore="0">
|
||||
<label>General</label>
|
||||
<field id="default_provider" translate="label comment" type="select" sortOrder="10"
|
||||
showInDefault="1" showInWebsite="0" showInStore="0">
|
||||
<label>Default Translation Provider</label>
|
||||
<comment>The popup selects this provider when it is enabled.</comment>
|
||||
<source_model>Esun\MultiLocaleTranslation\Model\Config\Source\TranslationProvider</source_model>
|
||||
</field>
|
||||
<field id="default_source_language" translate="label comment" type="text" sortOrder="20"
|
||||
showInDefault="1" showInWebsite="0" showInStore="0">
|
||||
<label>Default Scope Source Language</label>
|
||||
<comment>Language code for Magento default values, normally en.</comment>
|
||||
</field>
|
||||
<field id="skipped_fields" translate="label comment" type="multiselect" sortOrder="30"
|
||||
showInDefault="1" showInWebsite="0" showInStore="0" canRestore="1">
|
||||
<label>Skipped Fields</label>
|
||||
<comment>Selected fields are excluded from popup and batch translation. Leave empty to translate all currently supported fields.</comment>
|
||||
<source_model>Esun\MultiLocaleTranslation\Model\Config\Source\SkippedFields</source_model>
|
||||
</field>
|
||||
</group>
|
||||
<group id="deepl" translate="label" type="text" sortOrder="10"
|
||||
showInDefault="1" showInWebsite="0" showInStore="0">
|
||||
<label>DeepL Translation API</label>
|
||||
<comment><![CDATA[
|
||||
<div class="message message-notice">
|
||||
<strong>如何创建 DeepL API Key:</strong>
|
||||
<ol>
|
||||
<li>打开 <a href="https://www.deepl.com/pro-api" target="_blank" rel="noopener noreferrer">DeepL API</a>,注册 API Free 或 API Pro 套餐。</li>
|
||||
<li>登录 DeepL 账号,在“API Keys”页面创建并复制 Auth Key。</li>
|
||||
<li>API Free 选择 <code>api-free.deepl.com</code>;API Pro 选择 <code>api.deepl.com</code>。</li>
|
||||
<li>把 Key 填入下面的 API Key,设置 Enable 为 Yes 并保存。</li>
|
||||
</ol>
|
||||
<p><strong>安全提醒:</strong>API Key 只会加密保存在 Magento 后台,不会发送到浏览器。Free Key 通常以 <code>:fx</code> 结尾。</p>
|
||||
</div>
|
||||
]]></comment>
|
||||
<field id="enabled" translate="label comment" type="select" sortOrder="10"
|
||||
showInDefault="1" showInWebsite="0" showInStore="0">
|
||||
<label>Enable</label>
|
||||
<comment>Enable DeepL automatic translation in the translation popup.</comment>
|
||||
<source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
|
||||
</field>
|
||||
<field id="api_url" translate="label comment" type="select" sortOrder="20"
|
||||
showInDefault="1" showInWebsite="0" showInStore="0">
|
||||
<label>API URL</label>
|
||||
<comment>Select the endpoint matching your DeepL API Free or API Pro account.</comment>
|
||||
<source_model>Esun\MultiLocaleTranslation\Model\Config\Source\DeepLApiUrl</source_model>
|
||||
</field>
|
||||
<field id="auth_key" translate="label comment" type="obscure" sortOrder="30"
|
||||
showInDefault="1" showInWebsite="0" showInStore="0">
|
||||
<label>API Key</label>
|
||||
<comment>Get the DeepL API Key from your DeepL account and enter it here.</comment>
|
||||
<backend_model>Magento\Config\Model\Config\Backend\Encrypted</backend_model>
|
||||
</field>
|
||||
<field id="formality" translate="label comment" type="select" sortOrder="40"
|
||||
showInDefault="1" showInWebsite="0" showInStore="0">
|
||||
<label>Formality</label>
|
||||
<comment>Prefer a formal or informal style when the target language supports it.</comment>
|
||||
<source_model>Esun\MultiLocaleTranslation\Model\Config\Source\DeepLFormality</source_model>
|
||||
</field>
|
||||
<field id="timeout" translate="label comment" type="text" sortOrder="50"
|
||||
showInDefault="1" showInWebsite="0" showInStore="0">
|
||||
<label>Request Timeout (seconds)</label>
|
||||
<comment>Allowed range: 5–120 seconds.</comment>
|
||||
<validate>validate-number validate-greater-than-zero</validate>
|
||||
</field>
|
||||
</group>
|
||||
<group id="google" translate="label" type="text" sortOrder="20"
|
||||
showInDefault="1" showInWebsite="0" showInStore="0">
|
||||
<label>Google Cloud Translation</label>
|
||||
<comment><![CDATA[
|
||||
<div class="message message-notice">
|
||||
<strong>如何创建 Google Cloud Translation V3 服务账号:</strong>
|
||||
<ol>
|
||||
<li>登录 <a href="https://console.cloud.google.com/projectcreate" target="_blank" rel="noopener noreferrer">Google Cloud Console</a>,创建或选择一个项目。</li>
|
||||
<li>为项目绑定 Billing 结算账号。Google Cloud Translation 是计费服务。</li>
|
||||
<li>打开 <a href="https://console.cloud.google.com/apis/library/translate.googleapis.com" target="_blank" rel="noopener noreferrer">Cloud Translation API</a>,点击“启用”。</li>
|
||||
<li>进入 <a href="https://console.cloud.google.com/iam-admin/serviceaccounts" target="_blank" rel="noopener noreferrer">IAM 和管理 → 服务账号</a>,创建服务账号。</li>
|
||||
<li>为服务账号分配 <strong>Cloud Translation API User</strong> 角色(<code>roles/cloudtranslate.user</code>)。</li>
|
||||
<li>打开该服务账号的“密钥”,选择“添加密钥 → 创建新密钥 → JSON”,下载 JSON 文件。</li>
|
||||
<li>把 JSON 文件上传到下面的 <strong>Service Account JSON</strong>,设置 Enable 为 Yes,然后保存配置。</li>
|
||||
</ol>
|
||||
<p><strong>安全提醒:</strong>JSON 文件包含私钥,请勿通过聊天、邮件或公共网盘发送;如果泄露,请立即在 Google Cloud 删除该密钥并重新创建。</p>
|
||||
<p>普通翻译请选择 Location = <code>global</code>。只有使用 Google Glossary 时才选择 <code>us-central1</code> 并填写 Glossary ID。</p>
|
||||
</div>
|
||||
]]></comment>
|
||||
<field id="enabled" translate="label comment" type="select" sortOrder="10"
|
||||
showInDefault="1" showInWebsite="0" showInStore="0">
|
||||
<label>Enable</label>
|
||||
<comment>Uses Google Cloud Translation Advanced v3 (NMT / Glossary).</comment>
|
||||
<source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
|
||||
</field>
|
||||
<field id="credentials_file" translate="label comment" type="file" sortOrder="20"
|
||||
showInDefault="1" showInWebsite="0" showInStore="0">
|
||||
<label>Service Account JSON</label>
|
||||
<comment>Upload a Google service account JSON key. It is validated and stored privately under var/, never pub/media.</comment>
|
||||
<backend_model>Esun\MultiLocaleTranslation\Model\Config\Backend\ServiceAccountFile</backend_model>
|
||||
<upload_dir config="system/filesystem/var">esun/multilocale_translation/google</upload_dir>
|
||||
</field>
|
||||
<field id="location" translate="label comment" type="select" sortOrder="30"
|
||||
showInDefault="1" showInWebsite="0" showInStore="0">
|
||||
<label>Location</label>
|
||||
<comment>Use global normally. Google Glossary currently requires us-central1.</comment>
|
||||
<source_model>Esun\MultiLocaleTranslation\Model\Config\Source\GoogleLocation</source_model>
|
||||
</field>
|
||||
<field id="glossary_id" translate="label comment" type="text" sortOrder="40"
|
||||
showInDefault="1" showInWebsite="0" showInStore="0">
|
||||
<label>Glossary ID (optional)</label>
|
||||
<comment>Enter only the existing Google Glossary ID. When set, Location must be us-central1.</comment>
|
||||
</field>
|
||||
<field id="glossary_ignore_case" translate="label comment" type="select" sortOrder="50"
|
||||
showInDefault="1" showInWebsite="0" showInStore="0">
|
||||
<label>Glossary Ignore Case</label>
|
||||
<comment>Apply glossary terms without case sensitivity.</comment>
|
||||
<source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
|
||||
</field>
|
||||
<field id="timeout" translate="label comment" type="text" sortOrder="60"
|
||||
showInDefault="1" showInWebsite="0" showInStore="0">
|
||||
<label>Request Timeout (seconds)</label>
|
||||
<comment>Allowed range: 5–120 seconds.</comment>
|
||||
<validate>validate-number validate-greater-than-zero</validate>
|
||||
</field>
|
||||
</group>
|
||||
<group id="queue" translate="label" type="text" sortOrder="30"
|
||||
showInDefault="1" showInWebsite="0" showInStore="0">
|
||||
<label>Translation Queue</label>
|
||||
<field id="tasks_per_run" translate="label comment" type="text" sortOrder="10"
|
||||
showInDefault="1" showInWebsite="0" showInStore="0">
|
||||
<label>Tasks Per Run</label>
|
||||
<comment>Maximum tasks processed each minute. Allowed range: 1–50.</comment>
|
||||
<validate>validate-digits validate-greater-than-zero</validate>
|
||||
</field>
|
||||
<field id="time_limit" translate="label comment" type="text" sortOrder="20"
|
||||
showInDefault="1" showInWebsite="0" showInStore="0">
|
||||
<label>Time Limit (seconds)</label>
|
||||
<comment>Stops claiming new tasks after this time. The current task is allowed to finish. Allowed range: 10–300 seconds.</comment>
|
||||
<validate>validate-digits validate-greater-than-zero</validate>
|
||||
</field>
|
||||
</group>
|
||||
</section>
|
||||
</system>
|
||||
</config>
|
||||
@@ -0,0 +1,28 @@
|
||||
<?xml version="1.0"?>
|
||||
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Store:etc/config.xsd">
|
||||
<default>
|
||||
<esun_multilocale_translation>
|
||||
<general>
|
||||
<default_provider>deepl</default_provider>
|
||||
<default_source_language>en</default_source_language>
|
||||
</general>
|
||||
<deepl>
|
||||
<enabled>0</enabled>
|
||||
<api_url>https://api-free.deepl.com/v2/translate</api_url>
|
||||
<formality>default</formality>
|
||||
<timeout>30</timeout>
|
||||
</deepl>
|
||||
<google>
|
||||
<enabled>0</enabled>
|
||||
<location>global</location>
|
||||
<glossary_ignore_case>1</glossary_ignore_case>
|
||||
<timeout>30</timeout>
|
||||
</google>
|
||||
<queue>
|
||||
<tasks_per_run>10</tasks_per_run>
|
||||
<time_limit>50</time_limit>
|
||||
</queue>
|
||||
</esun_multilocale_translation>
|
||||
</default>
|
||||
</config>
|
||||
@@ -0,0 +1,11 @@
|
||||
<?xml version="1.0"?>
|
||||
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Cron:etc/crontab.xsd">
|
||||
<group id="default">
|
||||
<job name="esun_multilocale_translation_queue"
|
||||
instance="Esun\MultiLocaleTranslation\Model\Queue\CronConsumer"
|
||||
method="execute">
|
||||
<schedule>* * * * *</schedule>
|
||||
</job>
|
||||
</group>
|
||||
</config>
|
||||
@@ -0,0 +1,98 @@
|
||||
<?xml version="1.0"?>
|
||||
<!--
|
||||
Custom store-specific translations for CMS entities while keeping same page_id/block_id
|
||||
-->
|
||||
<schema xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:noNamespaceSchemaLocation="urn:magento:framework:Setup/Declaration/Schema/etc/schema.xsd">
|
||||
<table name="esun_localetranslation_cms" resource="default" engine="innodb" comment="Locale Translation for CMS Entities">
|
||||
<column xsi:type="int" name="translation_id" unsigned="true" nullable="false" identity="true" comment="Translation ID"/>
|
||||
<column xsi:type="varchar" name="entity_type" nullable="false" length="32" comment="cms_page or cms_block"/>
|
||||
<column xsi:type="int" name="entity_id" unsigned="true" nullable="false" comment="CMS Entity ID"/>
|
||||
<column xsi:type="smallint" name="store_id" unsigned="true" nullable="false" comment="Store ID"/>
|
||||
<column xsi:type="varchar" name="field_name" nullable="false" length="64" comment="Field code"/>
|
||||
<column xsi:type="mediumtext" name="translated_value" nullable="true" comment="Translated field value"/>
|
||||
<column xsi:type="timestamp" name="created_at" on_update="false" nullable="false" default="CURRENT_TIMESTAMP"/>
|
||||
<column xsi:type="timestamp" name="updated_at" on_update="true" nullable="false" default="CURRENT_TIMESTAMP"/>
|
||||
|
||||
<constraint xsi:type="primary" referenceId="PRIMARY">
|
||||
<column name="translation_id"/>
|
||||
</constraint>
|
||||
<constraint xsi:type="unique" referenceId="E3LTC_TRANSLATION_LOOKUP">
|
||||
<column name="entity_type"/>
|
||||
<column name="entity_id"/>
|
||||
<column name="store_id"/>
|
||||
<column name="field_name"/>
|
||||
</constraint>
|
||||
<index referenceId="ESLTC_ENTITY" indexType="btree">
|
||||
<column name="entity_type"/>
|
||||
<column name="entity_id"/>
|
||||
<column name="store_id"/>
|
||||
</index>
|
||||
</table>
|
||||
|
||||
<table name="esun_localetranslation_log" resource="default" engine="innodb" comment="Automatic Translation API Log">
|
||||
<column xsi:type="bigint" name="log_id" unsigned="true" nullable="false" identity="true" comment="Log ID"/>
|
||||
<column xsi:type="varchar" name="provider" nullable="false" length="32" comment="Translation Provider"/>
|
||||
<column xsi:type="varchar" name="entity_type" nullable="true" length="32" comment="Entity Type"/>
|
||||
<column xsi:type="int" name="entity_id" unsigned="true" nullable="true" comment="Entity ID"/>
|
||||
<column xsi:type="varchar" name="field_name" nullable="true" length="128" comment="Field Code"/>
|
||||
<column xsi:type="smallint" name="source_store_id" unsigned="true" nullable="false" default="0" comment="Source Store ID"/>
|
||||
<column xsi:type="smallint" name="target_store_id" unsigned="true" nullable="false" comment="Target Store ID"/>
|
||||
<column xsi:type="varchar" name="source_language" nullable="true" length="16" comment="Source Language"/>
|
||||
<column xsi:type="varchar" name="target_language" nullable="true" length="16" comment="Target Language"/>
|
||||
<column xsi:type="mediumtext" name="source_text" nullable="true" comment="Source Text"/>
|
||||
<column xsi:type="mediumtext" name="translated_text" nullable="true" comment="Translated Text"/>
|
||||
<column xsi:type="varchar" name="status" nullable="false" length="16" default="success" comment="Status"/>
|
||||
<column xsi:type="text" name="error_message" nullable="true" comment="Error Message"/>
|
||||
<column xsi:type="int" name="character_count" unsigned="true" nullable="false" default="0" comment="Source Character Count"/>
|
||||
<column xsi:type="timestamp" name="created_at" on_update="false" nullable="false" default="CURRENT_TIMESTAMP" comment="Created At"/>
|
||||
<column xsi:type="timestamp" name="updated_at" on_update="true" nullable="false" default="CURRENT_TIMESTAMP" comment="Updated At"/>
|
||||
|
||||
<constraint xsi:type="primary" referenceId="PRIMARY">
|
||||
<column name="log_id"/>
|
||||
</constraint>
|
||||
<index referenceId="ESUN_MLT_LOG_PROVIDER_STATUS" indexType="btree">
|
||||
<column name="provider"/>
|
||||
<column name="status"/>
|
||||
</index>
|
||||
<index referenceId="ESUN_MLT_LOG_ENTITY" indexType="btree">
|
||||
<column name="entity_type"/>
|
||||
<column name="entity_id"/>
|
||||
</index>
|
||||
<index referenceId="ESUN_MLT_LOG_CREATED_AT" indexType="btree">
|
||||
<column name="created_at"/>
|
||||
</index>
|
||||
</table>
|
||||
|
||||
<table name="esun_localetranslation_queue" resource="default" engine="innodb" comment="Automatic Translation Queue">
|
||||
<column xsi:type="bigint" name="queue_id" unsigned="true" nullable="false" identity="true" comment="Queue ID"/>
|
||||
<column xsi:type="varchar" name="batch_id" nullable="false" length="32" comment="Batch ID"/>
|
||||
<column xsi:type="varchar" name="provider" nullable="false" length="32" comment="Translation Provider"/>
|
||||
<column xsi:type="varchar" name="entity_type" nullable="false" length="32" comment="Entity Type"/>
|
||||
<column xsi:type="int" name="entity_id" unsigned="true" nullable="false" comment="Entity ID"/>
|
||||
<column xsi:type="smallint" name="source_store_id" unsigned="true" nullable="false" default="0" comment="Source Store ID"/>
|
||||
<column xsi:type="smallint" name="target_store_id" unsigned="true" nullable="false" comment="Target Store ID"/>
|
||||
<column xsi:type="varchar" name="status" nullable="false" length="16" default="pending" comment="Queue Status"/>
|
||||
<column xsi:type="smallint" name="attempts" unsigned="true" nullable="false" default="0" comment="Processing Attempts"/>
|
||||
<column xsi:type="text" name="error_message" nullable="true" comment="Error Message"/>
|
||||
<column xsi:type="timestamp" name="created_at" on_update="false" nullable="false" default="CURRENT_TIMESTAMP" comment="Created At"/>
|
||||
<column xsi:type="timestamp" name="started_at" on_update="false" nullable="true" comment="Started At"/>
|
||||
<column xsi:type="timestamp" name="finished_at" on_update="false" nullable="true" comment="Finished At"/>
|
||||
<column xsi:type="timestamp" name="updated_at" on_update="true" nullable="false" default="CURRENT_TIMESTAMP" comment="Updated At"/>
|
||||
|
||||
<constraint xsi:type="primary" referenceId="PRIMARY">
|
||||
<column name="queue_id"/>
|
||||
</constraint>
|
||||
<index referenceId="ESUN_MLT_QUEUE_STATUS_CREATED" indexType="btree">
|
||||
<column name="status"/>
|
||||
<column name="created_at"/>
|
||||
</index>
|
||||
<index referenceId="ESUN_MLT_QUEUE_BATCH" indexType="btree">
|
||||
<column name="batch_id"/>
|
||||
</index>
|
||||
<index referenceId="ESUN_MLT_QUEUE_ENTITY" indexType="btree">
|
||||
<column name="entity_type"/>
|
||||
<column name="entity_id"/>
|
||||
</index>
|
||||
</table>
|
||||
</schema>
|
||||
@@ -0,0 +1,75 @@
|
||||
{
|
||||
"esun_localetranslation_cms": {
|
||||
"column": {
|
||||
"translation_id": true,
|
||||
"entity_type": true,
|
||||
"entity_id": true,
|
||||
"store_id": true,
|
||||
"field_name": true,
|
||||
"translated_value": true,
|
||||
"created_at": true,
|
||||
"updated_at": true
|
||||
},
|
||||
"constraint": {
|
||||
"PRIMARY": true,
|
||||
"E3LTC_TRANSLATION_LOOKUP": true
|
||||
},
|
||||
"index": {
|
||||
"ESLTC_ENTITY": true
|
||||
}
|
||||
},
|
||||
"esun_localetranslation_log": {
|
||||
"column": {
|
||||
"log_id": true,
|
||||
"provider": true,
|
||||
"entity_type": true,
|
||||
"entity_id": true,
|
||||
"field_name": true,
|
||||
"source_store_id": true,
|
||||
"target_store_id": true,
|
||||
"source_language": true,
|
||||
"target_language": true,
|
||||
"source_text": true,
|
||||
"translated_text": true,
|
||||
"status": true,
|
||||
"error_message": true,
|
||||
"character_count": true,
|
||||
"created_at": true,
|
||||
"updated_at": true
|
||||
},
|
||||
"constraint": {
|
||||
"PRIMARY": true
|
||||
},
|
||||
"index": {
|
||||
"ESUN_MLT_LOG_PROVIDER_STATUS": true,
|
||||
"ESUN_MLT_LOG_ENTITY": true,
|
||||
"ESUN_MLT_LOG_CREATED_AT": true
|
||||
}
|
||||
},
|
||||
"esun_localetranslation_queue": {
|
||||
"column": {
|
||||
"queue_id": true,
|
||||
"batch_id": true,
|
||||
"provider": true,
|
||||
"entity_type": true,
|
||||
"entity_id": true,
|
||||
"source_store_id": true,
|
||||
"target_store_id": true,
|
||||
"status": true,
|
||||
"attempts": true,
|
||||
"error_message": true,
|
||||
"created_at": true,
|
||||
"started_at": true,
|
||||
"finished_at": true,
|
||||
"updated_at": true
|
||||
},
|
||||
"constraint": {
|
||||
"PRIMARY": true
|
||||
},
|
||||
"index": {
|
||||
"ESUN_MLT_QUEUE_STATUS_CREATED": true,
|
||||
"ESUN_MLT_QUEUE_BATCH": true,
|
||||
"ESUN_MLT_QUEUE_ENTITY": true
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,83 @@
|
||||
<?xml version="1.0"?>
|
||||
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
|
||||
<type name="Magento\Cms\Model\Page">
|
||||
<plugin name="esun_localetranslation_cms_page_loader" type="Esun\MultiLocaleTranslation\Plugin\Cms\ApplyStoreTranslationToPage" sortOrder="20"/>
|
||||
</type>
|
||||
<type name="Magento\Cms\Model\Block">
|
||||
<plugin name="esun_localetranslation_cms_block_loader" type="Esun\MultiLocaleTranslation\Plugin\Cms\ApplyStoreTranslationToBlock" sortOrder="20"/>
|
||||
</type>
|
||||
<type name="Mageplaza\Blog\Model\Post">
|
||||
<plugin name="esun_localetranslation_blog_post_loader"
|
||||
type="Esun\MultiLocaleTranslation\Plugin\Blog\ApplyStoreTranslationToPost"
|
||||
sortOrder="20"/>
|
||||
</type>
|
||||
<type name="Mageplaza\Blog\Model\ResourceModel\Post\Collection">
|
||||
<plugin name="esun_localetranslation_blog_post_collection_loader"
|
||||
type="Esun\MultiLocaleTranslation\Plugin\Blog\ApplyStoreTranslationToPostCollection"
|
||||
sortOrder="20"/>
|
||||
</type>
|
||||
<type name="Esun\Wiki\Model\Category">
|
||||
<plugin name="esun_localetranslation_wiki_loader"
|
||||
type="Esun\MultiLocaleTranslation\Plugin\Wiki\ApplyWikiTranslation"
|
||||
sortOrder="20"/>
|
||||
</type>
|
||||
<type name="Esun\Wiki\Model\ResourceModel\Category\Collection">
|
||||
<plugin name="esun_localetranslation_wiki_category_collection_loader"
|
||||
type="Esun\MultiLocaleTranslation\Plugin\Wiki\ApplyWikiCategoryCollectionTranslation"
|
||||
sortOrder="20"/>
|
||||
</type>
|
||||
<type name="Esun\Wiki\Model\ResourceModel\Homepage\Collection">
|
||||
<plugin name="esun_localetranslation_wiki_homepage_collection_loader"
|
||||
type="Esun\MultiLocaleTranslation\Plugin\Wiki\ApplyWikiHomepageCollectionTranslation"
|
||||
sortOrder="20"/>
|
||||
</type>
|
||||
<type name="Esun\Wiki\Block\Wiki\View">
|
||||
<plugin name="esun_localetranslation_wiki_search"
|
||||
type="Esun\MultiLocaleTranslation\Plugin\Wiki\SearchTranslatedCategories"
|
||||
sortOrder="20"/>
|
||||
</type>
|
||||
<type name="Esun\MultiLocaleTranslation\Model\EntityPool">
|
||||
<arguments>
|
||||
<argument name="entities" xsi:type="array">
|
||||
<item name="product" xsi:type="object">Esun\MultiLocaleTranslation\Model\Entity\ProductEntity</item>
|
||||
<item name="category" xsi:type="object">Esun\MultiLocaleTranslation\Model\Entity\CategoryEntity</item>
|
||||
<item name="cms_page" xsi:type="object">Esun\MultiLocaleTranslation\Model\Entity\CmsPageEntity</item>
|
||||
<item name="cms_block" xsi:type="object">Esun\MultiLocaleTranslation\Model\Entity\CmsBlockEntity</item>
|
||||
<item name="blog_post" xsi:type="object">Esun\MultiLocaleTranslation\Model\Entity\BlogPostEntity</item>
|
||||
<item name="wiki_category" xsi:type="object">Esun\MultiLocaleTranslation\Model\Entity\WikiCategoryEntity</item>
|
||||
<item name="wiki_homepage" xsi:type="object">Esun\MultiLocaleTranslation\Model\Entity\WikiHomepageEntity</item>
|
||||
</argument>
|
||||
</arguments>
|
||||
</type>
|
||||
<type name="Esun\MultiLocaleTranslation\Model\ProviderPool">
|
||||
<arguments>
|
||||
<argument name="providers" xsi:type="array">
|
||||
<item name="deepl" xsi:type="object">Esun\MultiLocaleTranslation\Model\Provider\DeepL</item>
|
||||
<item name="google" xsi:type="object">Esun\MultiLocaleTranslation\Model\Provider\Google</item>
|
||||
</argument>
|
||||
</arguments>
|
||||
</type>
|
||||
<type name="Magento\Framework\View\Element\UiComponent\DataProvider\CollectionFactory">
|
||||
<arguments>
|
||||
<argument name="collections" xsi:type="array">
|
||||
<item name="esun_mlt_log_listing_data_source" xsi:type="string">EsunMultiLocaleTranslationLogGridCollection</item>
|
||||
<item name="esun_mlt_queue_listing_data_source" xsi:type="string">EsunMultiLocaleTranslationQueueGridCollection</item>
|
||||
</argument>
|
||||
</arguments>
|
||||
</type>
|
||||
<virtualType name="EsunMultiLocaleTranslationLogGridCollection"
|
||||
type="Magento\Framework\View\Element\UiComponent\DataProvider\SearchResult">
|
||||
<arguments>
|
||||
<argument name="mainTable" xsi:type="string">esun_localetranslation_log</argument>
|
||||
<argument name="resourceModel" xsi:type="string">Esun\MultiLocaleTranslation\Model\ResourceModel\Log</argument>
|
||||
</arguments>
|
||||
</virtualType>
|
||||
<virtualType name="EsunMultiLocaleTranslationQueueGridCollection"
|
||||
type="Magento\Framework\View\Element\UiComponent\DataProvider\SearchResult">
|
||||
<arguments>
|
||||
<argument name="mainTable" xsi:type="string">esun_localetranslation_queue</argument>
|
||||
<argument name="resourceModel" xsi:type="string">Esun\MultiLocaleTranslation\Model\ResourceModel\Queue</argument>
|
||||
</arguments>
|
||||
</virtualType>
|
||||
</config>
|
||||
@@ -0,0 +1,16 @@
|
||||
<?xml version="1.0"?>
|
||||
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
|
||||
<module name="Esun_MultiLocaleTranslation" setup_version="1.0.0">
|
||||
<sequence>
|
||||
<module name="Magento_Cms"/>
|
||||
<module name="Magento_Catalog"/>
|
||||
<module name="Magento_Backend"/>
|
||||
<module name="Magento_Config"/>
|
||||
<module name="Magento_Store"/>
|
||||
<module name="Magento_Cron"/>
|
||||
<module name="Mageplaza_Blog"/>
|
||||
<module name="Esun_Wiki"/>
|
||||
</sequence>
|
||||
</module>
|
||||
</config>
|
||||
Reference in New Issue
Block a user