@intlayer/docs 8.3.0 → 8.3.2
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/blog/ar/i18n_using_next-i18next.md +1 -0
- package/blog/en-GB/next-i18next_vs_next-intl_vs_intlayer.md +0 -29
- package/blog/uk/internationalization_and_SEO.md +1 -1
- package/docs/ar/compiler.md +84 -49
- package/docs/ar/configuration.md +82 -58
- package/docs/ar/intlayer_with_analog.md +2 -2
- package/docs/ar/intlayer_with_angular.md +2 -2
- package/docs/ar/intlayer_with_astro.md +2 -2
- package/docs/ar/intlayer_with_lynx+react.md +2 -2
- package/docs/ar/intlayer_with_nextjs_16.md +174 -1
- package/docs/ar/intlayer_with_nextjs_compiler.md +174 -1
- package/docs/ar/intlayer_with_nextjs_no_locale_path.md +4 -7
- package/docs/ar/intlayer_with_react_native+expo.md +2 -2
- package/docs/ar/intlayer_with_react_router_v7.md +224 -1
- package/docs/ar/intlayer_with_react_router_v7_fs_routes.md +225 -1
- package/docs/ar/intlayer_with_svelte_kit.md +175 -2
- package/docs/ar/intlayer_with_tanstack.md +176 -1
- package/docs/ar/intlayer_with_vite+preact.md +176 -3
- package/docs/ar/intlayer_with_vite+react.md +174 -1
- package/docs/ar/intlayer_with_vite+solid.md +176 -3
- package/docs/ar/intlayer_with_vite+svelte.md +176 -3
- package/docs/ar/intlayer_with_vite+vue.md +178 -5
- package/docs/ar/vs_code_extension.md +1 -1
- package/docs/de/compiler.md +83 -48
- package/docs/de/configuration.md +417 -214
- package/docs/de/intlayer_with_analog.md +2 -2
- package/docs/de/intlayer_with_angular.md +2 -2
- package/docs/de/intlayer_with_astro.md +2 -2
- package/docs/de/intlayer_with_lynx+react.md +2 -2
- package/docs/de/intlayer_with_nextjs_16.md +176 -1
- package/docs/de/intlayer_with_nextjs_compiler.md +106 -349
- package/docs/de/intlayer_with_react_native+expo.md +2 -2
- package/docs/de/intlayer_with_react_router_v7.md +225 -2
- package/docs/de/intlayer_with_react_router_v7_fs_routes.md +221 -79
- package/docs/de/intlayer_with_svelte_kit.md +158 -2
- package/docs/de/intlayer_with_tanstack.md +159 -1
- package/docs/de/intlayer_with_vite+preact.md +159 -3
- package/docs/de/intlayer_with_vite+react.md +157 -1
- package/docs/de/intlayer_with_vite+solid.md +161 -5
- package/docs/de/intlayer_with_vite+svelte.md +159 -3
- package/docs/de/intlayer_with_vite+vue.md +159 -3
- package/docs/de/vs_code_extension.md +1 -1
- package/docs/en/compiler.md +60 -33
- package/docs/en/configuration.md +82 -77
- package/docs/en/intlayer_with_analog.md +1 -1
- package/docs/en/intlayer_with_angular.md +1 -1
- package/docs/en/intlayer_with_astro.md +1 -1
- package/docs/en/intlayer_with_lynx+react.md +1 -1
- package/docs/en/intlayer_with_nextjs_16.md +176 -0
- package/docs/en/intlayer_with_nextjs_compiler.md +179 -1
- package/docs/en/intlayer_with_react_native+expo.md +1 -1
- package/docs/en/intlayer_with_react_router_v7.md +159 -0
- package/docs/en/intlayer_with_react_router_v7_fs_routes.md +159 -0
- package/docs/en/intlayer_with_svelte_kit.md +159 -0
- package/docs/en/intlayer_with_tanstack.md +160 -1
- package/docs/en/intlayer_with_vite+preact.md +160 -1
- package/docs/en/intlayer_with_vite+react.md +159 -0
- package/docs/en/intlayer_with_vite+solid.md +149 -28
- package/docs/en/intlayer_with_vite+svelte.md +160 -1
- package/docs/en/intlayer_with_vite+vue.md +143 -42
- package/docs/en/vs_code_extension.md +1 -1
- package/docs/en-GB/compiler.md +66 -34
- package/docs/en-GB/configuration.md +80 -57
- package/docs/en-GB/intlayer_with_analog.md +1 -1
- package/docs/en-GB/intlayer_with_angular.md +1 -1
- package/docs/en-GB/intlayer_with_astro.md +1 -1
- package/docs/en-GB/intlayer_with_lynx+react.md +1 -1
- package/docs/en-GB/intlayer_with_react_native+expo.md +1 -1
- package/docs/en-GB/intlayer_with_vite+preact.md +1 -1
- package/docs/en-GB/intlayer_with_vite+react.md +1 -1
- package/docs/en-GB/intlayer_with_vite+solid.md +1 -1
- package/docs/en-GB/intlayer_with_vite+svelte.md +1 -1
- package/docs/en-GB/intlayer_with_vite+vue.md +2 -2
- package/docs/en-GB/vs_code_extension.md +1 -1
- package/docs/es/compiler.md +83 -48
- package/docs/es/configuration.md +412 -208
- package/docs/es/intlayer_with_adonisjs.md +1 -1
- package/docs/es/intlayer_with_analog.md +2 -2
- package/docs/es/intlayer_with_angular.md +2 -2
- package/docs/es/intlayer_with_astro.md +2 -2
- package/docs/es/intlayer_with_express.md +1 -1
- package/docs/es/intlayer_with_fastify.md +1 -1
- package/docs/es/intlayer_with_hono.md +1 -1
- package/docs/es/intlayer_with_lynx+react.md +2 -2
- package/docs/es/intlayer_with_nestjs.md +1 -1
- package/docs/es/intlayer_with_nextjs_16.md +176 -3
- package/docs/es/intlayer_with_nextjs_compiler.md +175 -2
- package/docs/es/intlayer_with_nuxt.md +1 -1
- package/docs/es/intlayer_with_react_native+expo.md +2 -2
- package/docs/es/intlayer_with_react_router_v7.md +227 -4
- package/docs/es/intlayer_with_react_router_v7_fs_routes.md +162 -4
- package/docs/es/intlayer_with_svelte_kit.md +158 -2
- package/docs/es/intlayer_with_tanstack.md +160 -2
- package/docs/es/intlayer_with_vite+preact.md +164 -8
- package/docs/es/intlayer_with_vite+react.md +160 -4
- package/docs/es/intlayer_with_vite+solid.md +165 -9
- package/docs/es/intlayer_with_vite+svelte.md +159 -3
- package/docs/es/intlayer_with_vite+vue.md +169 -13
- package/docs/es/vs_code_extension.md +1 -1
- package/docs/fr/compiler.md +81 -46
- package/docs/fr/configuration.md +351 -149
- package/docs/fr/intlayer_with_adonisjs.md +1 -1
- package/docs/fr/intlayer_with_analog.md +2 -2
- package/docs/fr/intlayer_with_angular.md +2 -2
- package/docs/fr/intlayer_with_astro.md +2 -2
- package/docs/fr/intlayer_with_express.md +1 -1
- package/docs/fr/intlayer_with_fastify.md +1 -1
- package/docs/fr/intlayer_with_hono.md +1 -1
- package/docs/fr/intlayer_with_lynx+react.md +2 -2
- package/docs/fr/intlayer_with_nestjs.md +1 -1
- package/docs/fr/intlayer_with_nextjs_16.md +183 -7
- package/docs/fr/intlayer_with_nextjs_compiler.md +179 -3
- package/docs/fr/intlayer_with_react_native+expo.md +2 -2
- package/docs/fr/intlayer_with_react_router_v7.md +229 -3
- package/docs/fr/intlayer_with_react_router_v7_fs_routes.md +237 -6
- package/docs/fr/intlayer_with_svelte_kit.md +158 -2
- package/docs/fr/intlayer_with_tanstack.md +159 -1
- package/docs/fr/intlayer_with_vite+preact.md +166 -10
- package/docs/fr/intlayer_with_vite+react.md +163 -7
- package/docs/fr/intlayer_with_vite+solid.md +165 -9
- package/docs/fr/intlayer_with_vite+svelte.md +159 -3
- package/docs/fr/intlayer_with_vite+vue.md +168 -12
- package/docs/fr/vs_code_extension.md +1 -1
- package/docs/hi/compiler.md +81 -46
- package/docs/hi/configuration.md +89 -65
- package/docs/hi/intlayer_with_analog.md +1 -1
- package/docs/hi/intlayer_with_angular.md +2 -2
- package/docs/hi/intlayer_with_astro.md +2 -2
- package/docs/hi/intlayer_with_lynx+react.md +2 -2
- package/docs/hi/intlayer_with_nextjs_16.md +174 -1
- package/docs/hi/intlayer_with_nextjs_compiler.md +174 -1
- package/docs/hi/intlayer_with_react_native+expo.md +2 -2
- package/docs/hi/intlayer_with_react_router_v7.md +224 -1
- package/docs/hi/intlayer_with_react_router_v7_fs_routes.md +225 -1
- package/docs/hi/intlayer_with_svelte_kit.md +158 -2
- package/docs/hi/intlayer_with_tanstack.md +159 -1
- package/docs/hi/intlayer_with_vite+preact.md +159 -3
- package/docs/hi/intlayer_with_vite+react.md +157 -1
- package/docs/hi/intlayer_with_vite+solid.md +159 -3
- package/docs/hi/intlayer_with_vite+svelte.md +159 -3
- package/docs/hi/intlayer_with_vite+vue.md +159 -3
- package/docs/hi/vs_code_extension.md +1 -1
- package/docs/id/compiler.md +84 -51
- package/docs/id/configuration.md +85 -65
- package/docs/id/intlayer_with_analog.md +2 -2
- package/docs/id/intlayer_with_angular.md +2 -2
- package/docs/id/intlayer_with_astro.md +2 -2
- package/docs/id/intlayer_with_lynx+react.md +2 -2
- package/docs/id/intlayer_with_nextjs_16.md +174 -1
- package/docs/id/intlayer_with_nextjs_compiler.md +174 -1
- package/docs/id/intlayer_with_react_native+expo.md +2 -2
- package/docs/id/intlayer_with_react_router_v7.md +224 -1
- package/docs/id/intlayer_with_react_router_v7_fs_routes.md +225 -1
- package/docs/id/intlayer_with_svelte_kit.md +158 -2
- package/docs/id/intlayer_with_tanstack.md +159 -1
- package/docs/id/intlayer_with_vite+preact.md +159 -3
- package/docs/id/intlayer_with_vite+react.md +159 -3
- package/docs/id/intlayer_with_vite+solid.md +159 -3
- package/docs/id/intlayer_with_vite+svelte.md +159 -3
- package/docs/id/intlayer_with_vite+vue.md +159 -3
- package/docs/id/vs_code_extension.md +1 -1
- package/docs/it/compiler.md +81 -46
- package/docs/it/configuration.md +410 -208
- package/docs/it/intlayer_with_analog.md +2 -2
- package/docs/it/intlayer_with_angular.md +2 -2
- package/docs/it/intlayer_with_astro.md +2 -2
- package/docs/it/intlayer_with_lynx+react.md +2 -2
- package/docs/it/intlayer_with_nextjs_16.md +174 -1
- package/docs/it/intlayer_with_nextjs_compiler.md +174 -1
- package/docs/it/intlayer_with_react_native+expo.md +2 -2
- package/docs/it/intlayer_with_react_router_v7.md +225 -2
- package/docs/it/intlayer_with_react_router_v7_fs_routes.md +226 -2
- package/docs/it/intlayer_with_svelte_kit.md +158 -2
- package/docs/it/intlayer_with_tanstack.md +159 -1
- package/docs/it/intlayer_with_vite+preact.md +159 -3
- package/docs/it/intlayer_with_vite+react.md +159 -3
- package/docs/it/intlayer_with_vite+solid.md +161 -5
- package/docs/it/intlayer_with_vite+svelte.md +159 -3
- package/docs/it/intlayer_with_vite+vue.md +161 -5
- package/docs/it/vs_code_extension.md +1 -1
- package/docs/ja/compiler.md +94 -58
- package/docs/ja/configuration.md +90 -66
- package/docs/ja/intlayer_with_analog.md +2 -2
- package/docs/ja/intlayer_with_angular.md +2 -2
- package/docs/ja/intlayer_with_astro.md +2 -2
- package/docs/ja/intlayer_with_lynx+react.md +2 -2
- package/docs/ja/intlayer_with_nextjs_16.md +174 -1
- package/docs/ja/intlayer_with_nextjs_compiler.md +174 -1
- package/docs/ja/intlayer_with_react_native+expo.md +2 -2
- package/docs/ja/intlayer_with_react_router_v7.md +184 -394
- package/docs/ja/intlayer_with_react_router_v7_fs_routes.md +226 -2
- package/docs/ja/intlayer_with_svelte_kit.md +119 -595
- package/docs/ja/intlayer_with_tanstack.md +131 -642
- package/docs/ja/intlayer_with_vite+preact.md +111 -1231
- package/docs/ja/intlayer_with_vite+react.md +129 -1304
- package/docs/ja/intlayer_with_vite+solid.md +161 -5
- package/docs/ja/intlayer_with_vite+svelte.md +159 -3
- package/docs/ja/intlayer_with_vite+vue.md +159 -3
- package/docs/ja/vs_code_extension.md +1 -1
- package/docs/ko/compiler.md +88 -52
- package/docs/ko/configuration.md +89 -65
- package/docs/ko/intlayer_with_analog.md +2 -2
- package/docs/ko/intlayer_with_angular.md +2 -2
- package/docs/ko/intlayer_with_astro.md +2 -2
- package/docs/ko/intlayer_with_lynx+react.md +2 -2
- package/docs/ko/intlayer_with_nextjs_16.md +174 -1
- package/docs/ko/intlayer_with_nextjs_compiler.md +174 -1
- package/docs/ko/intlayer_with_react_native+expo.md +2 -2
- package/docs/ko/intlayer_with_react_router_v7.md +225 -2
- package/docs/ko/intlayer_with_react_router_v7_fs_routes.md +226 -2
- package/docs/ko/intlayer_with_svelte_kit.md +158 -2
- package/docs/ko/intlayer_with_tanstack.md +159 -1
- package/docs/ko/intlayer_with_vite+preact.md +159 -3
- package/docs/ko/intlayer_with_vite+react.md +157 -1
- package/docs/ko/intlayer_with_vite+solid.md +161 -5
- package/docs/ko/intlayer_with_vite+svelte.md +159 -3
- package/docs/ko/intlayer_with_vite+vue.md +159 -3
- package/docs/ko/vs_code_extension.md +1 -1
- package/docs/pl/compiler.md +84 -51
- package/docs/pl/configuration.md +85 -57
- package/docs/pl/intlayer_with_analog.md +2 -2
- package/docs/pl/intlayer_with_angular.md +2 -2
- package/docs/pl/intlayer_with_astro.md +2 -2
- package/docs/pl/intlayer_with_lynx+react.md +2 -2
- package/docs/pl/intlayer_with_nextjs_16.md +174 -1
- package/docs/pl/intlayer_with_nextjs_compiler.md +174 -1
- package/docs/pl/intlayer_with_react_native+expo.md +2 -2
- package/docs/pl/intlayer_with_react_router_v7.md +224 -1
- package/docs/pl/intlayer_with_react_router_v7_fs_routes.md +225 -1
- package/docs/pl/intlayer_with_svelte_kit.md +158 -2
- package/docs/pl/intlayer_with_tanstack.md +159 -1
- package/docs/pl/intlayer_with_vite+preact.md +158 -2
- package/docs/pl/intlayer_with_vite+react.md +159 -3
- package/docs/pl/intlayer_with_vite+solid.md +159 -3
- package/docs/pl/intlayer_with_vite+svelte.md +159 -3
- package/docs/pl/intlayer_with_vite+vue.md +161 -5
- package/docs/pl/vs_code_extension.md +1 -1
- package/docs/pt/compiler.md +81 -46
- package/docs/pt/configuration.md +399 -199
- package/docs/pt/intlayer_with_analog.md +2 -2
- package/docs/pt/intlayer_with_angular.md +2 -2
- package/docs/pt/intlayer_with_astro.md +2 -2
- package/docs/pt/intlayer_with_lynx+react.md +2 -2
- package/docs/pt/intlayer_with_nextjs_16.md +174 -1
- package/docs/pt/intlayer_with_nextjs_compiler.md +174 -1
- package/docs/pt/intlayer_with_react_native+expo.md +2 -2
- package/docs/pt/intlayer_with_react_router_v7.md +224 -1
- package/docs/pt/intlayer_with_react_router_v7_fs_routes.md +225 -1
- package/docs/pt/intlayer_with_svelte_kit.md +158 -2
- package/docs/pt/intlayer_with_tanstack.md +159 -1
- package/docs/pt/intlayer_with_vite+preact.md +158 -2
- package/docs/pt/intlayer_with_vite+react.md +157 -1
- package/docs/pt/intlayer_with_vite+solid.md +159 -3
- package/docs/pt/intlayer_with_vite+svelte.md +159 -3
- package/docs/pt/intlayer_with_vite+vue.md +159 -3
- package/docs/pt/vs_code_extension.md +1 -1
- package/docs/ru/compiler.md +90 -57
- package/docs/ru/configuration.md +78 -67
- package/docs/ru/intlayer_with_analog.md +2 -2
- package/docs/ru/intlayer_with_angular.md +2 -2
- package/docs/ru/intlayer_with_astro.md +2 -2
- package/docs/ru/intlayer_with_lynx+react.md +2 -2
- package/docs/ru/intlayer_with_nextjs_16.md +174 -1
- package/docs/ru/intlayer_with_nextjs_compiler.md +174 -1
- package/docs/ru/intlayer_with_react_native+expo.md +2 -2
- package/docs/ru/intlayer_with_react_router_v7.md +224 -1
- package/docs/ru/intlayer_with_react_router_v7_fs_routes.md +225 -1
- package/docs/ru/intlayer_with_svelte_kit.md +158 -2
- package/docs/ru/intlayer_with_tanstack.md +159 -1
- package/docs/ru/intlayer_with_vite+preact.md +159 -3
- package/docs/ru/intlayer_with_vite+react.md +157 -1
- package/docs/ru/intlayer_with_vite+solid.md +159 -3
- package/docs/ru/intlayer_with_vite+svelte.md +159 -3
- package/docs/ru/intlayer_with_vite+vue.md +159 -3
- package/docs/ru/vs_code_extension.md +1 -1
- package/docs/tr/compiler.md +85 -52
- package/docs/tr/configuration.md +85 -61
- package/docs/tr/intlayer_with_analog.md +2 -2
- package/docs/tr/intlayer_with_angular.md +2 -2
- package/docs/tr/intlayer_with_astro.md +2 -2
- package/docs/tr/intlayer_with_lynx+react.md +2 -2
- package/docs/tr/intlayer_with_nextjs_16.md +174 -1
- package/docs/tr/intlayer_with_nextjs_compiler.md +174 -1
- package/docs/tr/intlayer_with_nextjs_no_locale_path.md +6 -14
- package/docs/tr/intlayer_with_react_native+expo.md +2 -2
- package/docs/tr/intlayer_with_react_router_v7.md +224 -1
- package/docs/tr/intlayer_with_react_router_v7_fs_routes.md +225 -1
- package/docs/tr/intlayer_with_svelte_kit.md +158 -2
- package/docs/tr/intlayer_with_tanstack.md +159 -1
- package/docs/tr/intlayer_with_vite+preact.md +159 -3
- package/docs/tr/intlayer_with_vite+react.md +159 -3
- package/docs/tr/intlayer_with_vite+solid.md +159 -3
- package/docs/tr/intlayer_with_vite+svelte.md +159 -3
- package/docs/tr/intlayer_with_vite+vue.md +159 -3
- package/docs/tr/vs_code_extension.md +1 -1
- package/docs/uk/compiler.md +96 -61
- package/docs/uk/configuration.md +85 -57
- package/docs/uk/intlayer_with_analog.md +2 -2
- package/docs/uk/intlayer_with_angular.md +2 -2
- package/docs/uk/intlayer_with_astro.md +2 -2
- package/docs/uk/intlayer_with_lynx+react.md +2 -2
- package/docs/uk/intlayer_with_nextjs_16.md +174 -1
- package/docs/uk/intlayer_with_nextjs_compiler.md +174 -1
- package/docs/uk/intlayer_with_nextjs_no_locale_path.md +4 -22
- package/docs/uk/intlayer_with_react_native+expo.md +2 -2
- package/docs/uk/intlayer_with_react_router_v7.md +224 -1
- package/docs/uk/intlayer_with_react_router_v7_fs_routes.md +225 -1
- package/docs/uk/intlayer_with_svelte_kit.md +157 -1
- package/docs/uk/intlayer_with_tanstack.md +159 -1
- package/docs/uk/intlayer_with_vite+preact.md +159 -3
- package/docs/uk/intlayer_with_vite+react.md +157 -1
- package/docs/uk/intlayer_with_vite+solid.md +159 -3
- package/docs/uk/intlayer_with_vite+svelte.md +159 -3
- package/docs/uk/intlayer_with_vite+vue.md +159 -3
- package/docs/uk/vs_code_extension.md +1 -1
- package/docs/vi/compiler.md +85 -50
- package/docs/vi/configuration.md +87 -59
- package/docs/vi/intlayer_with_analog.md +2 -2
- package/docs/vi/intlayer_with_angular.md +2 -2
- package/docs/vi/intlayer_with_astro.md +2 -2
- package/docs/vi/intlayer_with_lynx+react.md +2 -2
- package/docs/vi/intlayer_with_nextjs_16.md +174 -1
- package/docs/vi/intlayer_with_nextjs_compiler.md +174 -1
- package/docs/vi/intlayer_with_react_native+expo.md +2 -2
- package/docs/vi/intlayer_with_react_router_v7.md +224 -1
- package/docs/vi/intlayer_with_react_router_v7_fs_routes.md +225 -1
- package/docs/vi/intlayer_with_svelte_kit.md +158 -2
- package/docs/vi/intlayer_with_tanstack.md +159 -1
- package/docs/vi/intlayer_with_vite+preact.md +159 -3
- package/docs/vi/intlayer_with_vite+react.md +159 -3
- package/docs/vi/intlayer_with_vite+solid.md +159 -3
- package/docs/vi/intlayer_with_vite+svelte.md +159 -3
- package/docs/vi/intlayer_with_vite+vue.md +159 -3
- package/docs/vi/vs_code_extension.md +1 -1
- package/docs/zh/compiler.md +84 -49
- package/docs/zh/configuration.md +82 -58
- package/docs/zh/intlayer_with_adonisjs.md +1 -1
- package/docs/zh/intlayer_with_analog.md +2 -2
- package/docs/zh/intlayer_with_angular.md +2 -2
- package/docs/zh/intlayer_with_astro.md +2 -2
- package/docs/zh/intlayer_with_express.md +1 -1
- package/docs/zh/intlayer_with_fastify.md +1 -1
- package/docs/zh/intlayer_with_hono.md +1 -1
- package/docs/zh/intlayer_with_lynx+react.md +2 -2
- package/docs/zh/intlayer_with_nestjs.md +1 -1
- package/docs/zh/intlayer_with_nextjs_16.md +174 -1
- package/docs/zh/intlayer_with_nextjs_compiler.md +174 -1
- package/docs/zh/intlayer_with_react_native+expo.md +2 -2
- package/docs/zh/intlayer_with_react_router_v7.md +227 -4
- package/docs/zh/intlayer_with_react_router_v7_fs_routes.md +228 -4
- package/docs/zh/intlayer_with_svelte_kit.md +158 -2
- package/docs/zh/intlayer_with_tanstack.md +159 -1
- package/docs/zh/intlayer_with_vite+preact.md +161 -5
- package/docs/zh/intlayer_with_vite+react.md +157 -1
- package/docs/zh/intlayer_with_vite+solid.md +163 -7
- package/docs/zh/intlayer_with_vite+svelte.md +159 -3
- package/docs/zh/intlayer_with_vite+vue.md +162 -6
- package/docs/zh/vs_code_extension.md +2 -2
- package/package.json +8 -8
- package/docs/update_docs.py +0 -65
|
@@ -1629,6 +1629,182 @@ bun add @intlayer/swc --dev
|
|
|
1629
1629
|
|
|
1630
1630
|
> Note: If you set the option as `importMode: 'dynamic'` or `importMode: 'fetch'` (in the `dictionary` configuration), it will rely on Suspense, so you will have to wrap your `useIntlayer` calls in a `Suspense` boundary. That means, you will not be able to use the `useIntlayer` directly at the top level of your Page / Layout component.
|
|
1631
1631
|
|
|
1632
|
+
### (Optional) Step 14: Extract the content of your components
|
|
1633
|
+
|
|
1634
|
+
If you have an existing codebase, transforming thousands of files can be time-consuming.
|
|
1635
|
+
|
|
1636
|
+
To ease this process, Intlayer propose a [compiler](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en/compiler.md) / [extractor](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en/cli/extract.md) to transform your components and extract the content.
|
|
1637
|
+
|
|
1638
|
+
To set it up, you can add a `compiler` section in your `intlayer.config.ts` file:
|
|
1639
|
+
|
|
1640
|
+
```typescript fileName="intlayer.config.ts" codeFormat="typescript"
|
|
1641
|
+
import { type IntlayerConfig } from "intlayer";
|
|
1642
|
+
|
|
1643
|
+
const config: IntlayerConfig = {
|
|
1644
|
+
// ... Rest of your config
|
|
1645
|
+
compiler: {
|
|
1646
|
+
/**
|
|
1647
|
+
* Indicates if the compiler should be enabled.
|
|
1648
|
+
*/
|
|
1649
|
+
enabled: true,
|
|
1650
|
+
|
|
1651
|
+
/**
|
|
1652
|
+
* Defines the output files path
|
|
1653
|
+
*/
|
|
1654
|
+
output: ({ fileName, extension }) => `./${fileName}${extension}`,
|
|
1655
|
+
|
|
1656
|
+
/**
|
|
1657
|
+
* Indicates if the components should be saved after being transformed.
|
|
1658
|
+
* That way, the compiler can be run only once to transform the app, and then it can be removed.
|
|
1659
|
+
*/
|
|
1660
|
+
saveComponents: false,
|
|
1661
|
+
|
|
1662
|
+
/**
|
|
1663
|
+
* Dictionary key prefix
|
|
1664
|
+
*/
|
|
1665
|
+
dictionaryKeyPrefix: "",
|
|
1666
|
+
},
|
|
1667
|
+
};
|
|
1668
|
+
|
|
1669
|
+
export default config;
|
|
1670
|
+
```
|
|
1671
|
+
|
|
1672
|
+
```javascript fileName="intlayer.config.mjs" codeFormat="esm"
|
|
1673
|
+
/** @type {import('intlayer').IntlayerConfig} */
|
|
1674
|
+
const config = {
|
|
1675
|
+
// ... Rest of your config
|
|
1676
|
+
compiler: {
|
|
1677
|
+
/**
|
|
1678
|
+
* Indicates if the compiler should be enabled.
|
|
1679
|
+
*/
|
|
1680
|
+
enabled: true,
|
|
1681
|
+
|
|
1682
|
+
/**
|
|
1683
|
+
* Defines the output files path
|
|
1684
|
+
*/
|
|
1685
|
+
output: ({ fileName, extension }) => `./${fileName}${extension}`,
|
|
1686
|
+
|
|
1687
|
+
/**
|
|
1688
|
+
* Indicates if the components should be saved after being transformed.
|
|
1689
|
+
* That way, the compiler can be run only once to transform the app, and then it can be removed.
|
|
1690
|
+
*/
|
|
1691
|
+
saveComponents: false,
|
|
1692
|
+
|
|
1693
|
+
/**
|
|
1694
|
+
* Dictionary key prefix
|
|
1695
|
+
*/
|
|
1696
|
+
dictionaryKeyPrefix: "",
|
|
1697
|
+
},
|
|
1698
|
+
};
|
|
1699
|
+
|
|
1700
|
+
export default config;
|
|
1701
|
+
```
|
|
1702
|
+
|
|
1703
|
+
```javascript fileName="intlayer.config.cjs" codeFormat="commonjs"
|
|
1704
|
+
/** @type {import('intlayer').IntlayerConfig} */
|
|
1705
|
+
const config = {
|
|
1706
|
+
// ... Rest of your config
|
|
1707
|
+
compiler: {
|
|
1708
|
+
/**
|
|
1709
|
+
* Indicates if the compiler should be enabled.
|
|
1710
|
+
*/
|
|
1711
|
+
enabled: true,
|
|
1712
|
+
|
|
1713
|
+
/**
|
|
1714
|
+
* Defines the output files path
|
|
1715
|
+
*/
|
|
1716
|
+
output: ({ fileName, extension }) => `./${fileName}${extension}`,
|
|
1717
|
+
|
|
1718
|
+
/**
|
|
1719
|
+
* Indicates if the components should be saved after being transformed.
|
|
1720
|
+
* That way, the compiler can be run only once to transform the app, and then it can be removed.
|
|
1721
|
+
*/
|
|
1722
|
+
saveComponents: false,
|
|
1723
|
+
|
|
1724
|
+
/**
|
|
1725
|
+
* Dictionary key prefix
|
|
1726
|
+
*/
|
|
1727
|
+
dictionaryKeyPrefix: "",
|
|
1728
|
+
},
|
|
1729
|
+
};
|
|
1730
|
+
|
|
1731
|
+
module.exports = config;
|
|
1732
|
+
```
|
|
1733
|
+
|
|
1734
|
+
<Tabs>
|
|
1735
|
+
<Tab value='Extract command'>
|
|
1736
|
+
|
|
1737
|
+
Run the extractor to transform your components and extract the content
|
|
1738
|
+
|
|
1739
|
+
```bash packageManager="npm"
|
|
1740
|
+
npx intlayer extract
|
|
1741
|
+
```
|
|
1742
|
+
|
|
1743
|
+
```bash packageManager="pnpm"
|
|
1744
|
+
pnpm intlayer extract
|
|
1745
|
+
```
|
|
1746
|
+
|
|
1747
|
+
```bash packageManager="yarn"
|
|
1748
|
+
yarn intlayer extract
|
|
1749
|
+
```
|
|
1750
|
+
|
|
1751
|
+
```bash packageManager="bun"
|
|
1752
|
+
bunx intlayer extract
|
|
1753
|
+
```
|
|
1754
|
+
|
|
1755
|
+
</Tab>
|
|
1756
|
+
<Tab value='Babel compiler'>
|
|
1757
|
+
|
|
1758
|
+
```bash packageManager="npm"
|
|
1759
|
+
npm install @intlayer/babel --save-dev
|
|
1760
|
+
```
|
|
1761
|
+
|
|
1762
|
+
```bash packageManager="pnpm"
|
|
1763
|
+
pnpm add @intlayer/babel --save-dev
|
|
1764
|
+
```
|
|
1765
|
+
|
|
1766
|
+
```bash packageManager="yarn"
|
|
1767
|
+
yarn add @intlayer/babel --save-dev
|
|
1768
|
+
```
|
|
1769
|
+
|
|
1770
|
+
```bash packageManager="bun"
|
|
1771
|
+
bun add @intlayer/babel --dev
|
|
1772
|
+
```
|
|
1773
|
+
|
|
1774
|
+
```js fileName="babel.config.js"
|
|
1775
|
+
const {
|
|
1776
|
+
intlayerExtractBabelPlugin,
|
|
1777
|
+
getExtractPluginOptions,
|
|
1778
|
+
} = require("@intlayer/babel");
|
|
1779
|
+
|
|
1780
|
+
module.exports = {
|
|
1781
|
+
presets: ["next/babel"],
|
|
1782
|
+
plugins: [
|
|
1783
|
+
// Extract content from components into dictionaries
|
|
1784
|
+
[intlayerExtractBabelPlugin, getExtractPluginOptions()],
|
|
1785
|
+
],
|
|
1786
|
+
};
|
|
1787
|
+
```
|
|
1788
|
+
|
|
1789
|
+
```bash packageManager="npm"
|
|
1790
|
+
npm run build # Or npm run dev
|
|
1791
|
+
```
|
|
1792
|
+
|
|
1793
|
+
```bash packageManager="pnpm"
|
|
1794
|
+
pnpm run build # Or pnpm run dev
|
|
1795
|
+
```
|
|
1796
|
+
|
|
1797
|
+
```bash packageManager="yarn"
|
|
1798
|
+
yarn build # Or yarn dev
|
|
1799
|
+
```
|
|
1800
|
+
|
|
1801
|
+
```bash packageManager="bun"
|
|
1802
|
+
bun run build # Or bun run dev
|
|
1803
|
+
```
|
|
1804
|
+
|
|
1805
|
+
</Tab>
|
|
1806
|
+
</Tabs>
|
|
1807
|
+
|
|
1632
1808
|
### Watch dictionaries changes on Turbopack
|
|
1633
1809
|
|
|
1634
1810
|
When using Turbopack as your development server with the `next dev` command, dictionary changes will not be automatically detected by default.
|
|
@@ -431,7 +431,9 @@ export const LocaleSwitcher: FC = () => {
|
|
|
431
431
|
|
|
432
432
|
When using `next-intlayer`, dictionaries are included in the bundle for every page by default. To optimize bundle size, Intlayer provides an optional SWC plugin that intelligently replace `useIntlayer` calls using macros. This ensures dictionaries are only included in bundles for pages that actually use them.
|
|
433
433
|
|
|
434
|
-
|
|
434
|
+
The `@intlayer/babel` plugin already integrate the bundling optimization (see `babel.config.js`). But the `@intlayer/swc` plugin is more performant. If you remove the `@intlayer/babel` plugin, you can use the `@intlayer/swc` plugin.
|
|
435
|
+
|
|
436
|
+
Install the `@intlayer/swc` package. Once installed, `next-intlayer` will automatically detect and use the plugin:
|
|
435
437
|
|
|
436
438
|
```bash packageManager="npm"
|
|
437
439
|
npm install @intlayer/swc --save-dev
|
|
@@ -455,6 +457,182 @@ bun add @intlayer/swc --dev
|
|
|
455
457
|
|
|
456
458
|
> Note: If you set the option as `importMode: 'dynamic'` or `importMode: 'fetch'` (in the `dictionary` configuration), it will rely on Suspense, so you will have to wrap your `useIntlayer` calls in a `Suspense` boundary. That means, you will not be able to use the `useIntlayer` directly at the top level of your Page / Layout component.
|
|
457
459
|
|
|
460
|
+
### (Optional) Step 11: Extract the content of your components
|
|
461
|
+
|
|
462
|
+
If you have an existing codebase, transforming thousands of files can be time-consuming.
|
|
463
|
+
|
|
464
|
+
To ease this process, Intlayer propose a [compiler](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en/compiler.md) / [extractor](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en/cli/extract.md) to transform your components and extract the content.
|
|
465
|
+
|
|
466
|
+
To set it up, you can add a `compiler` section in your `intlayer.config.ts` file:
|
|
467
|
+
|
|
468
|
+
```typescript fileName="intlayer.config.ts" codeFormat="typescript"
|
|
469
|
+
import { type IntlayerConfig } from "intlayer";
|
|
470
|
+
|
|
471
|
+
const config: IntlayerConfig = {
|
|
472
|
+
// ... Rest of your config
|
|
473
|
+
compiler: {
|
|
474
|
+
/**
|
|
475
|
+
* Indicates if the compiler should be enabled.
|
|
476
|
+
*/
|
|
477
|
+
enabled: true,
|
|
478
|
+
|
|
479
|
+
/**
|
|
480
|
+
* Defines the output files path
|
|
481
|
+
*/
|
|
482
|
+
output: ({ fileName, extension }) => `./${fileName}${extension}`,
|
|
483
|
+
|
|
484
|
+
/**
|
|
485
|
+
* Indicates if the components should be saved after being transformed.
|
|
486
|
+
* That way, the compiler can be run only once to transform the app, and then it can be removed.
|
|
487
|
+
*/
|
|
488
|
+
saveComponents: false,
|
|
489
|
+
|
|
490
|
+
/**
|
|
491
|
+
* Dictionary key prefix
|
|
492
|
+
*/
|
|
493
|
+
dictionaryKeyPrefix: "",
|
|
494
|
+
},
|
|
495
|
+
};
|
|
496
|
+
|
|
497
|
+
export default config;
|
|
498
|
+
```
|
|
499
|
+
|
|
500
|
+
```javascript fileName="intlayer.config.mjs" codeFormat="esm"
|
|
501
|
+
/** @type {import('intlayer').IntlayerConfig} */
|
|
502
|
+
const config = {
|
|
503
|
+
// ... Rest of your config
|
|
504
|
+
compiler: {
|
|
505
|
+
/**
|
|
506
|
+
* Indicates if the compiler should be enabled.
|
|
507
|
+
*/
|
|
508
|
+
enabled: true,
|
|
509
|
+
|
|
510
|
+
/**
|
|
511
|
+
* Defines the output files path
|
|
512
|
+
*/
|
|
513
|
+
output: ({ fileName, extension }) => `./${fileName}${extension}`,
|
|
514
|
+
|
|
515
|
+
/**
|
|
516
|
+
* Indicates if the components should be saved after being transformed.
|
|
517
|
+
* That way, the compiler can be run only once to transform the app, and then it can be removed.
|
|
518
|
+
*/
|
|
519
|
+
saveComponents: false,
|
|
520
|
+
|
|
521
|
+
/**
|
|
522
|
+
* Dictionary key prefix
|
|
523
|
+
*/
|
|
524
|
+
dictionaryKeyPrefix: "",
|
|
525
|
+
},
|
|
526
|
+
};
|
|
527
|
+
|
|
528
|
+
export default config;
|
|
529
|
+
```
|
|
530
|
+
|
|
531
|
+
```javascript fileName="intlayer.config.cjs" codeFormat="commonjs"
|
|
532
|
+
/** @type {import('intlayer').IntlayerConfig} */
|
|
533
|
+
const config = {
|
|
534
|
+
// ... Rest of your config
|
|
535
|
+
compiler: {
|
|
536
|
+
/**
|
|
537
|
+
* Indicates if the compiler should be enabled.
|
|
538
|
+
*/
|
|
539
|
+
enabled: true,
|
|
540
|
+
|
|
541
|
+
/**
|
|
542
|
+
* Defines the output files path
|
|
543
|
+
*/
|
|
544
|
+
output: ({ fileName, extension }) => `./${fileName}${extension}`,
|
|
545
|
+
|
|
546
|
+
/**
|
|
547
|
+
* Indicates if the components should be saved after being transformed.
|
|
548
|
+
* That way, the compiler can be run only once to transform the app, and then it can be removed.
|
|
549
|
+
*/
|
|
550
|
+
saveComponents: false,
|
|
551
|
+
|
|
552
|
+
/**
|
|
553
|
+
* Dictionary key prefix
|
|
554
|
+
*/
|
|
555
|
+
dictionaryKeyPrefix: "",
|
|
556
|
+
},
|
|
557
|
+
};
|
|
558
|
+
|
|
559
|
+
module.exports = config;
|
|
560
|
+
```
|
|
561
|
+
|
|
562
|
+
<Tabs>
|
|
563
|
+
<Tab value='Extract command'>
|
|
564
|
+
|
|
565
|
+
Run the extractor to transform your components and extract the content
|
|
566
|
+
|
|
567
|
+
```bash packageManager="npm"
|
|
568
|
+
npx intlayer extract
|
|
569
|
+
```
|
|
570
|
+
|
|
571
|
+
```bash packageManager="pnpm"
|
|
572
|
+
pnpm intlayer extract
|
|
573
|
+
```
|
|
574
|
+
|
|
575
|
+
```bash packageManager="yarn"
|
|
576
|
+
yarn intlayer extract
|
|
577
|
+
```
|
|
578
|
+
|
|
579
|
+
```bash packageManager="bun"
|
|
580
|
+
bunx intlayer extract
|
|
581
|
+
```
|
|
582
|
+
|
|
583
|
+
</Tab>
|
|
584
|
+
<Tab value='Babel compiler'>
|
|
585
|
+
|
|
586
|
+
```bash packageManager="npm"
|
|
587
|
+
npm install @intlayer/babel --save-dev
|
|
588
|
+
```
|
|
589
|
+
|
|
590
|
+
```bash packageManager="pnpm"
|
|
591
|
+
pnpm add @intlayer/babel --save-dev
|
|
592
|
+
```
|
|
593
|
+
|
|
594
|
+
```bash packageManager="yarn"
|
|
595
|
+
yarn add @intlayer/babel --save-dev
|
|
596
|
+
```
|
|
597
|
+
|
|
598
|
+
```bash packageManager="bun"
|
|
599
|
+
bun add @intlayer/babel --dev
|
|
600
|
+
```
|
|
601
|
+
|
|
602
|
+
```js fileName="babel.config.js"
|
|
603
|
+
const {
|
|
604
|
+
intlayerExtractBabelPlugin,
|
|
605
|
+
getExtractPluginOptions,
|
|
606
|
+
} = require("@intlayer/babel");
|
|
607
|
+
|
|
608
|
+
module.exports = {
|
|
609
|
+
presets: ["next/babel"],
|
|
610
|
+
plugins: [
|
|
611
|
+
// Extract content from components into dictionaries
|
|
612
|
+
[intlayerExtractBabelPlugin, getExtractPluginOptions()],
|
|
613
|
+
],
|
|
614
|
+
};
|
|
615
|
+
```
|
|
616
|
+
|
|
617
|
+
```bash packageManager="npm"
|
|
618
|
+
npm run build # Or npm run dev
|
|
619
|
+
```
|
|
620
|
+
|
|
621
|
+
```bash packageManager="pnpm"
|
|
622
|
+
pnpm run build # Or pnpm run dev
|
|
623
|
+
```
|
|
624
|
+
|
|
625
|
+
```bash packageManager="yarn"
|
|
626
|
+
yarn build # Or yarn dev
|
|
627
|
+
```
|
|
628
|
+
|
|
629
|
+
```bash packageManager="bun"
|
|
630
|
+
bun run build # Or bun run dev
|
|
631
|
+
```
|
|
632
|
+
|
|
633
|
+
</Tab>
|
|
634
|
+
</Tabs>
|
|
635
|
+
|
|
458
636
|
### Configure TypeScript
|
|
459
637
|
|
|
460
638
|
Intlayer use module augmentation to get benefits of TypeScript and make your codebase stronger.
|
|
@@ -530,6 +530,165 @@ export default defineConfig({
|
|
|
530
530
|
});
|
|
531
531
|
```
|
|
532
532
|
|
|
533
|
+
### (Optional) Step 12: Extract the content of your components
|
|
534
|
+
|
|
535
|
+
If you have an existing codebase, transforming thousands of files can be time-consuming.
|
|
536
|
+
|
|
537
|
+
To ease this process, Intlayer propose a [compiler](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en/compiler.md) / [extractor](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en/cli/extract.md) to transform your components and extract the content.
|
|
538
|
+
|
|
539
|
+
To set it up, you can add a `compiler` section in your `intlayer.config.ts` file:
|
|
540
|
+
|
|
541
|
+
```typescript fileName="intlayer.config.ts" codeFormat="typescript"
|
|
542
|
+
import { type IntlayerConfig } from "intlayer";
|
|
543
|
+
|
|
544
|
+
const config: IntlayerConfig = {
|
|
545
|
+
// ... Rest of your config
|
|
546
|
+
compiler: {
|
|
547
|
+
/**
|
|
548
|
+
* Indicates if the compiler should be enabled.
|
|
549
|
+
*/
|
|
550
|
+
enabled: true,
|
|
551
|
+
|
|
552
|
+
/**
|
|
553
|
+
* Defines the output files path
|
|
554
|
+
*/
|
|
555
|
+
output: ({ fileName, extension }) => `./${fileName}${extension}`,
|
|
556
|
+
|
|
557
|
+
/**
|
|
558
|
+
* Indicates if the components should be saved after being transformed.
|
|
559
|
+
* That way, the compiler can be run only once to transform the app, and then it can be removed.
|
|
560
|
+
*/
|
|
561
|
+
saveComponents: false,
|
|
562
|
+
|
|
563
|
+
/**
|
|
564
|
+
* Dictionary key prefix
|
|
565
|
+
*/
|
|
566
|
+
dictionaryKeyPrefix: "",
|
|
567
|
+
},
|
|
568
|
+
};
|
|
569
|
+
|
|
570
|
+
export default config;
|
|
571
|
+
```
|
|
572
|
+
|
|
573
|
+
```javascript fileName="intlayer.config.mjs" codeFormat="esm"
|
|
574
|
+
/** @type {import('intlayer').IntlayerConfig} */
|
|
575
|
+
const config = {
|
|
576
|
+
// ... Rest of your config
|
|
577
|
+
compiler: {
|
|
578
|
+
/**
|
|
579
|
+
* Indicates if the compiler should be enabled.
|
|
580
|
+
*/
|
|
581
|
+
enabled: true,
|
|
582
|
+
|
|
583
|
+
/**
|
|
584
|
+
* Defines the output files path
|
|
585
|
+
*/
|
|
586
|
+
output: ({ fileName, extension }) => `./${fileName}${extension}`,
|
|
587
|
+
|
|
588
|
+
/**
|
|
589
|
+
* Indicates if the components should be saved after being transformed.
|
|
590
|
+
* That way, the compiler can be run only once to transform the app, and then it can be removed.
|
|
591
|
+
*/
|
|
592
|
+
saveComponents: false,
|
|
593
|
+
|
|
594
|
+
/**
|
|
595
|
+
* Dictionary key prefix
|
|
596
|
+
*/
|
|
597
|
+
dictionaryKeyPrefix: "",
|
|
598
|
+
},
|
|
599
|
+
};
|
|
600
|
+
|
|
601
|
+
export default config;
|
|
602
|
+
```
|
|
603
|
+
|
|
604
|
+
```javascript fileName="intlayer.config.cjs" codeFormat="commonjs"
|
|
605
|
+
/** @type {import('intlayer').IntlayerConfig} */
|
|
606
|
+
const config = {
|
|
607
|
+
// ... Rest of your config
|
|
608
|
+
compiler: {
|
|
609
|
+
/**
|
|
610
|
+
* Indicates if the compiler should be enabled.
|
|
611
|
+
*/
|
|
612
|
+
enabled: true,
|
|
613
|
+
|
|
614
|
+
/**
|
|
615
|
+
* Defines the output files path
|
|
616
|
+
*/
|
|
617
|
+
output: ({ fileName, extension }) => `./${fileName}${extension}`,
|
|
618
|
+
|
|
619
|
+
/**
|
|
620
|
+
* Indicates if the components should be saved after being transformed.
|
|
621
|
+
* That way, the compiler can be run only once to transform the app, and then it can be removed.
|
|
622
|
+
*/
|
|
623
|
+
saveComponents: false,
|
|
624
|
+
|
|
625
|
+
/**
|
|
626
|
+
* Dictionary key prefix
|
|
627
|
+
*/
|
|
628
|
+
dictionaryKeyPrefix: "",
|
|
629
|
+
},
|
|
630
|
+
};
|
|
631
|
+
|
|
632
|
+
module.exports = config;
|
|
633
|
+
```
|
|
634
|
+
|
|
635
|
+
<Tabs>
|
|
636
|
+
<Tab value='Extract command'>
|
|
637
|
+
|
|
638
|
+
Run the extractor to transform your components and extract the content
|
|
639
|
+
|
|
640
|
+
```bash packageManager="npm"
|
|
641
|
+
npx intlayer extract
|
|
642
|
+
```
|
|
643
|
+
|
|
644
|
+
```bash packageManager="pnpm"
|
|
645
|
+
pnpm intlayer extract
|
|
646
|
+
```
|
|
647
|
+
|
|
648
|
+
```bash packageManager="yarn"
|
|
649
|
+
yarn intlayer extract
|
|
650
|
+
```
|
|
651
|
+
|
|
652
|
+
```bash packageManager="bun"
|
|
653
|
+
bunx intlayer extract
|
|
654
|
+
```
|
|
655
|
+
|
|
656
|
+
</Tab>
|
|
657
|
+
<Tab value='Babel compiler'>
|
|
658
|
+
|
|
659
|
+
Update your `vite.config.ts` to include the `intlayerCompiler` plugin:
|
|
660
|
+
|
|
661
|
+
```ts fileName="vite.config.ts"
|
|
662
|
+
import { defineConfig } from "vite";
|
|
663
|
+
import { intlayer, intlayerCompiler } from "vite-intlayer";
|
|
664
|
+
|
|
665
|
+
export default defineConfig({
|
|
666
|
+
plugins: [
|
|
667
|
+
intlayer(),
|
|
668
|
+
intlayerCompiler(), // Adds the compiler plugin
|
|
669
|
+
],
|
|
670
|
+
});
|
|
671
|
+
```
|
|
672
|
+
|
|
673
|
+
```bash packageManager="npm"
|
|
674
|
+
npm run build # Or npm run dev
|
|
675
|
+
```
|
|
676
|
+
|
|
677
|
+
```bash packageManager="pnpm"
|
|
678
|
+
pnpm run build # Or pnpm run dev
|
|
679
|
+
```
|
|
680
|
+
|
|
681
|
+
```bash packageManager="yarn"
|
|
682
|
+
yarn build # Or yarn dev
|
|
683
|
+
```
|
|
684
|
+
|
|
685
|
+
```bash packageManager="bun"
|
|
686
|
+
bun run build # Or bun run dev
|
|
687
|
+
```
|
|
688
|
+
|
|
689
|
+
</Tab>
|
|
690
|
+
</Tabs>
|
|
691
|
+
|
|
533
692
|
---
|
|
534
693
|
|
|
535
694
|
## Configure TypeScript
|
|
@@ -593,6 +593,165 @@ export default defineConfig({
|
|
|
593
593
|
});
|
|
594
594
|
```
|
|
595
595
|
|
|
596
|
+
### (Optional) Step 11: Extract the content of your components
|
|
597
|
+
|
|
598
|
+
If you have an existing codebase, transforming thousands of files can be time-consuming.
|
|
599
|
+
|
|
600
|
+
To ease this process, Intlayer propose a [compiler](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en/compiler.md) / [extractor](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en/cli/extract.md) to transform your components and extract the content.
|
|
601
|
+
|
|
602
|
+
To set it up, you can add a `compiler` section in your `intlayer.config.ts` file:
|
|
603
|
+
|
|
604
|
+
```typescript fileName="intlayer.config.ts" codeFormat="typescript"
|
|
605
|
+
import { type IntlayerConfig } from "intlayer";
|
|
606
|
+
|
|
607
|
+
const config: IntlayerConfig = {
|
|
608
|
+
// ... Rest of your config
|
|
609
|
+
compiler: {
|
|
610
|
+
/**
|
|
611
|
+
* Indicates if the compiler should be enabled.
|
|
612
|
+
*/
|
|
613
|
+
enabled: true,
|
|
614
|
+
|
|
615
|
+
/**
|
|
616
|
+
* Defines the output files path
|
|
617
|
+
*/
|
|
618
|
+
output: ({ fileName, extension }) => `./${fileName}${extension}`,
|
|
619
|
+
|
|
620
|
+
/**
|
|
621
|
+
* Indicates if the components should be saved after being transformed.
|
|
622
|
+
* That way, the compiler can be run only once to transform the app, and then it can be removed.
|
|
623
|
+
*/
|
|
624
|
+
saveComponents: false,
|
|
625
|
+
|
|
626
|
+
/**
|
|
627
|
+
* Dictionary key prefix
|
|
628
|
+
*/
|
|
629
|
+
dictionaryKeyPrefix: "",
|
|
630
|
+
},
|
|
631
|
+
};
|
|
632
|
+
|
|
633
|
+
export default config;
|
|
634
|
+
```
|
|
635
|
+
|
|
636
|
+
```javascript fileName="intlayer.config.mjs" codeFormat="esm"
|
|
637
|
+
/** @type {import('intlayer').IntlayerConfig} */
|
|
638
|
+
const config = {
|
|
639
|
+
// ... Rest of your config
|
|
640
|
+
compiler: {
|
|
641
|
+
/**
|
|
642
|
+
* Indicates if the compiler should be enabled.
|
|
643
|
+
*/
|
|
644
|
+
enabled: true,
|
|
645
|
+
|
|
646
|
+
/**
|
|
647
|
+
* Defines the output files path
|
|
648
|
+
*/
|
|
649
|
+
output: ({ fileName, extension }) => `./${fileName}${extension}`,
|
|
650
|
+
|
|
651
|
+
/**
|
|
652
|
+
* Indicates if the components should be saved after being transformed.
|
|
653
|
+
* That way, the compiler can be run only once to transform the app, and then it can be removed.
|
|
654
|
+
*/
|
|
655
|
+
saveComponents: false,
|
|
656
|
+
|
|
657
|
+
/**
|
|
658
|
+
* Dictionary key prefix
|
|
659
|
+
*/
|
|
660
|
+
dictionaryKeyPrefix: "",
|
|
661
|
+
},
|
|
662
|
+
};
|
|
663
|
+
|
|
664
|
+
export default config;
|
|
665
|
+
```
|
|
666
|
+
|
|
667
|
+
```javascript fileName="intlayer.config.cjs" codeFormat="commonjs"
|
|
668
|
+
/** @type {import('intlayer').IntlayerConfig} */
|
|
669
|
+
const config = {
|
|
670
|
+
// ... Rest of your config
|
|
671
|
+
compiler: {
|
|
672
|
+
/**
|
|
673
|
+
* Indicates if the compiler should be enabled.
|
|
674
|
+
*/
|
|
675
|
+
enabled: true,
|
|
676
|
+
|
|
677
|
+
/**
|
|
678
|
+
* Defines the output files path
|
|
679
|
+
*/
|
|
680
|
+
output: ({ fileName, extension }) => `./${fileName}${extension}`,
|
|
681
|
+
|
|
682
|
+
/**
|
|
683
|
+
* Indicates if the components should be saved after being transformed.
|
|
684
|
+
* That way, the compiler can be run only once to transform the app, and then it can be removed.
|
|
685
|
+
*/
|
|
686
|
+
saveComponents: false,
|
|
687
|
+
|
|
688
|
+
/**
|
|
689
|
+
* Dictionary key prefix
|
|
690
|
+
*/
|
|
691
|
+
dictionaryKeyPrefix: "",
|
|
692
|
+
},
|
|
693
|
+
};
|
|
694
|
+
|
|
695
|
+
module.exports = config;
|
|
696
|
+
```
|
|
697
|
+
|
|
698
|
+
<Tabs>
|
|
699
|
+
<Tab value='Extract command'>
|
|
700
|
+
|
|
701
|
+
Run the extractor to transform your components and extract the content
|
|
702
|
+
|
|
703
|
+
```bash packageManager="npm"
|
|
704
|
+
npx intlayer extract
|
|
705
|
+
```
|
|
706
|
+
|
|
707
|
+
```bash packageManager="pnpm"
|
|
708
|
+
pnpm intlayer extract
|
|
709
|
+
```
|
|
710
|
+
|
|
711
|
+
```bash packageManager="yarn"
|
|
712
|
+
yarn intlayer extract
|
|
713
|
+
```
|
|
714
|
+
|
|
715
|
+
```bash packageManager="bun"
|
|
716
|
+
bunx intlayer extract
|
|
717
|
+
```
|
|
718
|
+
|
|
719
|
+
</Tab>
|
|
720
|
+
<Tab value='Babel compiler'>
|
|
721
|
+
|
|
722
|
+
Update your `vite.config.ts` to include the `intlayerCompiler` plugin:
|
|
723
|
+
|
|
724
|
+
```ts fileName="vite.config.ts"
|
|
725
|
+
import { defineConfig } from "vite";
|
|
726
|
+
import { intlayer, intlayerCompiler } from "vite-intlayer";
|
|
727
|
+
|
|
728
|
+
export default defineConfig({
|
|
729
|
+
plugins: [
|
|
730
|
+
intlayer(),
|
|
731
|
+
intlayerCompiler(), // Adds the compiler plugin
|
|
732
|
+
],
|
|
733
|
+
});
|
|
734
|
+
```
|
|
735
|
+
|
|
736
|
+
```bash packageManager="npm"
|
|
737
|
+
npm run build # Or npm run dev
|
|
738
|
+
```
|
|
739
|
+
|
|
740
|
+
```bash packageManager="pnpm"
|
|
741
|
+
pnpm run build # Or pnpm run dev
|
|
742
|
+
```
|
|
743
|
+
|
|
744
|
+
```bash packageManager="yarn"
|
|
745
|
+
yarn build # Or yarn dev
|
|
746
|
+
```
|
|
747
|
+
|
|
748
|
+
```bash packageManager="bun"
|
|
749
|
+
bun run build # Or bun run dev
|
|
750
|
+
```
|
|
751
|
+
|
|
752
|
+
</Tab>
|
|
753
|
+
</Tabs>
|
|
754
|
+
|
|
596
755
|
---
|
|
597
756
|
|
|
598
757
|
## Configure TypeScript
|