You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

index.js 550B

12345678910111213141516171819202122232425262728
  1. import { format as formatDate } from 'date-fns';
  2. import i18n from 'i18next';
  3. import { initReactI18next } from 'react-i18next';
  4. import enTranslations from './resources/en';
  5. i18n.use(initReactI18next).init({
  6. lng: 'en',
  7. fallbackLng: 'en',
  8. debug: true,
  9. supportedLngs: ['en'],
  10. resources: {
  11. en: {
  12. translation: enTranslations,
  13. },
  14. },
  15. interpolation: {
  16. format: (value, format) => {
  17. if (value instanceof Date) {
  18. return formatDate(value, format);
  19. }
  20. return value;
  21. },
  22. },
  23. });
  24. export default i18n;