Integration guide

Translate Adobe Commerce (Magento) website with ai

1. Create an account

To get started, please follow the steps below:

  • Sign up at app.globalseo.ai.
  • Create a project and select the languages into which you want to translate your website.
  • Click: "Save and integrate"
  • Now you should see a popup that will show you two HTML code snippets. Follow the steps below to integrate the code into your website.

How to add the html script to your website:

1. Access Your Magento Admin Panel

  • Log in to your Magento admin panel using your administrator credentials.

2. Navigate to Content Configuration

  • From the admin sidebar, go to Content.
  • Under Design, click on Configuration.

3. Select the Theme to Edit

  • You will see a list of your store views and their corresponding themes.
  • Find the store view you want to edit (usually the Default Store View) and click on Edit under the Action column.

4. Edit the HTML Head

  • In the Edit Theme page, scroll down to the Other Settings section.
  • Click on the HTML Head tab to expand it.

5. Add HTML Code Snippet

  • In the Scripts and Style Sheets field, you can add your HTML code snippet.
  • This field allows you to add any HTML, JavaScript, or CSS that you want to include in the head tag of your pages.

6. Save the Configuration

  • After adding your code snippet, click the Save Configuration button located at the top right of the page.

7. Flush Cache

  • To ensure your changes take effect, you need to flush the cache.
  • Go to System from the admin sidebar.
  • Under Tools, click on Cache Management.
  • Select all cache types by clicking on the checkbox at the top of the list.
  • Click Flush Magento Cache.


Error: "Refused to load the script 'https://unpkg.com/weploy-translate/dist/weploy-translate.js' because it violates the following Content Security Policy directive: ."

1. Create or Edit the CSP Whitelist Configuration File

  • Navigate to your Magento installation directory.
  • If it doesn't exist already, create a new file in the following path: app/code/[Vendor]/[Module]/etc/csp_whitelist.xml. Replace [Vendor] and [Module] with your specific vendor and module names, e.g., Custom/Module.

2. Edit the csp_whitelist.xml File

  • Add the following XML content to the file, ensuring that the necessary hosts are included in the script-src and connect-src policies:
<?xml version="1.0" encoding="UTF-8"?>
<csp_whitelist xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Csp:etc/csp_whitelist.xsd">
    <policies>
        <policy id="script-src">
            <values>
                <value id="globalseo" type="host">cdn.globalseo.ai</value>
                <value id="globalseoapi" type="host">api.globalseo.ai</value>
                <value id="unpkg" type="host">unpkg.com</value>
            </values>
        </policy>
        <policy id="connect-src">
            <values>
                <value id="globalseo" type="host">cdn.globalseo.ai</value>
                <value id="globalseoapi" type="host">api.globalseo.ai</value>
                <value id="unpkg" type="host">unpkg.com</value>
            </values>
        </policy>
    </policies>
</csp_whitelist>

3. Enable the Module (if it is a new module)

  • If you created a new module for this, you need to enable it. Run the following commands from your Magento root directory:
php bin/magento module:enable [Vendor]_[Module]
php bin/magento setup:upgrade
php bin/magento setup:di:compile

Replace [Vendor] and [Module] with your specific names.

4. Flush the Cache

  • After making changes to the configuration, flush the cache to apply the changes:
php bin/magento cache:flush
Plus Icon
Integrate with
Adobe Commerce

Built by

Adobe Inc.

Category

E-Commerce

Welcome to the future of AI website localization

Start translating for your website in under 5 minutes. Sign up and get 2.000 translated words for free.

Get Started