options-base.ts 921 Bytes
Newer Older
Maxym Borodenko's avatar
Maxym Borodenko committed
1
const optionsBase = {
Matija Obreza's avatar
Matija Obreza committed
2 3 4
  fallbackLng: 'en',
  preload: ['en'],
  load: 'languageOnly', // we only provide en, de -> no region specific locals like en-US, de-DE
Maxym Borodenko's avatar
Maxym Borodenko committed
5

Matija Obreza's avatar
Matija Obreza committed
6 7 8 9 10 11 12
  // have a common namespace used around the full app
  ns: ['translations', 'common'],
  defaultNS: 'translations',
  nsSeparator: ':', // namespace separator
  keySeparator: '.', // key separator
  saveMissing: false,
  debug: false,
Maxym Borodenko's avatar
Maxym Borodenko committed
13

Matija Obreza's avatar
Matija Obreza committed
14 15 16
  // cache: {
  //   enabled: true
  // },
Maxym Borodenko's avatar
Maxym Borodenko committed
17

Matija Obreza's avatar
Matija Obreza committed
18 19 20 21 22 23 24 25
  interpolation: {
    escapeValue: false, // not needed for react!!
    prefix: '{{',
    suffix: '}}',
    formatSeparator: ',',
    format: (value, format, lng) => {
      if (format === 'uppercase') {
        return value.toUpperCase();
Matija Obreza's avatar
Matija Obreza committed
26 27
      } else if (format === 'lowercase') {
        return value.toLowerCase();
Matija Obreza's avatar
Matija Obreza committed
28 29
      } else if (format === 'number') {
        return value && value.toLocaleString();
Matija Obreza's avatar
Matija Obreza committed
30 31
      }
      return value;
Maxym Borodenko's avatar
Maxym Borodenko committed
32
    },
Matija Obreza's avatar
Matija Obreza committed
33
  },
Maxym Borodenko's avatar
Maxym Borodenko committed
34 35 36
};

export default optionsBase;