PHP code example of spryker-community / product-management-ai-translator

1. Go to this page and download the library: Download spryker-community/product-management-ai-translator library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

spryker-community / product-management-ai-translator example snippets


# config/Shared/config_default.php

$config[KernelConstants::CORE_NAMESPACES] = [
    ...
    'SprykerCommunity',
];


# src/Pyz/Zed/Router/RouterConfig.php

public function getControllerDirectories(): array
{
    ...
    $controllerDirectories[] = sprintf('%s/spryker-community/*/src/*/Zed/*/Communication/Controller/', APPLICATION_VENDOR_DIR);
    ...
}



namespace Pyz\Client\AiTranslator;

use SprykerCommunity\Client\AiTranslator\AiTranslatorDependencyProvider as SprykerCommunityAiTranslatorDependencyProviderAlias;
use SprykerCommunity\Client\AiTranslator\Dependency\Plugin\TranslatorEnginePluginInterface;
use SprykerCommunity\Client\OpenAiTranslator\Plugin\AiTranslator\OpenAiTranslatorEnginePlugin;

class AiTranslatorDependencyProvider extends SprykerCommunityAiTranslatorDependencyProviderAlias
{
    /**
     * @return \SprykerCommunity\Client\AiTranslator\Dependency\Plugin\TranslatorEnginePluginInterface
     */
    protected function getTranslatorEnginePlugin(): TranslatorEnginePluginInterface
    {
        return new OpenAiTranslatorEnginePlugin();
    }
}