@intlayer/docs 9.5.4-canary.0 → 9.5.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -1
- package/blog/ar/how_to_pick_react_i18n_library.md +28 -0
- package/blog/ar/how_to_pick_solid_i18n_library.md +19 -5
- package/blog/de/how_to_pick_react_i18n_library.md +28 -0
- package/blog/de/how_to_pick_solid_i18n_library.md +19 -5
- package/blog/en/how_to_pick_react_i18n_library.md +28 -0
- package/blog/en/how_to_pick_solid_i18n_library.md +19 -5
- package/blog/en-GB/how_to_pick_react_i18n_library.md +28 -0
- package/blog/en-GB/how_to_pick_solid_i18n_library.md +19 -5
- package/blog/es/how_to_pick_react_i18n_library.md +28 -0
- package/blog/es/how_to_pick_solid_i18n_library.md +19 -5
- package/blog/fr/how_to_pick_react_i18n_library.md +28 -0
- package/blog/fr/how_to_pick_solid_i18n_library.md +19 -5
- package/blog/hi/how_to_pick_react_i18n_library.md +28 -0
- package/blog/hi/how_to_pick_solid_i18n_library.md +19 -5
- package/blog/id/how_to_pick_react_i18n_library.md +28 -0
- package/blog/id/how_to_pick_solid_i18n_library.md +19 -5
- package/blog/it/how_to_pick_react_i18n_library.md +28 -0
- package/blog/it/how_to_pick_solid_i18n_library.md +19 -5
- package/blog/ja/how_to_pick_react_i18n_library.md +28 -0
- package/blog/ja/how_to_pick_solid_i18n_library.md +19 -5
- package/blog/ko/how_to_pick_react_i18n_library.md +28 -0
- package/blog/ko/how_to_pick_solid_i18n_library.md +19 -5
- package/blog/pl/how_to_pick_react_i18n_library.md +28 -0
- package/blog/pl/how_to_pick_solid_i18n_library.md +19 -5
- package/blog/pt/how_to_pick_react_i18n_library.md +28 -0
- package/blog/pt/how_to_pick_solid_i18n_library.md +19 -5
- package/blog/ru/how_to_pick_react_i18n_library.md +28 -0
- package/blog/ru/how_to_pick_solid_i18n_library.md +19 -5
- package/blog/tr/how_to_pick_react_i18n_library.md +28 -0
- package/blog/tr/how_to_pick_solid_i18n_library.md +19 -5
- package/blog/uk/how_to_pick_react_i18n_library.md +28 -0
- package/blog/uk/how_to_pick_solid_i18n_library.md +19 -5
- package/blog/vi/how_to_pick_react_i18n_library.md +28 -0
- package/blog/vi/how_to_pick_solid_i18n_library.md +19 -5
- package/blog/zh/how_to_pick_react_i18n_library.md +28 -0
- package/blog/zh/how_to_pick_solid_i18n_library.md +19 -5
- package/dist/cjs/generated/docs.entry.cjs +220 -0
- package/dist/cjs/generated/docs.entry.cjs.map +1 -1
- package/dist/esm/generated/docs.entry.mjs +220 -0
- package/dist/esm/generated/docs.entry.mjs.map +1 -1
- package/dist/types/generated/docs.entry.d.ts +11 -0
- package/dist/types/generated/docs.entry.d.ts.map +1 -1
- package/docs/ar/how_works_intlayer.md +86 -14
- package/docs/ar/intlayer_visual_editor.md +7 -0
- package/docs/ar/intlayer_with_astro.md +60 -36
- package/docs/ar/intlayer_with_astro_preact.md +7 -0
- package/docs/ar/intlayer_with_astro_react.md +7 -0
- package/docs/ar/intlayer_with_astro_solid.md +7 -0
- package/docs/ar/intlayer_with_astro_svelte.md +7 -0
- package/docs/ar/intlayer_with_astro_vanilla.md +7 -0
- package/docs/ar/intlayer_with_astro_vue.md +7 -0
- package/docs/ar/intlayer_with_nextjs_14.md +7 -0
- package/docs/ar/intlayer_with_nextjs_15.md +7 -0
- package/docs/ar/intlayer_with_nextjs_16.md +7 -0
- package/docs/ar/intlayer_with_react_router_v7.md +7 -0
- package/docs/ar/intlayer_with_remix_3.md +73 -112
- package/docs/ar/intlayer_with_tanstack+solid.md +7 -0
- package/docs/ar/intlayer_with_tanstack.md +7 -0
- package/docs/ar/intlayer_with_vite+preact.md +7 -0
- package/docs/ar/intlayer_with_vite+react.md +7 -0
- package/docs/ar/intlayer_with_vite+solid.md +7 -0
- package/docs/ar/packages/astro-intlayer/exports.md +161 -9
- package/docs/ar/packages/astro-intlayer/intlayer.md +76 -0
- package/docs/ar/packages/astro-intlayer/onRequest.md +76 -0
- package/docs/ar/packages/astro-intlayer/useDictionary.md +95 -0
- package/docs/ar/packages/astro-intlayer/useIntlayer.md +98 -0
- package/docs/ar/packages/astro-intlayer/useLocale.md +126 -0
- package/docs/ar/packages/remix-intlayer/Intlayer.md +55 -0
- package/docs/ar/packages/remix-intlayer/exports.md +80 -0
- package/docs/ar/packages/remix-intlayer/intlayerMiddleware.md +55 -0
- package/docs/ar/packages/remix-intlayer/useDictionary.md +95 -0
- package/docs/ar/packages/remix-intlayer/useIntlayer.md +94 -0
- package/docs/ar/packages/remix-intlayer/useLocale.md +104 -0
- package/docs/ar/readme.md +2 -1
- package/docs/de/how_works_intlayer.md +86 -14
- package/docs/de/intlayer_visual_editor.md +7 -0
- package/docs/de/intlayer_with_astro.md +60 -36
- package/docs/de/intlayer_with_astro_preact.md +7 -0
- package/docs/de/intlayer_with_astro_react.md +7 -0
- package/docs/de/intlayer_with_astro_solid.md +7 -0
- package/docs/de/intlayer_with_astro_svelte.md +7 -0
- package/docs/de/intlayer_with_astro_vanilla.md +7 -0
- package/docs/de/intlayer_with_astro_vue.md +7 -0
- package/docs/de/intlayer_with_nextjs_14.md +7 -0
- package/docs/de/intlayer_with_nextjs_15.md +7 -0
- package/docs/de/intlayer_with_nextjs_16.md +7 -0
- package/docs/de/intlayer_with_react_router_v7.md +7 -0
- package/docs/de/intlayer_with_remix_3.md +70 -109
- package/docs/de/intlayer_with_tanstack+solid.md +7 -0
- package/docs/de/intlayer_with_tanstack.md +7 -0
- package/docs/de/intlayer_with_vite+preact.md +7 -0
- package/docs/de/intlayer_with_vite+react.md +7 -0
- package/docs/de/intlayer_with_vite+solid.md +7 -0
- package/docs/de/packages/astro-intlayer/exports.md +164 -12
- package/docs/de/packages/astro-intlayer/intlayer.md +76 -0
- package/docs/de/packages/astro-intlayer/onRequest.md +76 -0
- package/docs/de/packages/astro-intlayer/useDictionary.md +95 -0
- package/docs/de/packages/astro-intlayer/useIntlayer.md +98 -0
- package/docs/de/packages/astro-intlayer/useLocale.md +126 -0
- package/docs/de/packages/remix-intlayer/Intlayer.md +77 -0
- package/docs/de/packages/remix-intlayer/exports.md +176 -0
- package/docs/de/packages/remix-intlayer/intlayerMiddleware.md +101 -0
- package/docs/de/packages/remix-intlayer/useDictionary.md +94 -0
- package/docs/de/packages/remix-intlayer/useIntlayer.md +94 -0
- package/docs/de/packages/remix-intlayer/useLocale.md +104 -0
- package/docs/de/readme.md +2 -1
- package/docs/en/how_works_intlayer.md +86 -14
- package/docs/en/intlayer_visual_editor.md +7 -0
- package/docs/en/intlayer_with_astro.md +63 -41
- package/docs/en/intlayer_with_astro_preact.md +7 -0
- package/docs/en/intlayer_with_astro_react.md +7 -0
- package/docs/en/intlayer_with_astro_solid.md +7 -0
- package/docs/en/intlayer_with_astro_svelte.md +7 -0
- package/docs/en/intlayer_with_astro_vanilla.md +7 -0
- package/docs/en/intlayer_with_astro_vue.md +7 -0
- package/docs/en/intlayer_with_nextjs_14.md +7 -0
- package/docs/en/intlayer_with_nextjs_15.md +7 -0
- package/docs/en/intlayer_with_nextjs_16.md +7 -0
- package/docs/en/intlayer_with_react_router_v7.md +7 -0
- package/docs/en/intlayer_with_remix_3.md +74 -122
- package/docs/en/intlayer_with_tanstack+solid.md +7 -0
- package/docs/en/intlayer_with_tanstack.md +7 -0
- package/docs/en/intlayer_with_vite+preact.md +7 -0
- package/docs/en/intlayer_with_vite+react.md +7 -0
- package/docs/en/intlayer_with_vite+solid.md +7 -0
- package/docs/en/introduction.md +2 -1
- package/docs/en/packages/astro-intlayer/exports.md +161 -9
- package/docs/en/packages/astro-intlayer/intlayer.md +76 -0
- package/docs/en/packages/astro-intlayer/onRequest.md +76 -0
- package/docs/en/packages/astro-intlayer/useDictionary.md +94 -0
- package/docs/en/packages/astro-intlayer/useIntlayer.md +98 -0
- package/docs/en/packages/astro-intlayer/useLocale.md +126 -0
- package/docs/en/packages/remix-intlayer/Intlayer.md +77 -0
- package/docs/en/packages/remix-intlayer/exports.md +176 -0
- package/docs/en/packages/remix-intlayer/intlayerMiddleware.md +101 -0
- package/docs/en/packages/remix-intlayer/useDictionary.md +94 -0
- package/docs/en/packages/remix-intlayer/useIntlayer.md +94 -0
- package/docs/en/packages/remix-intlayer/useLocale.md +104 -0
- package/docs/en/readme.md +2 -1
- package/docs/en-GB/how_works_intlayer.md +86 -14
- package/docs/en-GB/intlayer_visual_editor.md +7 -0
- package/docs/en-GB/intlayer_with_astro.md +60 -36
- package/docs/en-GB/intlayer_with_astro_preact.md +7 -0
- package/docs/en-GB/intlayer_with_astro_react.md +7 -0
- package/docs/en-GB/intlayer_with_astro_solid.md +7 -0
- package/docs/en-GB/intlayer_with_astro_svelte.md +7 -0
- package/docs/en-GB/intlayer_with_astro_vanilla.md +7 -0
- package/docs/en-GB/intlayer_with_astro_vue.md +7 -0
- package/docs/en-GB/intlayer_with_nextjs_14.md +7 -0
- package/docs/en-GB/intlayer_with_nextjs_15.md +7 -0
- package/docs/en-GB/intlayer_with_nextjs_16.md +7 -0
- package/docs/en-GB/intlayer_with_react_router_v7.md +7 -0
- package/docs/en-GB/intlayer_with_remix_3.md +66 -105
- package/docs/en-GB/intlayer_with_tanstack+solid.md +7 -0
- package/docs/en-GB/intlayer_with_tanstack.md +7 -0
- package/docs/en-GB/intlayer_with_vite+preact.md +7 -0
- package/docs/en-GB/intlayer_with_vite+react.md +7 -0
- package/docs/en-GB/intlayer_with_vite+solid.md +7 -0
- package/docs/en-GB/packages/astro-intlayer/exports.md +162 -10
- package/docs/en-GB/packages/astro-intlayer/intlayer.md +76 -0
- package/docs/en-GB/packages/astro-intlayer/onRequest.md +76 -0
- package/docs/en-GB/packages/astro-intlayer/useDictionary.md +95 -0
- package/docs/en-GB/packages/astro-intlayer/useIntlayer.md +98 -0
- package/docs/en-GB/packages/astro-intlayer/useLocale.md +126 -0
- package/docs/en-GB/packages/remix-intlayer/Intlayer.md +77 -0
- package/docs/en-GB/packages/remix-intlayer/exports.md +176 -0
- package/docs/en-GB/packages/remix-intlayer/intlayerMiddleware.md +101 -0
- package/docs/en-GB/packages/remix-intlayer/useDictionary.md +94 -0
- package/docs/en-GB/packages/remix-intlayer/useIntlayer.md +94 -0
- package/docs/en-GB/packages/remix-intlayer/useLocale.md +104 -0
- package/docs/en-GB/readme.md +2 -1
- package/docs/es/how_works_intlayer.md +86 -14
- package/docs/es/intlayer_visual_editor.md +7 -0
- package/docs/es/intlayer_with_astro.md +60 -36
- package/docs/es/intlayer_with_astro_preact.md +7 -0
- package/docs/es/intlayer_with_astro_react.md +7 -0
- package/docs/es/intlayer_with_astro_solid.md +7 -0
- package/docs/es/intlayer_with_astro_svelte.md +7 -0
- package/docs/es/intlayer_with_astro_vanilla.md +7 -0
- package/docs/es/intlayer_with_astro_vue.md +7 -0
- package/docs/es/intlayer_with_nextjs_14.md +7 -0
- package/docs/es/intlayer_with_nextjs_15.md +7 -0
- package/docs/es/intlayer_with_nextjs_16.md +7 -0
- package/docs/es/intlayer_with_react_router_v7.md +7 -0
- package/docs/es/intlayer_with_remix_3.md +73 -112
- package/docs/es/intlayer_with_tanstack+solid.md +7 -0
- package/docs/es/intlayer_with_tanstack.md +7 -0
- package/docs/es/intlayer_with_vite+preact.md +7 -0
- package/docs/es/intlayer_with_vite+react.md +7 -0
- package/docs/es/intlayer_with_vite+solid.md +7 -0
- package/docs/es/packages/astro-intlayer/exports.md +162 -10
- package/docs/es/packages/astro-intlayer/intlayer.md +76 -0
- package/docs/es/packages/astro-intlayer/onRequest.md +76 -0
- package/docs/es/packages/astro-intlayer/useDictionary.md +94 -0
- package/docs/es/packages/astro-intlayer/useIntlayer.md +98 -0
- package/docs/es/packages/astro-intlayer/useLocale.md +126 -0
- package/docs/es/packages/remix-intlayer/Intlayer.md +77 -0
- package/docs/es/packages/remix-intlayer/exports.md +176 -0
- package/docs/es/packages/remix-intlayer/intlayerMiddleware.md +101 -0
- package/docs/es/packages/remix-intlayer/useDictionary.md +94 -0
- package/docs/es/packages/remix-intlayer/useIntlayer.md +94 -0
- package/docs/es/packages/remix-intlayer/useLocale.md +104 -0
- package/docs/es/readme.md +2 -1
- package/docs/fr/how_works_intlayer.md +86 -14
- package/docs/fr/intlayer_visual_editor.md +7 -0
- package/docs/fr/intlayer_with_astro.md +60 -36
- package/docs/fr/intlayer_with_astro_preact.md +7 -0
- package/docs/fr/intlayer_with_astro_react.md +7 -0
- package/docs/fr/intlayer_with_astro_solid.md +7 -0
- package/docs/fr/intlayer_with_astro_svelte.md +7 -0
- package/docs/fr/intlayer_with_astro_vanilla.md +7 -0
- package/docs/fr/intlayer_with_astro_vue.md +7 -0
- package/docs/fr/intlayer_with_nextjs_14.md +7 -0
- package/docs/fr/intlayer_with_nextjs_15.md +7 -0
- package/docs/fr/intlayer_with_nextjs_16.md +7 -0
- package/docs/fr/intlayer_with_react_router_v7.md +7 -0
- package/docs/fr/intlayer_with_remix_3.md +74 -122
- package/docs/fr/intlayer_with_tanstack+solid.md +7 -0
- package/docs/fr/intlayer_with_tanstack.md +7 -0
- package/docs/fr/intlayer_with_vite+preact.md +7 -0
- package/docs/fr/intlayer_with_vite+react.md +7 -0
- package/docs/fr/intlayer_with_vite+solid.md +7 -0
- package/docs/fr/packages/astro-intlayer/exports.md +162 -10
- package/docs/fr/packages/astro-intlayer/intlayer.md +76 -0
- package/docs/fr/packages/astro-intlayer/onRequest.md +76 -0
- package/docs/fr/packages/astro-intlayer/useDictionary.md +94 -0
- package/docs/fr/packages/astro-intlayer/useIntlayer.md +98 -0
- package/docs/fr/packages/astro-intlayer/useLocale.md +126 -0
- package/docs/fr/packages/remix-intlayer/Intlayer.md +77 -0
- package/docs/fr/packages/remix-intlayer/exports.md +176 -0
- package/docs/fr/packages/remix-intlayer/intlayerMiddleware.md +101 -0
- package/docs/fr/packages/remix-intlayer/useDictionary.md +94 -0
- package/docs/fr/packages/remix-intlayer/useIntlayer.md +94 -0
- package/docs/fr/packages/remix-intlayer/useLocale.md +104 -0
- package/docs/fr/readme.md +2 -1
- package/docs/hi/how_works_intlayer.md +86 -14
- package/docs/hi/intlayer_visual_editor.md +7 -0
- package/docs/hi/intlayer_with_astro.md +61 -37
- package/docs/hi/intlayer_with_astro_preact.md +7 -0
- package/docs/hi/intlayer_with_astro_react.md +7 -0
- package/docs/hi/intlayer_with_astro_solid.md +7 -0
- package/docs/hi/intlayer_with_astro_svelte.md +7 -0
- package/docs/hi/intlayer_with_astro_vanilla.md +7 -0
- package/docs/hi/intlayer_with_astro_vue.md +7 -0
- package/docs/hi/intlayer_with_nextjs_14.md +7 -0
- package/docs/hi/intlayer_with_nextjs_15.md +7 -0
- package/docs/hi/intlayer_with_nextjs_16.md +7 -0
- package/docs/hi/intlayer_with_react_router_v7.md +7 -0
- package/docs/hi/intlayer_with_remix_3.md +73 -112
- package/docs/hi/intlayer_with_tanstack+solid.md +7 -0
- package/docs/hi/intlayer_with_tanstack.md +7 -0
- package/docs/hi/intlayer_with_vite+preact.md +7 -0
- package/docs/hi/intlayer_with_vite+react.md +7 -0
- package/docs/hi/intlayer_with_vite+solid.md +7 -0
- package/docs/hi/packages/astro-intlayer/exports.md +165 -13
- package/docs/hi/packages/astro-intlayer/intlayer.md +76 -0
- package/docs/hi/packages/astro-intlayer/onRequest.md +76 -0
- package/docs/hi/packages/astro-intlayer/useDictionary.md +95 -0
- package/docs/hi/packages/astro-intlayer/useIntlayer.md +98 -0
- package/docs/hi/packages/astro-intlayer/useLocale.md +126 -0
- package/docs/hi/packages/remix-intlayer/Intlayer.md +55 -0
- package/docs/hi/packages/remix-intlayer/exports.md +80 -0
- package/docs/hi/packages/remix-intlayer/intlayerMiddleware.md +55 -0
- package/docs/hi/packages/remix-intlayer/useDictionary.md +95 -0
- package/docs/hi/packages/remix-intlayer/useIntlayer.md +94 -0
- package/docs/hi/packages/remix-intlayer/useLocale.md +104 -0
- package/docs/hi/readme.md +2 -1
- package/docs/id/how_works_intlayer.md +86 -14
- package/docs/id/intlayer_visual_editor.md +7 -0
- package/docs/id/intlayer_with_astro.md +60 -36
- package/docs/id/intlayer_with_astro_preact.md +7 -0
- package/docs/id/intlayer_with_astro_react.md +7 -0
- package/docs/id/intlayer_with_astro_solid.md +7 -0
- package/docs/id/intlayer_with_astro_svelte.md +7 -0
- package/docs/id/intlayer_with_astro_vanilla.md +7 -0
- package/docs/id/intlayer_with_astro_vue.md +7 -0
- package/docs/id/intlayer_with_nextjs_14.md +7 -0
- package/docs/id/intlayer_with_nextjs_15.md +7 -0
- package/docs/id/intlayer_with_nextjs_16.md +7 -0
- package/docs/id/intlayer_with_react_router_v7.md +7 -0
- package/docs/id/intlayer_with_remix_3.md +101 -148
- package/docs/id/intlayer_with_tanstack+solid.md +7 -0
- package/docs/id/intlayer_with_tanstack.md +7 -0
- package/docs/id/intlayer_with_vite+preact.md +7 -0
- package/docs/id/intlayer_with_vite+react.md +7 -0
- package/docs/id/intlayer_with_vite+solid.md +7 -0
- package/docs/id/packages/astro-intlayer/exports.md +163 -11
- package/docs/id/packages/astro-intlayer/intlayer.md +76 -0
- package/docs/id/packages/astro-intlayer/onRequest.md +76 -0
- package/docs/id/packages/astro-intlayer/useDictionary.md +94 -0
- package/docs/id/packages/astro-intlayer/useIntlayer.md +98 -0
- package/docs/id/packages/astro-intlayer/useLocale.md +126 -0
- package/docs/id/packages/remix-intlayer/Intlayer.md +55 -0
- package/docs/id/packages/remix-intlayer/exports.md +80 -0
- package/docs/id/packages/remix-intlayer/intlayerMiddleware.md +55 -0
- package/docs/id/packages/remix-intlayer/useDictionary.md +95 -0
- package/docs/id/packages/remix-intlayer/useIntlayer.md +94 -0
- package/docs/id/packages/remix-intlayer/useLocale.md +104 -0
- package/docs/id/readme.md +2 -1
- package/docs/it/how_works_intlayer.md +86 -14
- package/docs/it/intlayer_visual_editor.md +7 -0
- package/docs/it/intlayer_with_astro.md +60 -36
- package/docs/it/intlayer_with_astro_preact.md +7 -0
- package/docs/it/intlayer_with_astro_react.md +7 -0
- package/docs/it/intlayer_with_astro_solid.md +7 -0
- package/docs/it/intlayer_with_astro_svelte.md +7 -0
- package/docs/it/intlayer_with_astro_vanilla.md +7 -0
- package/docs/it/intlayer_with_astro_vue.md +7 -0
- package/docs/it/intlayer_with_nextjs_14.md +7 -0
- package/docs/it/intlayer_with_nextjs_15.md +7 -0
- package/docs/it/intlayer_with_nextjs_16.md +7 -0
- package/docs/it/intlayer_with_react_router_v7.md +7 -0
- package/docs/it/intlayer_with_remix_3.md +70 -109
- package/docs/it/intlayer_with_tanstack+solid.md +7 -0
- package/docs/it/intlayer_with_tanstack.md +7 -0
- package/docs/it/intlayer_with_vite+preact.md +7 -0
- package/docs/it/intlayer_with_vite+react.md +7 -0
- package/docs/it/intlayer_with_vite+solid.md +7 -0
- package/docs/it/packages/astro-intlayer/exports.md +161 -9
- package/docs/it/packages/astro-intlayer/intlayer.md +76 -0
- package/docs/it/packages/astro-intlayer/onRequest.md +76 -0
- package/docs/it/packages/astro-intlayer/useDictionary.md +95 -0
- package/docs/it/packages/astro-intlayer/useIntlayer.md +98 -0
- package/docs/it/packages/astro-intlayer/useLocale.md +126 -0
- package/docs/it/packages/remix-intlayer/Intlayer.md +77 -0
- package/docs/it/packages/remix-intlayer/exports.md +176 -0
- package/docs/it/packages/remix-intlayer/intlayerMiddleware.md +101 -0
- package/docs/it/packages/remix-intlayer/useDictionary.md +94 -0
- package/docs/it/packages/remix-intlayer/useIntlayer.md +94 -0
- package/docs/it/packages/remix-intlayer/useLocale.md +104 -0
- package/docs/it/readme.md +2 -1
- package/docs/ja/how_works_intlayer.md +86 -14
- package/docs/ja/intlayer_visual_editor.md +7 -0
- package/docs/ja/intlayer_with_astro.md +61 -37
- package/docs/ja/intlayer_with_astro_preact.md +7 -0
- package/docs/ja/intlayer_with_astro_react.md +7 -0
- package/docs/ja/intlayer_with_astro_solid.md +7 -0
- package/docs/ja/intlayer_with_astro_svelte.md +7 -0
- package/docs/ja/intlayer_with_astro_vanilla.md +7 -0
- package/docs/ja/intlayer_with_astro_vue.md +7 -0
- package/docs/ja/intlayer_with_nextjs_14.md +7 -0
- package/docs/ja/intlayer_with_nextjs_15.md +7 -0
- package/docs/ja/intlayer_with_nextjs_16.md +7 -0
- package/docs/ja/intlayer_with_react_router_v7.md +7 -0
- package/docs/ja/intlayer_with_remix_3.md +73 -112
- package/docs/ja/intlayer_with_tanstack+solid.md +7 -0
- package/docs/ja/intlayer_with_tanstack.md +7 -0
- package/docs/ja/intlayer_with_vite+preact.md +7 -0
- package/docs/ja/intlayer_with_vite+react.md +7 -0
- package/docs/ja/intlayer_with_vite+solid.md +7 -0
- package/docs/ja/packages/astro-intlayer/exports.md +163 -11
- package/docs/ja/packages/astro-intlayer/intlayer.md +76 -0
- package/docs/ja/packages/astro-intlayer/onRequest.md +76 -0
- package/docs/ja/packages/astro-intlayer/useDictionary.md +95 -0
- package/docs/ja/packages/astro-intlayer/useIntlayer.md +98 -0
- package/docs/ja/packages/astro-intlayer/useLocale.md +126 -0
- package/docs/ja/packages/remix-intlayer/Intlayer.md +55 -0
- package/docs/ja/packages/remix-intlayer/exports.md +80 -0
- package/docs/ja/packages/remix-intlayer/intlayerMiddleware.md +55 -0
- package/docs/ja/packages/remix-intlayer/useDictionary.md +95 -0
- package/docs/ja/packages/remix-intlayer/useIntlayer.md +94 -0
- package/docs/ja/packages/remix-intlayer/useLocale.md +104 -0
- package/docs/ja/readme.md +2 -1
- package/docs/ko/how_works_intlayer.md +86 -14
- package/docs/ko/intlayer_visual_editor.md +7 -0
- package/docs/ko/intlayer_with_astro.md +61 -37
- package/docs/ko/intlayer_with_astro_preact.md +7 -0
- package/docs/ko/intlayer_with_astro_react.md +7 -0
- package/docs/ko/intlayer_with_astro_solid.md +7 -0
- package/docs/ko/intlayer_with_astro_svelte.md +7 -0
- package/docs/ko/intlayer_with_astro_vanilla.md +7 -0
- package/docs/ko/intlayer_with_astro_vue.md +7 -0
- package/docs/ko/intlayer_with_nextjs_14.md +7 -0
- package/docs/ko/intlayer_with_nextjs_15.md +7 -0
- package/docs/ko/intlayer_with_nextjs_16.md +7 -0
- package/docs/ko/intlayer_with_react_router_v7.md +7 -0
- package/docs/ko/intlayer_with_remix_3.md +73 -112
- package/docs/ko/intlayer_with_tanstack+solid.md +7 -0
- package/docs/ko/intlayer_with_tanstack.md +7 -0
- package/docs/ko/intlayer_with_vite+preact.md +7 -0
- package/docs/ko/intlayer_with_vite+react.md +7 -0
- package/docs/ko/intlayer_with_vite+solid.md +7 -0
- package/docs/ko/packages/astro-intlayer/exports.md +163 -11
- package/docs/ko/packages/astro-intlayer/intlayer.md +76 -0
- package/docs/ko/packages/astro-intlayer/onRequest.md +76 -0
- package/docs/ko/packages/astro-intlayer/useDictionary.md +95 -0
- package/docs/ko/packages/astro-intlayer/useIntlayer.md +98 -0
- package/docs/ko/packages/astro-intlayer/useLocale.md +126 -0
- package/docs/ko/packages/remix-intlayer/Intlayer.md +55 -0
- package/docs/ko/packages/remix-intlayer/exports.md +80 -0
- package/docs/ko/packages/remix-intlayer/intlayerMiddleware.md +55 -0
- package/docs/ko/packages/remix-intlayer/useDictionary.md +95 -0
- package/docs/ko/packages/remix-intlayer/useIntlayer.md +94 -0
- package/docs/ko/packages/remix-intlayer/useLocale.md +104 -0
- package/docs/ko/readme.md +2 -1
- package/docs/pl/how_works_intlayer.md +86 -14
- package/docs/pl/intlayer_visual_editor.md +7 -0
- package/docs/pl/intlayer_with_astro.md +61 -37
- package/docs/pl/intlayer_with_astro_preact.md +7 -0
- package/docs/pl/intlayer_with_astro_react.md +7 -0
- package/docs/pl/intlayer_with_astro_solid.md +7 -0
- package/docs/pl/intlayer_with_astro_svelte.md +7 -0
- package/docs/pl/intlayer_with_astro_vanilla.md +7 -0
- package/docs/pl/intlayer_with_astro_vue.md +7 -0
- package/docs/pl/intlayer_with_nextjs_14.md +7 -0
- package/docs/pl/intlayer_with_nextjs_15.md +7 -0
- package/docs/pl/intlayer_with_nextjs_16.md +7 -0
- package/docs/pl/intlayer_with_react_router_v7.md +7 -0
- package/docs/pl/intlayer_with_remix_3.md +101 -148
- package/docs/pl/intlayer_with_tanstack+solid.md +7 -0
- package/docs/pl/intlayer_with_tanstack.md +7 -0
- package/docs/pl/intlayer_with_vite+preact.md +7 -0
- package/docs/pl/intlayer_with_vite+react.md +7 -0
- package/docs/pl/intlayer_with_vite+solid.md +7 -0
- package/docs/pl/packages/astro-intlayer/exports.md +162 -10
- package/docs/pl/packages/astro-intlayer/intlayer.md +76 -0
- package/docs/pl/packages/astro-intlayer/onRequest.md +76 -0
- package/docs/pl/packages/astro-intlayer/useDictionary.md +94 -0
- package/docs/pl/packages/astro-intlayer/useIntlayer.md +98 -0
- package/docs/pl/packages/astro-intlayer/useLocale.md +126 -0
- package/docs/pl/packages/remix-intlayer/Intlayer.md +55 -0
- package/docs/pl/packages/remix-intlayer/exports.md +80 -0
- package/docs/pl/packages/remix-intlayer/intlayerMiddleware.md +55 -0
- package/docs/pl/packages/remix-intlayer/useDictionary.md +95 -0
- package/docs/pl/packages/remix-intlayer/useIntlayer.md +94 -0
- package/docs/pl/packages/remix-intlayer/useLocale.md +104 -0
- package/docs/pl/readme.md +2 -1
- package/docs/pt/how_works_intlayer.md +86 -14
- package/docs/pt/intlayer_visual_editor.md +7 -0
- package/docs/pt/intlayer_with_astro.md +61 -37
- package/docs/pt/intlayer_with_astro_preact.md +7 -0
- package/docs/pt/intlayer_with_astro_react.md +7 -0
- package/docs/pt/intlayer_with_astro_solid.md +7 -0
- package/docs/pt/intlayer_with_astro_svelte.md +7 -0
- package/docs/pt/intlayer_with_astro_vanilla.md +7 -0
- package/docs/pt/intlayer_with_astro_vue.md +7 -0
- package/docs/pt/intlayer_with_nextjs_14.md +7 -0
- package/docs/pt/intlayer_with_nextjs_15.md +7 -0
- package/docs/pt/intlayer_with_nextjs_16.md +7 -0
- package/docs/pt/intlayer_with_react_router_v7.md +7 -0
- package/docs/pt/intlayer_with_remix_3.md +73 -112
- package/docs/pt/intlayer_with_tanstack+solid.md +7 -0
- package/docs/pt/intlayer_with_tanstack.md +7 -0
- package/docs/pt/intlayer_with_vite+preact.md +7 -0
- package/docs/pt/intlayer_with_vite+react.md +7 -0
- package/docs/pt/intlayer_with_vite+solid.md +7 -0
- package/docs/pt/packages/astro-intlayer/exports.md +162 -10
- package/docs/pt/packages/astro-intlayer/intlayer.md +76 -0
- package/docs/pt/packages/astro-intlayer/onRequest.md +76 -0
- package/docs/pt/packages/astro-intlayer/useDictionary.md +95 -0
- package/docs/pt/packages/astro-intlayer/useIntlayer.md +98 -0
- package/docs/pt/packages/astro-intlayer/useLocale.md +126 -0
- package/docs/pt/packages/remix-intlayer/Intlayer.md +77 -0
- package/docs/pt/packages/remix-intlayer/exports.md +176 -0
- package/docs/pt/packages/remix-intlayer/intlayerMiddleware.md +101 -0
- package/docs/pt/packages/remix-intlayer/useDictionary.md +94 -0
- package/docs/pt/packages/remix-intlayer/useIntlayer.md +94 -0
- package/docs/pt/packages/remix-intlayer/useLocale.md +104 -0
- package/docs/pt/readme.md +2 -1
- package/docs/ru/how_works_intlayer.md +86 -14
- package/docs/ru/intlayer_visual_editor.md +7 -0
- package/docs/ru/intlayer_with_astro.md +61 -37
- package/docs/ru/intlayer_with_astro_preact.md +7 -0
- package/docs/ru/intlayer_with_astro_react.md +7 -0
- package/docs/ru/intlayer_with_astro_solid.md +7 -0
- package/docs/ru/intlayer_with_astro_svelte.md +7 -0
- package/docs/ru/intlayer_with_astro_vanilla.md +7 -0
- package/docs/ru/intlayer_with_astro_vue.md +7 -0
- package/docs/ru/intlayer_with_nextjs_14.md +7 -0
- package/docs/ru/intlayer_with_nextjs_15.md +7 -0
- package/docs/ru/intlayer_with_nextjs_16.md +7 -0
- package/docs/ru/intlayer_with_react_router_v7.md +7 -0
- package/docs/ru/intlayer_with_remix_3.md +73 -112
- package/docs/ru/intlayer_with_tanstack+solid.md +7 -0
- package/docs/ru/intlayer_with_tanstack.md +7 -0
- package/docs/ru/intlayer_with_vite+preact.md +7 -0
- package/docs/ru/intlayer_with_vite+react.md +7 -0
- package/docs/ru/intlayer_with_vite+solid.md +7 -0
- package/docs/ru/packages/astro-intlayer/exports.md +164 -12
- package/docs/ru/packages/astro-intlayer/intlayer.md +76 -0
- package/docs/ru/packages/astro-intlayer/onRequest.md +76 -0
- package/docs/ru/packages/astro-intlayer/useDictionary.md +95 -0
- package/docs/ru/packages/astro-intlayer/useIntlayer.md +98 -0
- package/docs/ru/packages/astro-intlayer/useLocale.md +126 -0
- package/docs/ru/packages/remix-intlayer/Intlayer.md +55 -0
- package/docs/ru/packages/remix-intlayer/exports.md +80 -0
- package/docs/ru/packages/remix-intlayer/intlayerMiddleware.md +55 -0
- package/docs/ru/packages/remix-intlayer/useDictionary.md +95 -0
- package/docs/ru/packages/remix-intlayer/useIntlayer.md +94 -0
- package/docs/ru/packages/remix-intlayer/useLocale.md +104 -0
- package/docs/ru/readme.md +2 -1
- package/docs/tr/how_works_intlayer.md +86 -14
- package/docs/tr/intlayer_visual_editor.md +7 -0
- package/docs/tr/intlayer_with_astro.md +60 -36
- package/docs/tr/intlayer_with_astro_preact.md +7 -0
- package/docs/tr/intlayer_with_astro_react.md +7 -0
- package/docs/tr/intlayer_with_astro_solid.md +7 -0
- package/docs/tr/intlayer_with_astro_svelte.md +7 -0
- package/docs/tr/intlayer_with_astro_vanilla.md +7 -0
- package/docs/tr/intlayer_with_astro_vue.md +7 -0
- package/docs/tr/intlayer_with_nextjs_14.md +7 -0
- package/docs/tr/intlayer_with_nextjs_15.md +7 -0
- package/docs/tr/intlayer_with_nextjs_16.md +7 -0
- package/docs/tr/intlayer_with_react_router_v7.md +7 -0
- package/docs/tr/intlayer_with_remix_3.md +101 -148
- package/docs/tr/intlayer_with_tanstack+solid.md +7 -0
- package/docs/tr/intlayer_with_tanstack.md +7 -0
- package/docs/tr/intlayer_with_vite+preact.md +7 -0
- package/docs/tr/intlayer_with_vite+react.md +7 -0
- package/docs/tr/intlayer_with_vite+solid.md +7 -0
- package/docs/tr/packages/astro-intlayer/exports.md +165 -13
- package/docs/tr/packages/astro-intlayer/intlayer.md +76 -0
- package/docs/tr/packages/astro-intlayer/onRequest.md +76 -0
- package/docs/tr/packages/astro-intlayer/useDictionary.md +95 -0
- package/docs/tr/packages/astro-intlayer/useIntlayer.md +98 -0
- package/docs/tr/packages/astro-intlayer/useLocale.md +126 -0
- package/docs/tr/packages/remix-intlayer/Intlayer.md +55 -0
- package/docs/tr/packages/remix-intlayer/exports.md +80 -0
- package/docs/tr/packages/remix-intlayer/intlayerMiddleware.md +55 -0
- package/docs/tr/packages/remix-intlayer/useDictionary.md +95 -0
- package/docs/tr/packages/remix-intlayer/useIntlayer.md +94 -0
- package/docs/tr/packages/remix-intlayer/useLocale.md +104 -0
- package/docs/tr/readme.md +2 -1
- package/docs/uk/how_works_intlayer.md +86 -14
- package/docs/uk/intlayer_visual_editor.md +7 -0
- package/docs/uk/intlayer_with_astro.md +61 -37
- package/docs/uk/intlayer_with_astro_preact.md +7 -0
- package/docs/uk/intlayer_with_astro_react.md +7 -0
- package/docs/uk/intlayer_with_astro_solid.md +7 -0
- package/docs/uk/intlayer_with_astro_svelte.md +7 -0
- package/docs/uk/intlayer_with_astro_vanilla.md +7 -0
- package/docs/uk/intlayer_with_astro_vue.md +7 -0
- package/docs/uk/intlayer_with_nextjs_14.md +7 -0
- package/docs/uk/intlayer_with_nextjs_15.md +7 -0
- package/docs/uk/intlayer_with_nextjs_16.md +7 -0
- package/docs/uk/intlayer_with_react_router_v7.md +7 -0
- package/docs/uk/intlayer_with_remix_3.md +101 -148
- package/docs/uk/intlayer_with_tanstack+solid.md +7 -0
- package/docs/uk/intlayer_with_tanstack.md +7 -0
- package/docs/uk/intlayer_with_vite+preact.md +7 -0
- package/docs/uk/intlayer_with_vite+react.md +7 -0
- package/docs/uk/intlayer_with_vite+solid.md +7 -0
- package/docs/uk/packages/astro-intlayer/exports.md +162 -10
- package/docs/uk/packages/astro-intlayer/intlayer.md +76 -0
- package/docs/uk/packages/astro-intlayer/onRequest.md +76 -0
- package/docs/uk/packages/astro-intlayer/useDictionary.md +94 -0
- package/docs/uk/packages/astro-intlayer/useIntlayer.md +98 -0
- package/docs/uk/packages/astro-intlayer/useLocale.md +126 -0
- package/docs/uk/packages/remix-intlayer/Intlayer.md +55 -0
- package/docs/uk/packages/remix-intlayer/exports.md +80 -0
- package/docs/uk/packages/remix-intlayer/intlayerMiddleware.md +55 -0
- package/docs/uk/packages/remix-intlayer/useDictionary.md +95 -0
- package/docs/uk/packages/remix-intlayer/useIntlayer.md +94 -0
- package/docs/uk/packages/remix-intlayer/useLocale.md +104 -0
- package/docs/uk/readme.md +2 -1
- package/docs/vi/how_works_intlayer.md +86 -14
- package/docs/vi/intlayer_visual_editor.md +7 -0
- package/docs/vi/intlayer_with_astro.md +60 -36
- package/docs/vi/intlayer_with_astro_preact.md +7 -0
- package/docs/vi/intlayer_with_astro_react.md +7 -0
- package/docs/vi/intlayer_with_astro_solid.md +7 -0
- package/docs/vi/intlayer_with_astro_svelte.md +7 -0
- package/docs/vi/intlayer_with_astro_vanilla.md +7 -0
- package/docs/vi/intlayer_with_astro_vue.md +7 -0
- package/docs/vi/intlayer_with_nextjs_14.md +7 -0
- package/docs/vi/intlayer_with_nextjs_15.md +7 -0
- package/docs/vi/intlayer_with_nextjs_16.md +7 -0
- package/docs/vi/intlayer_with_react_router_v7.md +7 -0
- package/docs/vi/intlayer_with_remix_3.md +101 -148
- package/docs/vi/intlayer_with_tanstack+solid.md +7 -0
- package/docs/vi/intlayer_with_tanstack.md +7 -0
- package/docs/vi/intlayer_with_vite+preact.md +7 -0
- package/docs/vi/intlayer_with_vite+react.md +7 -0
- package/docs/vi/intlayer_with_vite+solid.md +7 -0
- package/docs/vi/packages/astro-intlayer/exports.md +167 -15
- package/docs/vi/packages/astro-intlayer/intlayer.md +76 -0
- package/docs/vi/packages/astro-intlayer/onRequest.md +76 -0
- package/docs/vi/packages/astro-intlayer/useDictionary.md +94 -0
- package/docs/vi/packages/astro-intlayer/useIntlayer.md +98 -0
- package/docs/vi/packages/astro-intlayer/useLocale.md +126 -0
- package/docs/vi/packages/remix-intlayer/Intlayer.md +55 -0
- package/docs/vi/packages/remix-intlayer/exports.md +80 -0
- package/docs/vi/packages/remix-intlayer/intlayerMiddleware.md +55 -0
- package/docs/vi/packages/remix-intlayer/useDictionary.md +95 -0
- package/docs/vi/packages/remix-intlayer/useIntlayer.md +94 -0
- package/docs/vi/packages/remix-intlayer/useLocale.md +104 -0
- package/docs/vi/readme.md +2 -1
- package/docs/zh/how_works_intlayer.md +86 -14
- package/docs/zh/intlayer_visual_editor.md +7 -0
- package/docs/zh/intlayer_with_astro.md +61 -37
- package/docs/zh/intlayer_with_astro_preact.md +7 -0
- package/docs/zh/intlayer_with_astro_react.md +7 -0
- package/docs/zh/intlayer_with_astro_solid.md +7 -0
- package/docs/zh/intlayer_with_astro_svelte.md +7 -0
- package/docs/zh/intlayer_with_astro_vanilla.md +7 -0
- package/docs/zh/intlayer_with_astro_vue.md +7 -0
- package/docs/zh/intlayer_with_nextjs_14.md +7 -0
- package/docs/zh/intlayer_with_nextjs_15.md +7 -0
- package/docs/zh/intlayer_with_nextjs_16.md +7 -0
- package/docs/zh/intlayer_with_react_router_v7.md +7 -0
- package/docs/zh/intlayer_with_remix_3.md +74 -112
- package/docs/zh/intlayer_with_tanstack+solid.md +7 -0
- package/docs/zh/intlayer_with_tanstack.md +7 -0
- package/docs/zh/intlayer_with_vite+preact.md +7 -0
- package/docs/zh/intlayer_with_vite+react.md +7 -0
- package/docs/zh/intlayer_with_vite+solid.md +7 -0
- package/docs/zh/packages/astro-intlayer/exports.md +166 -14
- package/docs/zh/packages/astro-intlayer/intlayer.md +76 -0
- package/docs/zh/packages/astro-intlayer/onRequest.md +76 -0
- package/docs/zh/packages/astro-intlayer/useDictionary.md +95 -0
- package/docs/zh/packages/astro-intlayer/useIntlayer.md +98 -0
- package/docs/zh/packages/astro-intlayer/useLocale.md +126 -0
- package/docs/zh/packages/remix-intlayer/Intlayer.md +55 -0
- package/docs/zh/packages/remix-intlayer/exports.md +80 -0
- package/docs/zh/packages/remix-intlayer/intlayerMiddleware.md +55 -0
- package/docs/zh/packages/remix-intlayer/useDictionary.md +95 -0
- package/docs/zh/packages/remix-intlayer/useIntlayer.md +94 -0
- package/docs/zh/packages/remix-intlayer/useLocale.md +104 -0
- package/docs/zh/readme.md +2 -1
- package/package.json +6 -6
- package/src/generated/docs.entry.ts +223 -0
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
---
|
|
2
|
+
createdAt: 2026-09-19
|
|
3
|
+
updatedAt: 2026-09-19
|
|
4
|
+
title: remix-intlayer Package Documentation
|
|
5
|
+
description: Remix 3 integration for Intlayer, providing middleware, context, hooks, and formatters for locale-based routing and content management.
|
|
6
|
+
keywords:
|
|
7
|
+
- remix-intlayer
|
|
8
|
+
- remix
|
|
9
|
+
- remix-3
|
|
10
|
+
- internationalisation
|
|
11
|
+
- i18n
|
|
12
|
+
slugs:
|
|
13
|
+
- doc
|
|
14
|
+
- packages
|
|
15
|
+
- remix-intlayer
|
|
16
|
+
- exports
|
|
17
|
+
history:
|
|
18
|
+
- version: 9.5.5
|
|
19
|
+
date: 2026-09-19
|
|
20
|
+
changes: "Unified documentation for all exports"
|
|
21
|
+
author: aymericzip
|
|
22
|
+
---
|
|
23
|
+
|
|
24
|
+
# remix-intlayer Package
|
|
25
|
+
|
|
26
|
+
The `remix-intlayer` package provides the necessary tools to integrate Intlayer into Remix 3 applications. Built entirely on web standards (`Request`, `Response`, `Headers`, and `URL`), it offers a router middleware for locale-based routing and internal rewrites, context storage, hooks, and formatting utilities for seamless multilingual content management.
|
|
27
|
+
|
|
28
|
+
## Installation
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
npm install remix-intlayer
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
## Exports
|
|
35
|
+
|
|
36
|
+
### Middleware
|
|
37
|
+
|
|
38
|
+
Import:
|
|
39
|
+
|
|
40
|
+
```tsx
|
|
41
|
+
import { intlayer } from "remix-intlayer";
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
| Function | Description | Related Doc |
|
|
45
|
+
| ---------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------- |
|
|
46
|
+
| `intlayer` | Remix 3 router middleware that handles locale-based routing (redirects and internal rewrites), resolves the request locale, persists it in cookies/headers, and establishes the request context scope. | [intlayer](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en-GB/packages/remix-intlayer/intlayerMiddleware.md) |
|
|
47
|
+
|
|
48
|
+
### Context
|
|
49
|
+
|
|
50
|
+
Import:
|
|
51
|
+
|
|
52
|
+
```tsx
|
|
53
|
+
import { Intlayer, INTLAYER_CONTEXT_PROPERTY } from "remix-intlayer";
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
| Export | Type | Description | Related Doc |
|
|
57
|
+
| --------------------------- | ------------ | -------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- |
|
|
58
|
+
| `Intlayer` | `ContextKey` | RequestContext key holding the `IntlayerState` (`locale`, `defaultLocale`, `availableLocales`) for the current request. | [Intlayer](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en-GB/packages/remix-intlayer/Intlayer.md) |
|
|
59
|
+
| `INTLAYER_CONTEXT_PROPERTY` | `string` | Property name (`'intlayer'`) installed directly on the request context, allowing access via `context.intlayer` as well as `context.get(Intlayer)`. | - |
|
|
60
|
+
|
|
61
|
+
### Hooks
|
|
62
|
+
|
|
63
|
+
Import:
|
|
64
|
+
|
|
65
|
+
```tsx
|
|
66
|
+
import { useIntlayer, useDictionary, useLocale } from "remix-intlayer";
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
| Hook | Description | Related Doc |
|
|
70
|
+
| --------------- | -------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------- |
|
|
71
|
+
| `useIntlayer` | Picks one dictionary by its key and returns its content for the locale of the request being handled. Automatically reads from the request context. | [useIntlayer](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en-GB/packages/remix-intlayer/useIntlayer.md) |
|
|
72
|
+
| `useDictionary` | Transforms an imported dictionary object and returns its content for the current request locale. Supports selector overrides. | [useDictionary](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en-GB/packages/remix-intlayer/useDictionary.md) |
|
|
73
|
+
| `useLocale` | Returns the resolved locale of the current request, along with the configured `defaultLocale` and `availableLocales`. | [useLocale](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en-GB/packages/remix-intlayer/useLocale.md) |
|
|
74
|
+
|
|
75
|
+
### Utilities
|
|
76
|
+
|
|
77
|
+
Import:
|
|
78
|
+
|
|
79
|
+
```tsx
|
|
80
|
+
import { createLocaleRouting, getIntlayerState } from "remix-intlayer";
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
| Function | Description | Related Doc |
|
|
84
|
+
| --------------------- | ------------------------------------------------------------------------------------------------------------------------------------ | ----------- |
|
|
85
|
+
| `createLocaleRouting` | Pure function that computes locale routing decisions (`redirect`, `rewrite`, or `pass`) given a request, configuration, and options. | - |
|
|
86
|
+
| `getIntlayerState` | Reads the current `IntlayerState` (`locale`, `defaultLocale`, `availableLocales`) from the `AsyncLocalStorage` request scope. | - |
|
|
87
|
+
|
|
88
|
+
### Formatters (remix-intlayer/format)
|
|
89
|
+
|
|
90
|
+
Import:
|
|
91
|
+
|
|
92
|
+
```tsx
|
|
93
|
+
import {
|
|
94
|
+
useIntl,
|
|
95
|
+
useDate,
|
|
96
|
+
useNumber,
|
|
97
|
+
useCurrency,
|
|
98
|
+
usePercentage,
|
|
99
|
+
useRelativeTime,
|
|
100
|
+
useList,
|
|
101
|
+
useUnit,
|
|
102
|
+
useCompact,
|
|
103
|
+
} from "remix-intlayer/format";
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
| Hook | Description |
|
|
107
|
+
| ----------------- | -------------------------------------------------------------------------------------------------------- |
|
|
108
|
+
| `useIntl` | Returns an Intl instance bound to the request locale with caching and subscription capabilities. |
|
|
109
|
+
| `useDate` | Returns a date formatting function pre-bound to the request locale (`Intl.DateTimeFormat`). |
|
|
110
|
+
| `useNumber` | Returns a number formatting function pre-bound to the request locale (`Intl.NumberFormat`). |
|
|
111
|
+
| `useCurrency` | Returns a currency formatting function pre-bound to the request locale. |
|
|
112
|
+
| `usePercentage` | Returns a percentage formatting function pre-bound to the request locale. |
|
|
113
|
+
| `useRelativeTime` | Returns a relative time formatting function pre-bound to the request locale (`Intl.RelativeTimeFormat`). |
|
|
114
|
+
| `useList` | Returns a list formatting function pre-bound to the request locale (`Intl.ListFormat`). |
|
|
115
|
+
| `useUnit` | Returns a unit formatting function pre-bound to the request locale. |
|
|
116
|
+
| `useCompact` | Returns a compact number formatting function pre-bound to the request locale (e.g. `1.5K`). |
|
|
117
|
+
|
|
118
|
+
### HTML Utilities (remix-intlayer/html)
|
|
119
|
+
|
|
120
|
+
Import:
|
|
121
|
+
|
|
122
|
+
```tsx
|
|
123
|
+
import { renderHTML, useHTML, useHTMLRenderer } from "remix-intlayer/html";
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
| Export | Type | Description |
|
|
127
|
+
| ----------------- | ---------- | --------------------------------------------------------------- |
|
|
128
|
+
| `renderHTML` | `Function` | Standalone utility function to render HTML nodes outside of UI. |
|
|
129
|
+
| `useHTML` | `Hook` | Hook to get the HTML provider context and configuration. |
|
|
130
|
+
| `useHTMLRenderer` | `Hook` | Hook to obtain a pre-configured HTML renderer function. |
|
|
131
|
+
|
|
132
|
+
### Markdown Utilities (remix-intlayer/markdown)
|
|
133
|
+
|
|
134
|
+
Import:
|
|
135
|
+
|
|
136
|
+
```tsx
|
|
137
|
+
import {
|
|
138
|
+
compileMarkdown,
|
|
139
|
+
renderMarkdown,
|
|
140
|
+
parseMarkdown,
|
|
141
|
+
useMarkdown,
|
|
142
|
+
useMarkdownRenderer,
|
|
143
|
+
} from "remix-intlayer/markdown";
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
| Export | Type | Description |
|
|
147
|
+
| --------------------- | ---------- | ----------------------------------------------------------- |
|
|
148
|
+
| `compileMarkdown` | `Function` | Compiles markdown strings into structured representation. |
|
|
149
|
+
| `renderMarkdown` | `Function` | Renders markdown content into output nodes. |
|
|
150
|
+
| `parseMarkdown` | `Function` | Parses raw markdown content into an AST. |
|
|
151
|
+
| `useMarkdown` | `Hook` | Hook to get the markdown provider context. |
|
|
152
|
+
| `useMarkdownRenderer` | `Hook` | Hook to obtain a pre-configured Markdown renderer function. |
|
|
153
|
+
|
|
154
|
+
### Types
|
|
155
|
+
|
|
156
|
+
Import:
|
|
157
|
+
|
|
158
|
+
```tsx
|
|
159
|
+
import type {
|
|
160
|
+
IntlayerState,
|
|
161
|
+
IntlayerMiddlewareOptions,
|
|
162
|
+
LocaleRoutingOptions,
|
|
163
|
+
LocaleRoutingAction,
|
|
164
|
+
LocaleRoutingRequest,
|
|
165
|
+
UseLocaleResult,
|
|
166
|
+
} from "remix-intlayer";
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
| Type | Description |
|
|
170
|
+
| --------------------------- | --------------------------------------------------------------------------------------------------------------- |
|
|
171
|
+
| `IntlayerState` | The state object holding `locale`, `defaultLocale`, and `availableLocales` stored in the Remix request context. |
|
|
172
|
+
| `IntlayerMiddlewareOptions` | Configuration options passed to the `intlayer()` middleware. |
|
|
173
|
+
| `LocaleRoutingOptions` | Options customising locale prefixing, detection, and redirects. |
|
|
174
|
+
| `LocaleRoutingAction` | Discriminated union representing the routing decision: `redirect`, `rewrite`, or `pass`. |
|
|
175
|
+
| `LocaleRoutingRequest` | Minimal request representation required by `createLocaleRouting`. |
|
|
176
|
+
| `UseLocaleResult` | Return type of `useLocale()`, containing `locale`, `defaultLocale`, and `availableLocales`. |
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
---
|
|
2
|
+
createdAt: 2026-09-19
|
|
3
|
+
updatedAt: 2026-09-19
|
|
4
|
+
title: intlayer Middleware Documentation | remix-intlayer
|
|
5
|
+
description: See how to use the intlayer middleware in Remix 3 applications for locale-based routing and request context management.
|
|
6
|
+
keywords:
|
|
7
|
+
- intlayer
|
|
8
|
+
- intlayerMiddleware
|
|
9
|
+
- remix
|
|
10
|
+
- remix-3
|
|
11
|
+
- middleware
|
|
12
|
+
- routing
|
|
13
|
+
- Internationalisation
|
|
14
|
+
- Documentation
|
|
15
|
+
slugs:
|
|
16
|
+
- doc
|
|
17
|
+
- packages
|
|
18
|
+
- remix-intlayer
|
|
19
|
+
- intlayerMiddleware
|
|
20
|
+
history:
|
|
21
|
+
- version: 9.5.5
|
|
22
|
+
date: 2026-09-19
|
|
23
|
+
changes: "Init doc"
|
|
24
|
+
author: aymericzip
|
|
25
|
+
---
|
|
26
|
+
|
|
27
|
+
# intlayer Remix 3 Middleware Documentation
|
|
28
|
+
|
|
29
|
+
The `intlayer` middleware for Remix 3 manages the internationalisation layer across your application. Built on web standards (`Request` and `Response`), it handles locale routing (redirects and internal rewrites), detects the request locale, persists it to cookies and headers, and establishes an `AsyncLocalStorage` scope so that downstream handlers and components can access translations without prop drilling.
|
|
30
|
+
|
|
31
|
+
## Usage
|
|
32
|
+
|
|
33
|
+
Register the `intlayer` middleware when initialising your Remix 3 router:
|
|
34
|
+
|
|
35
|
+
```ts fileName="src/server.ts"
|
|
36
|
+
import { createRouter } from "remix/router";
|
|
37
|
+
import { intlayer, useIntlayer, useLocale } from "remix-intlayer";
|
|
38
|
+
|
|
39
|
+
const router = createRouter({
|
|
40
|
+
middleware: [intlayer()],
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
// Serves `/`, `/fr`, `/es`, the locale is resolved from the request
|
|
44
|
+
router.get("/", () => {
|
|
45
|
+
const { title } = useIntlayer("home");
|
|
46
|
+
return new Response(title);
|
|
47
|
+
});
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
## Description
|
|
51
|
+
|
|
52
|
+
The `intlayer` middleware performs the following tasks:
|
|
53
|
+
|
|
54
|
+
1. **Dictionary Preparation**: Runs `prepareIntlayer` on startup to ensure all generated dictionaries are built and available.
|
|
55
|
+
2. **Locale Routing**: Evaluates the request against the configured routing strategy (`prefix_always`, `prefix_as_needed`, `no_prefix`):
|
|
56
|
+
- **Redirects**: If a user visits `/about` and should be routed to a locale prefix (e.g. `/fr/about`), the middleware issues a redirect response with appropriate `location` and `Set-Cookie` headers.
|
|
57
|
+
- **Internal Rewrites**: When a user accesses `/fr/about`, the URL is rewritten internally so your route handler matches `/about`, whilst the resolved locale is captured as `fr`.
|
|
58
|
+
- **Localized URL Aliases**: Respects URL rewrite rules defined in `intlayer.config.ts` (e.g., rewriting `/fr/about` to `/fr/a-propos`).
|
|
59
|
+
3. **Locale Resolution**: Detects the active locale based on URL prefix, persisted cookies, custom headers, or `Accept-Language` browser preferences.
|
|
60
|
+
4. **Context Injection**:
|
|
61
|
+
- Attaches `IntlayerState` (`locale`, `defaultLocale`, `availableLocales`) to the Remix `RequestContext` under the `Intlayer` key and `context.intlayer`.
|
|
62
|
+
- Runs the rest of the request inside an `AsyncLocalStorage` scope (`requestStorage`), enabling `useIntlayer`, `useDictionary`, and `useLocale` to be invoked cleanly in handlers, views, and components.
|
|
63
|
+
5. **Persistence**: Attaches outgoing locale headers and cookies to the final HTTP response to persist the user's preference.
|
|
64
|
+
|
|
65
|
+
## Parameters
|
|
66
|
+
|
|
67
|
+
The `intlayer` function accepts optional `IntlayerMiddlewareOptions`:
|
|
68
|
+
|
|
69
|
+
```ts
|
|
70
|
+
import { intlayer, type IntlayerMiddlewareOptions } from "remix-intlayer";
|
|
71
|
+
|
|
72
|
+
const options: IntlayerMiddlewareOptions = {
|
|
73
|
+
// Custom routing configuration overrides
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
const middleware = intlayer(options);
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
## Accessing Context Directly
|
|
80
|
+
|
|
81
|
+
In addition to using hooks, you can access the resolved `IntlayerState` directly from the Remix request context:
|
|
82
|
+
|
|
83
|
+
```ts
|
|
84
|
+
import { Intlayer } from "remix-intlayer";
|
|
85
|
+
|
|
86
|
+
router.get("/api/locale", (context) => {
|
|
87
|
+
// Via context.get()
|
|
88
|
+
const state = context.get(Intlayer);
|
|
89
|
+
|
|
90
|
+
// Or via direct context.intlayer property
|
|
91
|
+
const { locale } = context.intlayer;
|
|
92
|
+
|
|
93
|
+
return Response.json({ locale });
|
|
94
|
+
});
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
## Related Documentation
|
|
98
|
+
|
|
99
|
+
- [`Intlayer` Context](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en-GB/packages/remix-intlayer/Intlayer.md)
|
|
100
|
+
- [`useIntlayer` Hook](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en-GB/packages/remix-intlayer/useIntlayer.md)
|
|
101
|
+
- [`useLocale` Hook](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en-GB/packages/remix-intlayer/useLocale.md)
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
---
|
|
2
|
+
createdAt: 2026-09-19
|
|
3
|
+
updatedAt: 2026-09-19
|
|
4
|
+
title: useDictionary Hook Documentation | remix-intlayer
|
|
5
|
+
description: See how to use the useDictionary hook in Remix 3 applications to resolve dictionary objects for the current request locale.
|
|
6
|
+
keywords:
|
|
7
|
+
- useDictionary
|
|
8
|
+
- dictionary
|
|
9
|
+
- remix
|
|
10
|
+
- remix-3
|
|
11
|
+
- Intlayer
|
|
12
|
+
- intlayer
|
|
13
|
+
- Internationalisation
|
|
14
|
+
- Documentation
|
|
15
|
+
slugs:
|
|
16
|
+
- doc
|
|
17
|
+
- packages
|
|
18
|
+
- remix-intlayer
|
|
19
|
+
- useDictionary
|
|
20
|
+
history:
|
|
21
|
+
- version: 9.5.5
|
|
22
|
+
date: 2026-09-19
|
|
23
|
+
changes: "Init doc"
|
|
24
|
+
author: aymericzip
|
|
25
|
+
---
|
|
26
|
+
|
|
27
|
+
# useDictionary Hook Documentation
|
|
28
|
+
|
|
29
|
+
The `useDictionary` hook transforms an imported or inline dictionary object and returns its content resolved for the current request's locale in Remix 3 applications.
|
|
30
|
+
|
|
31
|
+
Unlike `useIntlayer`, which resolves dictionaries by their string key from the global dictionary registry, `useDictionary` accepts a dictionary object directly.
|
|
32
|
+
|
|
33
|
+
## Usage
|
|
34
|
+
|
|
35
|
+
```ts fileName="src/views/home.ts"
|
|
36
|
+
import { useDictionary } from "remix-intlayer";
|
|
37
|
+
import homeContent from "./home.content";
|
|
38
|
+
|
|
39
|
+
export const HomeView = () => {
|
|
40
|
+
const content = useDictionary(homeContent);
|
|
41
|
+
|
|
42
|
+
return `
|
|
43
|
+
<div>
|
|
44
|
+
<h1>${content.title}</h1>
|
|
45
|
+
<p>${content.subtitle}</p>
|
|
46
|
+
</div>
|
|
47
|
+
`;
|
|
48
|
+
};
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
You can also pass inline dictionaries defined with `t()`:
|
|
52
|
+
|
|
53
|
+
```ts
|
|
54
|
+
import { useDictionary } from "remix-intlayer";
|
|
55
|
+
import { t } from "intlayer";
|
|
56
|
+
|
|
57
|
+
export const FooterView = () => {
|
|
58
|
+
const content = useDictionary({
|
|
59
|
+
key: "footer",
|
|
60
|
+
content: {
|
|
61
|
+
copyright: t({
|
|
62
|
+
"en-GB": "All rights reserved.",
|
|
63
|
+
en: "All rights reserved.",
|
|
64
|
+
fr: "Tous droits réservés.",
|
|
65
|
+
}),
|
|
66
|
+
},
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
return `<footer>${content.copyright}</footer>`;
|
|
70
|
+
};
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
## Parameters
|
|
74
|
+
|
|
75
|
+
```ts
|
|
76
|
+
useDictionary(dictionary, localeOrSelector?)
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
1. **`dictionary`**: A dictionary object or qualified dictionary group.
|
|
80
|
+
2. **`localeOrSelector`** (optional): A specific locale or selector object (`{ item }`, `{ variant }`, optionally with `locale`).
|
|
81
|
+
|
|
82
|
+
## Description
|
|
83
|
+
|
|
84
|
+
The hook performs the following tasks:
|
|
85
|
+
|
|
86
|
+
1. **Locale Detection**: Reads the active request locale from the `AsyncLocalStorage` store created by the `intlayer()` middleware.
|
|
87
|
+
2. **Content Resolution**: Evaluates translations (`t()`), enumerations, conditions, and nested structures according to the resolved locale.
|
|
88
|
+
3. **Selector Processing**: Applies any item or variant selectors specified in the arguments.
|
|
89
|
+
|
|
90
|
+
## Related Documentation
|
|
91
|
+
|
|
92
|
+
- [`intlayer` Middleware](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en-GB/packages/remix-intlayer/intlayerMiddleware.md)
|
|
93
|
+
- [`useIntlayer` Hook](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en-GB/packages/remix-intlayer/useIntlayer.md)
|
|
94
|
+
- [`useLocale` Hook](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en-GB/packages/remix-intlayer/useLocale.md)
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
---
|
|
2
|
+
createdAt: 2026-09-19
|
|
3
|
+
updatedAt: 2026-09-19
|
|
4
|
+
title: useIntlayer Hook Documentation | remix-intlayer
|
|
5
|
+
description: See how to use the useIntlayer hook in Remix 3 applications to access localised content by key.
|
|
6
|
+
keywords:
|
|
7
|
+
- useIntlayer
|
|
8
|
+
- dictionary
|
|
9
|
+
- remix
|
|
10
|
+
- remix-3
|
|
11
|
+
- Intlayer
|
|
12
|
+
- intlayer
|
|
13
|
+
- Internationalisation
|
|
14
|
+
- Documentation
|
|
15
|
+
slugs:
|
|
16
|
+
- doc
|
|
17
|
+
- packages
|
|
18
|
+
- remix-intlayer
|
|
19
|
+
- useIntlayer
|
|
20
|
+
history:
|
|
21
|
+
- version: 9.5.5
|
|
22
|
+
date: 2026-09-19
|
|
23
|
+
changes: "Init doc"
|
|
24
|
+
author: aymericzip
|
|
25
|
+
---
|
|
26
|
+
|
|
27
|
+
# useIntlayer Hook Documentation
|
|
28
|
+
|
|
29
|
+
The `useIntlayer` hook allows you to retrieve localised content from an Intlayer dictionary by key in Remix 3 applications.
|
|
30
|
+
|
|
31
|
+
It automatically reads the active locale from the current request context (via `AsyncLocalStorage`), so you do not need to pass the locale through route handlers, view templates, or components.
|
|
32
|
+
|
|
33
|
+
## Usage
|
|
34
|
+
|
|
35
|
+
### In Route Handlers
|
|
36
|
+
|
|
37
|
+
```ts fileName="src/server.ts"
|
|
38
|
+
import { createRouter } from "remix/router";
|
|
39
|
+
import { intlayer, useIntlayer } from "remix-intlayer";
|
|
40
|
+
|
|
41
|
+
const router = createRouter({
|
|
42
|
+
middleware: [intlayer()],
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
router.get("/api/welcome", () => {
|
|
46
|
+
const content = useIntlayer("home");
|
|
47
|
+
|
|
48
|
+
return Response.json({
|
|
49
|
+
title: content.title,
|
|
50
|
+
subtitle: content.subtitle,
|
|
51
|
+
});
|
|
52
|
+
});
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
### In View Templates / Components
|
|
56
|
+
|
|
57
|
+
```tsx fileName="src/views/home.ts"
|
|
58
|
+
import { useIntlayer } from "remix-intlayer";
|
|
59
|
+
|
|
60
|
+
export const HomeView = () => {
|
|
61
|
+
const content = useIntlayer("home");
|
|
62
|
+
|
|
63
|
+
return `
|
|
64
|
+
<main>
|
|
65
|
+
<h1>${content.title}</h1>
|
|
66
|
+
<p>${content.subtitle}</p>
|
|
67
|
+
</main>
|
|
68
|
+
`;
|
|
69
|
+
};
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
## Parameters
|
|
73
|
+
|
|
74
|
+
```ts
|
|
75
|
+
useIntlayer(key, localeOrSelector?)
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
1. **`key`**: The unique key of the dictionary (as defined in your `.content.ts` declaration files).
|
|
79
|
+
2. **`localeOrSelector`** (optional): A specific locale or selector object (`{ item }`, `{ variant }`, optionally with `locale`). When provided, it overrides the locale detected from the request context.
|
|
80
|
+
|
|
81
|
+
## Description
|
|
82
|
+
|
|
83
|
+
The hook performs the following tasks:
|
|
84
|
+
|
|
85
|
+
1. **Context Locale Retrieval**: Detects the current locale from the request-bound `AsyncLocalStorage` scope established by the `intlayer()` middleware.
|
|
86
|
+
2. **Dictionary Retrieval**: Retrieves the pre-compiled dictionary corresponding to the provided key.
|
|
87
|
+
3. **Translation Processing**: Resolves translations, enumerations, markdown, and conditional content for the resolved locale.
|
|
88
|
+
4. **Fallback Handling**: If called outside of an active HTTP request context, it gracefully falls back to the configured `defaultLocale`.
|
|
89
|
+
|
|
90
|
+
## Related Documentation
|
|
91
|
+
|
|
92
|
+
- [`intlayer` Middleware](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en-GB/packages/remix-intlayer/intlayerMiddleware.md)
|
|
93
|
+
- [`useDictionary` Hook](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en-GB/packages/remix-intlayer/useDictionary.md)
|
|
94
|
+
- [`useLocale` Hook](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en-GB/packages/remix-intlayer/useLocale.md)
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
---
|
|
2
|
+
createdAt: 2026-09-19
|
|
3
|
+
updatedAt: 2026-09-19
|
|
4
|
+
title: useLocale Hook Documentation | remix-intlayer
|
|
5
|
+
description: See how to use the useLocale hook in Remix 3 applications to get the current request locale, default locale, and available locales.
|
|
6
|
+
keywords:
|
|
7
|
+
- useLocale
|
|
8
|
+
- locale
|
|
9
|
+
- remix
|
|
10
|
+
- remix-3
|
|
11
|
+
- Intlayer
|
|
12
|
+
- intlayer
|
|
13
|
+
- Internationalisation
|
|
14
|
+
- Documentation
|
|
15
|
+
slugs:
|
|
16
|
+
- doc
|
|
17
|
+
- packages
|
|
18
|
+
- remix-intlayer
|
|
19
|
+
- useLocale
|
|
20
|
+
history:
|
|
21
|
+
- version: 9.5.5
|
|
22
|
+
date: 2026-09-19
|
|
23
|
+
changes: "Init doc"
|
|
24
|
+
author: aymericzip
|
|
25
|
+
---
|
|
26
|
+
|
|
27
|
+
# useLocale Hook Documentation
|
|
28
|
+
|
|
29
|
+
The `useLocale` hook from `remix-intlayer` provides access to the locale of the HTTP request currently being processed, along with the project's configured default and available locales.
|
|
30
|
+
|
|
31
|
+
## Usage
|
|
32
|
+
|
|
33
|
+
In a Remix component (for example a language switcher):
|
|
34
|
+
|
|
35
|
+
```tsx fileName="src/components/LocaleSwitcher.tsx"
|
|
36
|
+
import { type FC } from "react";
|
|
37
|
+
import { Link } from "@remix-run/react";
|
|
38
|
+
import { useLocale } from "remix-intlayer";
|
|
39
|
+
import { getLocalizedUrl, getPathWithoutLocale } from "intlayer";
|
|
40
|
+
|
|
41
|
+
export const LocaleSwitcher: FC = () => {
|
|
42
|
+
const { locale, availableLocales } = useLocale();
|
|
43
|
+
const pathWithoutLocale = getPathWithoutLocale();
|
|
44
|
+
|
|
45
|
+
return (
|
|
46
|
+
<nav>
|
|
47
|
+
<ul>
|
|
48
|
+
{availableLocales.map((localeItem) => (
|
|
49
|
+
<li key={localeItem} className="p-1">
|
|
50
|
+
<Link
|
|
51
|
+
href={getLocalizedUrl(pathWithoutLocale, localeItem)}
|
|
52
|
+
aria-current={localeItem === locale ? "page" : undefined}
|
|
53
|
+
>
|
|
54
|
+
{localeItem.toUpperCase()}
|
|
55
|
+
</Link>
|
|
56
|
+
</li>
|
|
57
|
+
))}
|
|
58
|
+
</ul>
|
|
59
|
+
</nav>
|
|
60
|
+
);
|
|
61
|
+
};
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
In a route handler:
|
|
65
|
+
|
|
66
|
+
```ts fileName="src/server.ts"
|
|
67
|
+
import { createRouter } from "remix/router";
|
|
68
|
+
import { intlayer, useLocale } from "remix-intlayer";
|
|
69
|
+
|
|
70
|
+
const router = createRouter({
|
|
71
|
+
middleware: [intlayer()],
|
|
72
|
+
});
|
|
73
|
+
|
|
74
|
+
router.get("/api/locale-info", () => {
|
|
75
|
+
const { locale, defaultLocale, availableLocales } = useLocale();
|
|
76
|
+
|
|
77
|
+
return Response.json({
|
|
78
|
+
locale,
|
|
79
|
+
defaultLocale,
|
|
80
|
+
availableLocales,
|
|
81
|
+
});
|
|
82
|
+
});
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
## Return Values
|
|
86
|
+
|
|
87
|
+
The hook returns an object of type `UseLocaleResult`:
|
|
88
|
+
|
|
89
|
+
| Property | Type | Description |
|
|
90
|
+
| ------------------ | ------------------- | ------------------------------------------------------------------ |
|
|
91
|
+
| `locale` | `DeclaredLocales` | The locale resolved for the current request. |
|
|
92
|
+
| `defaultLocale` | `DeclaredLocales` | The default fallback locale configured in `intlayer.config.ts`. |
|
|
93
|
+
| `availableLocales` | `DeclaredLocales[]` | Array of all available locales configured in `intlayer.config.ts`. |
|
|
94
|
+
|
|
95
|
+
## Description
|
|
96
|
+
|
|
97
|
+
1. **Request-Scoped Resolution**: In an active request handled by the `intlayer()` middleware, `useLocale` reads the resolved locale from the request storage.
|
|
98
|
+
2. **Graceful Fallback**: If called outside of a request context, it defaults to the configured `defaultLocale`.
|
|
99
|
+
|
|
100
|
+
## Related Documentation
|
|
101
|
+
|
|
102
|
+
- [`intlayer` Middleware](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en-GB/packages/remix-intlayer/intlayerMiddleware.md)
|
|
103
|
+
- [`useIntlayer` Hook](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en-GB/packages/remix-intlayer/useIntlayer.md)
|
|
104
|
+
- [`useDictionary` Hook](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en-GB/packages/remix-intlayer/useDictionary.md)
|
package/docs/en-GB/readme.md
CHANGED
|
@@ -199,7 +199,8 @@ Explore our comprehensive documentation to get started with Intlayer and learn h
|
|
|
199
199
|
<li><a href="https://intlayer.org/doc/environment/create-react-app" rel=''>React CRA</a></li>
|
|
200
200
|
<li><a href="https://intlayer.org/doc/environment/vite-and-react" rel=''>Vite + React</a></li>
|
|
201
201
|
<li><a href="https://intlayer.org/doc/environment/vite-and-react" rel=''>Vite + React using Compiler</a></li>
|
|
202
|
-
<li><a href="https://intlayer.org/doc/environment/vite-and-react/
|
|
202
|
+
<li><a href="https://intlayer.org/doc/environment/vite-and-react/react-router-v7" rel=''>React-router-v7</a></li>
|
|
203
|
+
<li><a href="https://intlayer.org/doc/environment/remix-3" rel=''>Remix 3</a></li>
|
|
203
204
|
<li><a href="https://intlayer.org/doc/environment/tanstack-start" rel=''>Tanstack start</a>
|
|
204
205
|
<ul>
|
|
205
206
|
<li><a href="https://intlayer.org/doc/environment/tanstack-start/solid" rel=''>Solid</a></li>
|