PHP code example of spryker-community / spryker-translations

1. Go to this page and download the library: Download spryker-community/spryker-translations 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 / spryker-translations example snippets




namespace Pyz\Zed\Translator;

use Spryker\Zed\Translator\TranslatorConfig as SprykerTranslatorConfig;

class TranslatorConfig extends SprykerTranslatorConfig
{
    /**
     * @return array<string>
     */
    public function getCoreTranslationFilePathPatterns(): array
    {
        $coreTranslationFilePathPatterns = parent::getCoreTranslationFilePathPatterns();
        
        // load all translations for all locales
        $coreTranslationFilePathPatterns[] = APPLICATION_VENDOR_DIR . '/spryker-community/spryker-translations/Zed/*/[a-z][a-z]_[A-Z][A-Z].csv';
        
        // or only load the es_ES specific translations
        $coreTranslationFilePathPatterns[] = APPLICATION_VENDOR_DIR . '/spryker-community/spryker-translations/Zed/*/es_ES.csv';

        return $coreTranslationFilePathPatterns;
    }
}