Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 0 additions & 7 deletions packages/use-i18n/src/__tests__/locales/en.js

This file was deleted.

7 changes: 7 additions & 0 deletions packages/use-i18n/src/__tests__/locales/en.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"plurals":
"You have {numPhotos, plural, =0 {no photos.} =1 {one photo.} other {# photos.}}",
"subtitle": "Here is a subtitle",
"tests.test.namespaces": "test",
"title": "Welcome on @scaelway/ui i18n hook"
}
7 changes: 0 additions & 7 deletions packages/use-i18n/src/__tests__/locales/es.js

This file was deleted.

7 changes: 7 additions & 0 deletions packages/use-i18n/src/__tests__/locales/es.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"plurals":
"You have {numPhotos, plural, =0 {no photos.} =1 {one photo.} other {# photos.}}",
"subtitle": "Aquí hay un subtítulo",
"tests.test.namespaces": "test",
"title": "Bienvenido @scaelway/ui i18n hook"
}
7 changes: 0 additions & 7 deletions packages/use-i18n/src/__tests__/locales/fr.js

This file was deleted.

7 changes: 7 additions & 0 deletions packages/use-i18n/src/__tests__/locales/fr.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"plurals":
"You have {numPhotos, plural, =0 {no photos.} =1 {one photo.} other {# photos.}}",
"subtitle": "Voici un sous-titre",
"tests.test.namespaces": "test",
"title": "Bienvenue sur @scaelway/ui i18n hook"
}
8 changes: 4 additions & 4 deletions packages/use-i18n/src/__tests__/usei18n.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@ import { act, renderHook } from '@testing-library/react-hooks'
import mockdate from 'mockdate'
import React from 'react'
import I18n, { useI18n, useTranslation } from '..'
import en from './locales/en'
import es from './locales/es'
import fr from './locales/fr'
import en from './locales/en.json'
import es from './locales/es.json'
import fr from './locales/fr.json'

const LOCALE_ITEM_STORAGE = 'locales'

const wrapper =
({
loadDateLocale = async (locale: string) => import(`date-fns/locale/${locale}/index`),
defaultLoad = async ({ locale }: { locale: string }) => import(`./locales/${locale}`),
defaultLoad = async ({ locale }: { locale: string }) => import(`./locales/${locale}.json`),
defaultLocale = 'en',
defaultTranslations = {},
enableDebugKey = false,
Expand Down
1 change: 1 addition & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
"moduleResolution": "node",
"esModuleInterop": true,
"allowSyntheticDefaultImports": true,
"resolveJsonModule": true,
"jsx": "preserve",
},
"include": ["**/*.ts", "**/*.js", "**/.*.js", "**/*.tsx"]
Expand Down