mastox/react-i18-next-translation-bundle

A Symfony bundle for react-i18next

dev-master 2021-06-18 19:30 UTC

This package is auto-updated.

Last update: 2024-05-19 01:44:20 UTC


README

Installation

composer require mastox/react-i18-next-translation-bundle:@dev

Register route

#/config/routes/annotations.yaml
react_i18_next_translation:
    resource: "@ReactI18NextTranslationBundle/Resources/config/routes/routes.xml"

Register bundle

#/config/bundles.php
return [
    /* */
    Mastox\ReactI18NextTranslationBundle\ReactI18NextTranslationBundle::class => ['all' => true],
    /* */
];

To change file extension of your translation files if you have .php create a file react_i18_next_translation.yaml php and yaml are supported at the moment.

#config/packages/dev || server/config/prod || server/config/
react_i18_next_translation:
  file_extension: 'xlf'

Usage

localhost/react_i18_next_translation/locales/{LANG-KEY}/{NAMESPACE}.json

localhost/react_i18_next_translation/locales/fr/messages.json