Skip to content

A system to auto manage your react intl extractedMessages, into language files in a seperate repo, with added support for mozilla pontoon

License

Notifications You must be signed in to change notification settings

g-loot/react-i18n-manager

Repository files navigation

react-i18n-manager

A system to auto manage your react intl extractedMessages, into language files in a seperate repo, with added support for mozilla pontoon

import locales from 'gll-play-localization';

export default locales;
  • As of now it only supports .properties lang files which get parsed as json in runtime using propson package so you need to configure RawPlugin for fusebox to import .properties as string

  • pass down your locales configured like this

[
  {
    "name": "English",
    "codeName": "en",
    "locale": "en-US",
    "contentfulLocale": "en-US",
    "defaultLocale": true
  },
  {
    "name": "Vietnamese",
    "codeName": "vi",
    "locale": "vi",
    "contentfulLocale": "vi"
  },
  ...etc
]

Example Configuration for the node script you need to run

const syncTranslations = require('react-i18n-manager');
const supportedLocales = require('../supportedLocales.json');

syncTranslations({
  supportedLocales,
  srcDirectory: 'src',
  extractedMessagesDir: 'src/i18n/locales/extracted-messages',
  locallyGeneratedMessagesDir: 'src/i18n/locales/generated-messages',
  REPO_SSH_URL: '[email protected]:g-loot/gll-play-localization.git',
  REPO_EXTRL_DIR: 'gll-play-localization',
});

About

A system to auto manage your react intl extractedMessages, into language files in a seperate repo, with added support for mozilla pontoon

Resources

License

Stars

Watchers

Forks

Packages