Migrating from old template

Additional steps for websites which are depending on old template:

  • Remove old packages from package.json

    • react-i18next-extract
    • react3l-cli You may also want to remove lock file.
  • Install new @react3l packages for i18next extraction and cli:

    yarn add -D @react3l/i18next-extractor @react3l/cli
    
  • Migrate old translation files:

    yarn i18next-extractor migrate public/i18n/en
    yarn i18next-extractor migrate public/i18n/vi
    
  • Change extract and merge command from package.json: Replace executable name react-i18next-extractor by i18next-extractor

    For example:

    {
      "scripts": {
        "extract": "i18next-extractor -i src/ -o src/i18n/ -p src/i18n/ extract",
        "merge": "i18next-extractor -i src/ -o src/i18n/ -p src/i18n/ merge"
      }
    }
    
  • Modify core/LanguageService.ts

    In core/LanguageService, you might see this line:

    i18next.addResource(language, "", "", resource);
    

    Rewrite to:

    i18next.addResources(language, "", resource);