spryker-community/spryker-translations

Translations for Spryker Cloud Commerce OS

0.1.0 2024-04-03 17:14 UTC

This package is auto-updated.

Last update: 2024-11-04 16:37:58 UTC


README

Spryker i18n Translations

Adds support for multiple languages to Spryker OS

🇦🇪 🇨🇳 🇫🇷 🇮🇹 🇳🇱 🇵🇹 🇪🇸

SupportInstallationContributing

Support

Spryker OS is initially equipped with English (US) and German (Germany) translations. This package extends support to include the following additional languages:

Languages

  • Arabic (United Arab Emirates) - ar_AE
  • Chinese (China) - zh_CN
  • French (France) - fr_FR
  • Italian (Italy) - it_IT
  • Dutch (Netherlands) - nl_NL
  • Portuguese (Portugal) - pt_PT
  • Spanish (Spain) - es_ES

Note

The initial version of these translations are created by AI. By releasing these to our community on GitHub and accepting PRs, we aim to improve this AI-generated baseline further with YOUR contributions!

Try it yourself for generating your customer-specific project translations to any language by installing the Spryker Community Toolkit.

Suites

Installation

Install the translations composer package:

composer require spryker-community/spryker-translations

Yves Storefront Translations

The translations for the Yves storefront depend on the Spryker Suite you are using. You can find them under the Yves/[Your-Spryker-Suite] directory in this repository.

1. Add the translations

Append the new translations for the desired languages to the project glossary data/import/common/common/glossary.csv.

You can find them at vendor/spryker-community/spryker-translations/Yves/[Your-Spryker-Suite]/glossary/[Your-Language-Locale].csv.

For instance, if you are using the Spryker B2C suite and need the translations for Spanish (Spain), you can easily run the following command:

cat vendor/spryker-community/spryker-translations/Yves/b2c-demo-shop/glossary/es_ES.csv >> data/import/common/common/glossary.csv

2. Import the glossary

console data:import:glossary

Zed Backoffice Translations

1. Configuration

Extend the translator configuration at the project level for loading the translations.

<?php

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;
    }
}

2. Clear the cache

console cache:empty-all

Contributing

We love being international here. The more languages Spryker OS will speak, the happier we will be. There is already a lot of happiness at Spryker, but let's bring some more! We love contributions, big or small.

Give us a hand. Please don't forget to read the contribution guidelines.

License

This package is released under the MIT license

Supported with ❤️ by the Spryker Community