@intlayer/docs 7.2.2 → 7.3.0-canary.0
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 -0
- package/blog/ar/compiler_vs_declarative_i18n.md +138 -0
- package/blog/ar/intlayer_with_next-i18next.md +0 -1
- package/blog/ar/intlayer_with_vue-i18n.md +0 -1
- package/blog/de/compiler_vs_declarative_i18n.md +138 -0
- package/blog/de/intlayer_with_next-i18next.md +0 -1
- package/blog/de/intlayer_with_vue-i18n.md +0 -1
- package/blog/en/compiler_vs_declarative_i18n.md +138 -0
- package/blog/en/i18n_using_next-i18next.md +1 -1
- package/blog/en/i18n_using_next-intl.md +1 -1
- package/blog/en/intlayer_with_i18next.md +1 -1
- package/blog/en/intlayer_with_next-i18next.md +1 -2
- package/blog/en/intlayer_with_next-intl.md +1 -1
- package/blog/en/intlayer_with_react-i18next.md +1 -1
- package/blog/en/intlayer_with_react-intl.md +1 -1
- package/blog/en/intlayer_with_vue-i18n.md +1 -2
- package/blog/en-GB/compiler_vs_declarative_i18n.md +138 -0
- package/blog/en-GB/intlayer_with_next-i18next.md +0 -1
- package/blog/en-GB/intlayer_with_vue-i18n.md +0 -1
- package/blog/es/compiler_vs_declarative_i18n.md +138 -0
- package/blog/es/intlayer_with_next-i18next.md +0 -1
- package/blog/es/intlayer_with_vue-i18n.md +0 -1
- package/blog/fr/compiler_vs_declarative_i18n.md +138 -0
- package/blog/fr/intlayer_with_next-i18next.md +0 -1
- package/blog/fr/intlayer_with_vue-i18n.md +0 -1
- package/blog/hi/compiler_vs_declarative_i18n.md +138 -0
- package/blog/hi/intlayer_with_next-i18next.md +0 -1
- package/blog/hi/intlayer_with_vue-i18n.md +0 -1
- package/blog/id/compiler_vs_declarative_i18n.md +138 -0
- package/blog/id/intlayer_with_next-i18next.md +0 -1
- package/blog/id/intlayer_with_vue-i18n.md +0 -1
- package/blog/it/compiler_vs_declarative_i18n.md +138 -0
- package/blog/it/intlayer_with_next-i18next.md +0 -1
- package/blog/it/intlayer_with_vue-i18n.md +0 -1
- package/blog/ja/compiler_vs_declarative_i18n.md +138 -0
- package/blog/ja/intlayer_with_next-i18next.md +0 -1
- package/blog/ja/intlayer_with_vue-i18n.md +0 -1
- package/blog/ko/compiler_vs_declarative_i18n.md +138 -0
- package/blog/ko/intlayer_with_next-i18next.md +0 -1
- package/blog/ko/intlayer_with_vue-i18n.md +0 -1
- package/blog/pl/compiler_vs_declarative_i18n.md +138 -0
- package/blog/pl/intlayer_with_next-i18next.md +0 -1
- package/blog/pl/intlayer_with_vue-i18n.md +0 -1
- package/blog/pt/compiler_vs_declarative_i18n.md +138 -0
- package/blog/pt/intlayer_with_next-i18next.md +0 -1
- package/blog/pt/intlayer_with_vue-i18n.md +0 -1
- package/blog/ru/compiler_vs_declarative_i18n.md +138 -0
- package/blog/ru/intlayer_with_next-i18next.md +0 -1
- package/blog/ru/intlayer_with_vue-i18n.md +0 -1
- package/blog/tr/compiler_vs_declarative_i18n.md +138 -0
- package/blog/tr/intlayer_with_next-i18next.md +0 -1
- package/blog/tr/intlayer_with_vue-i18n.md +0 -1
- package/blog/vi/compiler_vs_declarative_i18n.md +138 -0
- package/blog/vi/intlayer_with_next-i18next.md +0 -1
- package/blog/vi/intlayer_with_vue-i18n.md +0 -1
- package/blog/zh/compiler_vs_declarative_i18n.md +138 -0
- package/blog/zh/intlayer_with_next-i18next.md +0 -1
- package/blog/zh/intlayer_with_vue-i18n.md +0 -1
- package/dist/cjs/generated/blog.entry.cjs +19 -0
- package/dist/cjs/generated/blog.entry.cjs.map +1 -1
- package/dist/cjs/generated/docs.entry.cjs +323 -19
- package/dist/cjs/generated/docs.entry.cjs.map +1 -1
- package/dist/esm/generated/blog.entry.mjs +19 -0
- package/dist/esm/generated/blog.entry.mjs.map +1 -1
- package/dist/esm/generated/docs.entry.mjs +323 -19
- package/dist/esm/generated/docs.entry.mjs.map +1 -1
- package/dist/types/generated/blog.entry.d.ts +1 -0
- package/dist/types/generated/blog.entry.d.ts.map +1 -1
- package/dist/types/generated/docs.entry.d.ts +17 -1
- package/dist/types/generated/docs.entry.d.ts.map +1 -1
- package/docs/ar/cli/build.md +64 -0
- package/docs/ar/cli/configuration.md +63 -0
- package/docs/ar/cli/debug.md +46 -0
- package/docs/ar/cli/doc-review.md +43 -0
- package/docs/ar/cli/doc-translate.md +132 -0
- package/docs/ar/cli/editor.md +28 -0
- package/docs/ar/cli/fill.md +130 -0
- package/docs/ar/cli/index.md +163 -0
- package/docs/ar/cli/list.md +53 -0
- package/docs/ar/cli/live.md +41 -0
- package/docs/ar/cli/pull.md +78 -0
- package/docs/ar/cli/push.md +98 -0
- package/docs/ar/cli/sdk.md +67 -0
- package/docs/ar/cli/test.md +76 -0
- package/docs/ar/cli/transform.md +65 -0
- package/docs/ar/cli/version.md +24 -0
- package/docs/ar/cli/watch.md +37 -0
- package/docs/ar/intlayer_with_svelte_kit.md +3 -2
- package/docs/ar/packages/intlayer/getPrefix.md +210 -0
- package/docs/de/cli/build.md +64 -0
- package/docs/de/cli/configuration.md +63 -0
- package/docs/de/cli/debug.md +46 -0
- package/docs/de/cli/doc-review.md +43 -0
- package/docs/de/cli/doc-translate.md +132 -0
- package/docs/de/cli/editor.md +28 -0
- package/docs/de/cli/fill.md +130 -0
- package/docs/de/cli/index.md +163 -0
- package/docs/de/cli/list.md +53 -0
- package/docs/de/cli/live.md +41 -0
- package/docs/de/cli/pull.md +78 -0
- package/docs/de/cli/push.md +98 -0
- package/docs/de/cli/sdk.md +67 -0
- package/docs/de/cli/test.md +76 -0
- package/docs/de/cli/transform.md +65 -0
- package/docs/de/cli/version.md +24 -0
- package/docs/de/cli/watch.md +37 -0
- package/docs/de/intlayer_with_svelte_kit.md +3 -2
- package/docs/de/packages/intlayer/getPrefix.md +213 -0
- package/docs/en/CI_CD.md +2 -2
- package/docs/en/autoFill.md +24 -2
- package/docs/en/cli/build.md +64 -0
- package/docs/en/cli/configuration.md +63 -0
- package/docs/en/cli/debug.md +46 -0
- package/docs/en/cli/doc-review.md +43 -0
- package/docs/en/cli/doc-translate.md +132 -0
- package/docs/en/cli/editor.md +28 -0
- package/docs/en/cli/fill.md +130 -0
- package/docs/en/cli/index.md +163 -0
- package/docs/en/cli/list.md +53 -0
- package/docs/en/cli/live.md +41 -0
- package/docs/en/cli/pull.md +78 -0
- package/docs/en/cli/push.md +98 -0
- package/docs/en/cli/sdk.md +67 -0
- package/docs/en/cli/test.md +76 -0
- package/docs/en/cli/transform.md +65 -0
- package/docs/en/cli/version.md +24 -0
- package/docs/en/cli/watch.md +37 -0
- package/docs/en/dictionary/condition.md +1 -1
- package/docs/en/dictionary/enumeration.md +1 -1
- package/docs/en/dictionary/file.md +1 -1
- package/docs/en/dictionary/gender.md +1 -1
- package/docs/en/dictionary/insertion.md +1 -1
- package/docs/en/dictionary/markdown.md +1 -1
- package/docs/en/dictionary/nesting.md +1 -1
- package/docs/en/index.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_create_react_app.md +1 -1
- package/docs/en/intlayer_with_lynx+react.md +1 -1
- package/docs/en/intlayer_with_next-i18next.md +1 -1
- package/docs/en/intlayer_with_next-intl.md +1 -1
- package/docs/en/intlayer_with_nextjs_14.md +1 -1
- package/docs/en/intlayer_with_nextjs_15.md +1 -1
- package/docs/en/intlayer_with_nextjs_16.md +1 -1
- package/docs/en/intlayer_with_nextjs_page_router.md +1 -1
- package/docs/en/intlayer_with_nuxt.md +1 -1
- package/docs/en/intlayer_with_react_native+expo.md +1 -1
- package/docs/en/intlayer_with_react_router_v7.md +1 -1
- package/docs/en/intlayer_with_svelte_kit.md +3 -2
- package/docs/en/intlayer_with_tanstack.md +1 -1
- package/docs/en/intlayer_with_vite+preact.md +1 -1
- package/docs/en/intlayer_with_vite+react.md +1 -1
- package/docs/en/intlayer_with_vite+solid.md +1 -1
- package/docs/en/intlayer_with_vite+svelte.md +1 -1
- package/docs/en/intlayer_with_vite+vue.md +1 -1
- package/docs/en/introduction.md +1 -1
- package/docs/en/mcp_server.md +1 -2
- package/docs/en/per_locale_file.md +1 -1
- package/docs/en/plugins/sync-json.md +1 -1
- package/docs/en/releases/v6.md +2 -2
- package/docs/en/roadmap.md +1 -1
- package/docs/en-GB/cli/build.md +64 -0
- package/docs/en-GB/cli/configuration.md +63 -0
- package/docs/en-GB/cli/debug.md +46 -0
- package/docs/en-GB/cli/doc-review.md +43 -0
- package/docs/en-GB/cli/doc-translate.md +132 -0
- package/docs/en-GB/cli/editor.md +28 -0
- package/docs/en-GB/cli/fill.md +130 -0
- package/docs/en-GB/cli/index.md +163 -0
- package/docs/en-GB/cli/list.md +53 -0
- package/docs/en-GB/cli/live.md +41 -0
- package/docs/en-GB/cli/pull.md +78 -0
- package/docs/en-GB/cli/push.md +98 -0
- package/docs/en-GB/cli/sdk.md +67 -0
- package/docs/en-GB/cli/test.md +100 -0
- package/docs/en-GB/cli/transform.md +65 -0
- package/docs/en-GB/cli/version.md +24 -0
- package/docs/en-GB/cli/watch.md +37 -0
- package/docs/en-GB/dictionary/condition.md +1 -1
- package/docs/en-GB/dictionary/markdown.md +1 -1
- package/docs/en-GB/dictionary/nesting.md +1 -1
- package/docs/en-GB/intlayer_with_nextjs_14.md +1 -1
- package/docs/en-GB/intlayer_with_react_native+expo.md +1 -1
- package/docs/en-GB/intlayer_with_svelte_kit.md +3 -2
- package/docs/en-GB/packages/intlayer/getPrefix.md +213 -0
- package/docs/es/cli/build.md +64 -0
- package/docs/es/cli/configuration.md +63 -0
- package/docs/es/cli/debug.md +46 -0
- package/docs/es/cli/doc-review.md +43 -0
- package/docs/es/cli/doc-translate.md +132 -0
- package/docs/es/cli/editor.md +28 -0
- package/docs/es/cli/fill.md +130 -0
- package/docs/es/cli/index.md +163 -0
- package/docs/es/cli/list.md +53 -0
- package/docs/es/cli/live.md +41 -0
- package/docs/es/cli/pull.md +78 -0
- package/docs/es/cli/push.md +98 -0
- package/docs/es/cli/sdk.md +67 -0
- package/docs/es/cli/test.md +76 -0
- package/docs/es/cli/transform.md +65 -0
- package/docs/es/cli/version.md +24 -0
- package/docs/es/cli/watch.md +37 -0
- package/docs/es/intlayer_with_svelte_kit.md +3 -2
- package/docs/es/packages/intlayer/getPrefix.md +213 -0
- package/docs/fr/cli/build.md +64 -0
- package/docs/fr/cli/configuration.md +63 -0
- package/docs/fr/cli/debug.md +46 -0
- package/docs/fr/cli/doc-review.md +43 -0
- package/docs/fr/cli/doc-translate.md +132 -0
- package/docs/fr/cli/editor.md +28 -0
- package/docs/fr/cli/fill.md +130 -0
- package/docs/fr/cli/index.md +163 -0
- package/docs/fr/cli/list.md +53 -0
- package/docs/fr/cli/live.md +41 -0
- package/docs/fr/cli/pull.md +78 -0
- package/docs/fr/cli/push.md +98 -0
- package/docs/fr/cli/sdk.md +67 -0
- package/docs/fr/cli/test.md +76 -0
- package/docs/fr/cli/transform.md +65 -0
- package/docs/fr/cli/version.md +24 -0
- package/docs/fr/cli/watch.md +37 -0
- package/docs/fr/intlayer_with_svelte_kit.md +3 -2
- package/docs/fr/packages/intlayer/getPrefix.md +213 -0
- package/docs/hi/cli/build.md +64 -0
- package/docs/hi/cli/configuration.md +63 -0
- package/docs/hi/cli/debug.md +46 -0
- package/docs/hi/cli/doc-review.md +43 -0
- package/docs/hi/cli/doc-translate.md +132 -0
- package/docs/hi/cli/editor.md +28 -0
- package/docs/hi/cli/fill.md +130 -0
- package/docs/hi/cli/index.md +163 -0
- package/docs/hi/cli/list.md +53 -0
- package/docs/hi/cli/live.md +41 -0
- package/docs/hi/cli/pull.md +78 -0
- package/docs/hi/cli/push.md +98 -0
- package/docs/hi/cli/sdk.md +67 -0
- package/docs/hi/cli/test.md +76 -0
- package/docs/hi/cli/transform.md +65 -0
- package/docs/hi/cli/version.md +24 -0
- package/docs/hi/cli/watch.md +37 -0
- package/docs/hi/intlayer_with_svelte_kit.md +3 -2
- package/docs/hi/intlayer_with_tanstack.md +1 -1
- package/docs/hi/intlayer_with_vite+solid.md +1 -1
- package/docs/hi/packages/intlayer/getPrefix.md +217 -0
- package/docs/id/cli/build.md +64 -0
- package/docs/id/cli/configuration.md +62 -0
- package/docs/id/cli/debug.md +46 -0
- package/docs/id/cli/doc-review.md +43 -0
- package/docs/id/cli/doc-translate.md +132 -0
- package/docs/id/cli/editor.md +28 -0
- package/docs/id/cli/fill.md +130 -0
- package/docs/id/cli/index.md +163 -0
- package/docs/id/cli/list.md +53 -0
- package/docs/id/cli/live.md +41 -0
- package/docs/id/cli/pull.md +78 -0
- package/docs/id/cli/push.md +98 -0
- package/docs/id/cli/sdk.md +67 -0
- package/docs/id/cli/test.md +76 -0
- package/docs/id/cli/transform.md +65 -0
- package/docs/id/cli/version.md +24 -0
- package/docs/id/cli/watch.md +37 -0
- package/docs/id/intlayer_with_svelte_kit.md +3 -2
- package/docs/id/packages/intlayer/getPrefix.md +210 -0
- package/docs/it/cli/build.md +64 -0
- package/docs/it/cli/configuration.md +63 -0
- package/docs/it/cli/debug.md +46 -0
- package/docs/it/cli/doc-review.md +43 -0
- package/docs/it/cli/doc-translate.md +132 -0
- package/docs/it/cli/editor.md +28 -0
- package/docs/it/cli/fill.md +130 -0
- package/docs/it/cli/index.md +158 -0
- package/docs/it/cli/list.md +53 -0
- package/docs/it/cli/live.md +41 -0
- package/docs/it/cli/pull.md +78 -0
- package/docs/it/cli/push.md +98 -0
- package/docs/it/cli/sdk.md +67 -0
- package/docs/it/cli/test.md +76 -0
- package/docs/it/cli/transform.md +65 -0
- package/docs/it/cli/version.md +24 -0
- package/docs/it/cli/watch.md +39 -0
- package/docs/it/intlayer_with_svelte_kit.md +3 -2
- package/docs/it/packages/intlayer/getPrefix.md +211 -0
- package/docs/ja/cli/build.md +78 -0
- package/docs/ja/cli/configuration.md +63 -0
- package/docs/ja/cli/debug.md +46 -0
- package/docs/ja/cli/doc-review.md +43 -0
- package/docs/ja/cli/doc-translate.md +132 -0
- package/docs/ja/cli/editor.md +28 -0
- package/docs/ja/cli/fill.md +130 -0
- package/docs/ja/cli/index.md +163 -0
- package/docs/ja/cli/list.md +53 -0
- package/docs/ja/cli/live.md +41 -0
- package/docs/ja/cli/pull.md +78 -0
- package/docs/ja/cli/push.md +113 -0
- package/docs/ja/cli/sdk.md +67 -0
- package/docs/ja/cli/test.md +76 -0
- package/docs/ja/cli/transform.md +65 -0
- package/docs/ja/cli/version.md +24 -0
- package/docs/ja/cli/watch.md +37 -0
- package/docs/ja/intlayer_with_svelte_kit.md +3 -2
- package/docs/ja/packages/intlayer/getPrefix.md +212 -0
- package/docs/ko/cli/build.md +64 -0
- package/docs/ko/cli/configuration.md +63 -0
- package/docs/ko/cli/debug.md +46 -0
- package/docs/ko/cli/doc-review.md +43 -0
- package/docs/ko/cli/doc-translate.md +132 -0
- package/docs/ko/cli/editor.md +28 -0
- package/docs/ko/cli/fill.md +130 -0
- package/docs/ko/cli/index.md +163 -0
- package/docs/ko/cli/list.md +53 -0
- package/docs/ko/cli/live.md +41 -0
- package/docs/ko/cli/pull.md +78 -0
- package/docs/ko/cli/push.md +113 -0
- package/docs/ko/cli/sdk.md +67 -0
- package/docs/ko/cli/test.md +76 -0
- package/docs/ko/cli/transform.md +65 -0
- package/docs/ko/cli/version.md +24 -0
- package/docs/ko/cli/watch.md +37 -0
- package/docs/ko/intlayer_with_svelte_kit.md +3 -2
- package/docs/ko/packages/intlayer/getPrefix.md +213 -0
- package/docs/pl/cli/build.md +64 -0
- package/docs/pl/cli/configuration.md +63 -0
- package/docs/pl/cli/debug.md +46 -0
- package/docs/pl/cli/doc-review.md +43 -0
- package/docs/pl/cli/doc-translate.md +132 -0
- package/docs/pl/cli/editor.md +28 -0
- package/docs/pl/cli/fill.md +130 -0
- package/docs/pl/cli/index.md +163 -0
- package/docs/pl/cli/list.md +53 -0
- package/docs/pl/cli/live.md +41 -0
- package/docs/pl/cli/pull.md +78 -0
- package/docs/pl/cli/push.md +98 -0
- package/docs/pl/cli/sdk.md +67 -0
- package/docs/pl/cli/test.md +76 -0
- package/docs/pl/cli/transform.md +65 -0
- package/docs/pl/cli/version.md +24 -0
- package/docs/pl/cli/watch.md +39 -0
- package/docs/pl/intlayer_with_svelte_kit.md +3 -2
- package/docs/pl/packages/intlayer/getPrefix.md +217 -0
- package/docs/pt/cli/build.md +64 -0
- package/docs/pt/cli/configuration.md +63 -0
- package/docs/pt/cli/debug.md +46 -0
- package/docs/pt/cli/doc-review.md +43 -0
- package/docs/pt/cli/doc-translate.md +132 -0
- package/docs/pt/cli/editor.md +28 -0
- package/docs/pt/cli/fill.md +130 -0
- package/docs/pt/cli/index.md +163 -0
- package/docs/pt/cli/list.md +53 -0
- package/docs/pt/cli/live.md +41 -0
- package/docs/pt/cli/pull.md +78 -0
- package/docs/pt/cli/push.md +98 -0
- package/docs/pt/cli/sdk.md +67 -0
- package/docs/pt/cli/test.md +76 -0
- package/docs/pt/cli/transform.md +65 -0
- package/docs/pt/cli/version.md +24 -0
- package/docs/pt/cli/watch.md +39 -0
- package/docs/pt/intlayer_with_svelte_kit.md +3 -2
- package/docs/pt/packages/intlayer/getPrefix.md +217 -0
- package/docs/ru/cli/build.md +64 -0
- package/docs/ru/cli/configuration.md +63 -0
- package/docs/ru/cli/debug.md +46 -0
- package/docs/ru/cli/doc-review.md +43 -0
- package/docs/ru/cli/doc-translate.md +132 -0
- package/docs/ru/cli/editor.md +28 -0
- package/docs/ru/cli/fill.md +130 -0
- package/docs/ru/cli/index.md +163 -0
- package/docs/ru/cli/list.md +53 -0
- package/docs/ru/cli/live.md +41 -0
- package/docs/ru/cli/pull.md +78 -0
- package/docs/ru/cli/push.md +98 -0
- package/docs/ru/cli/sdk.md +67 -0
- package/docs/ru/cli/test.md +76 -0
- package/docs/ru/cli/transform.md +65 -0
- package/docs/ru/cli/version.md +24 -0
- package/docs/ru/cli/watch.md +39 -0
- package/docs/ru/intlayer_with_svelte_kit.md +3 -2
- package/docs/ru/packages/intlayer/getPrefix.md +213 -0
- package/docs/tr/CI_CD.md +2 -2
- package/docs/tr/cli/build.md +64 -0
- package/docs/tr/cli/configuration.md +63 -0
- package/docs/tr/cli/debug.md +46 -0
- package/docs/tr/cli/doc-review.md +43 -0
- package/docs/tr/cli/doc-translate.md +132 -0
- package/docs/tr/cli/editor.md +28 -0
- package/docs/tr/cli/fill.md +130 -0
- package/docs/tr/cli/index.md +163 -0
- package/docs/tr/cli/list.md +53 -0
- package/docs/tr/cli/live.md +41 -0
- package/docs/tr/cli/pull.md +78 -0
- package/docs/tr/cli/push.md +98 -0
- package/docs/tr/cli/sdk.md +67 -0
- package/docs/tr/cli/test.md +76 -0
- package/docs/tr/cli/transform.md +65 -0
- package/docs/tr/cli/version.md +24 -0
- package/docs/tr/cli/watch.md +39 -0
- package/docs/tr/dictionary/condition.md +1 -1
- package/docs/tr/dictionary/enumeration.md +1 -1
- package/docs/tr/dictionary/file.md +1 -1
- package/docs/tr/dictionary/gender.md +1 -1
- package/docs/tr/dictionary/insertion.md +1 -1
- package/docs/tr/dictionary/markdown.md +1 -1
- package/docs/tr/dictionary/nesting.md +1 -1
- package/docs/tr/index.md +1 -1
- package/docs/tr/intlayer_with_angular.md +1 -1
- package/docs/tr/intlayer_with_create_react_app.md +1 -1
- package/docs/tr/intlayer_with_lynx+react.md +1 -1
- package/docs/tr/intlayer_with_nextjs_15.md +1 -1
- package/docs/tr/intlayer_with_nextjs_page_router.md +1 -1
- package/docs/tr/intlayer_with_nuxt.md +1 -1
- package/docs/tr/intlayer_with_react_native+expo.md +1 -1
- package/docs/tr/intlayer_with_svelte_kit.md +3 -2
- package/docs/tr/intlayer_with_vite+preact.md +1 -1
- package/docs/tr/intlayer_with_vite+react.md +1 -1
- package/docs/tr/intlayer_with_vite+solid.md +1 -1
- package/docs/tr/intlayer_with_vite+vue.md +1 -1
- package/docs/tr/introduction.md +1 -1
- package/docs/tr/mcp_server.md +1 -1
- package/docs/tr/packages/intlayer/getPrefix.md +213 -0
- package/docs/tr/per_locale_file.md +1 -1
- package/docs/tr/roadmap.md +1 -1
- package/docs/vi/cli/build.md +64 -0
- package/docs/vi/cli/configuration.md +63 -0
- package/docs/vi/cli/debug.md +46 -0
- package/docs/vi/cli/doc-review.md +43 -0
- package/docs/vi/cli/doc-translate.md +132 -0
- package/docs/vi/cli/editor.md +28 -0
- package/docs/vi/cli/fill.md +130 -0
- package/docs/vi/cli/index.md +163 -0
- package/docs/vi/cli/list.md +53 -0
- package/docs/vi/cli/live.md +41 -0
- package/docs/vi/cli/pull.md +78 -0
- package/docs/vi/cli/push.md +98 -0
- package/docs/vi/cli/sdk.md +67 -0
- package/docs/vi/cli/test.md +76 -0
- package/docs/vi/cli/transform.md +65 -0
- package/docs/vi/cli/version.md +24 -0
- package/docs/vi/cli/watch.md +37 -0
- package/docs/vi/intlayer_with_svelte_kit.md +3 -2
- package/docs/vi/packages/intlayer/getPrefix.md +213 -0
- package/docs/zh/cli/build.md +64 -0
- package/docs/zh/cli/configuration.md +63 -0
- package/docs/zh/cli/debug.md +46 -0
- package/docs/zh/cli/doc-review.md +43 -0
- package/docs/zh/cli/doc-translate.md +132 -0
- package/docs/zh/cli/editor.md +28 -0
- package/docs/zh/cli/fill.md +130 -0
- package/docs/zh/cli/index.md +168 -0
- package/docs/zh/cli/list.md +53 -0
- package/docs/zh/cli/live.md +41 -0
- package/docs/zh/cli/pull.md +78 -0
- package/docs/zh/cli/push.md +113 -0
- package/docs/zh/cli/sdk.md +67 -0
- package/docs/zh/cli/test.md +76 -0
- package/docs/zh/cli/transform.md +65 -0
- package/docs/zh/cli/version.md +24 -0
- package/docs/zh/cli/watch.md +37 -0
- package/docs/zh/intlayer_with_svelte_kit.md +3 -2
- package/docs/zh/packages/intlayer/getPrefix.md +213 -0
- package/package.json +7 -7
- package/src/generated/blog.entry.ts +19 -0
- package/src/generated/docs.entry.ts +323 -19
- package/docs/ar/intlayer_cli.md +0 -578
- package/docs/de/intlayer_cli.md +0 -579
- package/docs/en/intlayer_cli.md +0 -857
- package/docs/en-GB/intlayer_cli.md +0 -579
- package/docs/es/intlayer_cli.md +0 -578
- package/docs/fr/intlayer_cli.md +0 -578
- package/docs/hi/intlayer_cli.md +0 -580
- package/docs/id/intlayer_cli.md +0 -850
- package/docs/it/intlayer_cli.md +0 -574
- package/docs/ja/intlayer_cli.md +0 -580
- package/docs/ko/intlayer_cli.md +0 -578
- package/docs/pl/intlayer_cli.md +0 -857
- package/docs/pt/intlayer_cli.md +0 -579
- package/docs/ru/intlayer_cli.md +0 -849
- package/docs/tr/intlayer_cli.md +0 -578
- package/docs/vi/intlayer_cli.md +0 -850
- package/docs/zh/intlayer_cli.md +0 -577
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
---
|
|
2
|
+
createdAt: 2025-11-24
|
|
3
|
+
updatedAt: 2025-11-24
|
|
4
|
+
title: Compiler vs. Declarative i18n
|
|
5
|
+
description: Exploring the architectural trade-offs between "magic" compiler-based internationalisation and explicit declarative content management.
|
|
6
|
+
keywords:
|
|
7
|
+
- Intlayer
|
|
8
|
+
- Internationalisation
|
|
9
|
+
- Blog
|
|
10
|
+
- Next.js
|
|
11
|
+
- JavaScript
|
|
12
|
+
- React
|
|
13
|
+
- i18n
|
|
14
|
+
- Compiler
|
|
15
|
+
- Declarative
|
|
16
|
+
slugs:
|
|
17
|
+
- compiler-vs-declarative-i18n
|
|
18
|
+
- blog
|
|
19
|
+
- i18n
|
|
20
|
+
---
|
|
21
|
+
|
|
22
|
+
# The Case for and Against Compiler-Based i18n
|
|
23
|
+
|
|
24
|
+
If you have been building web applications for more than a decade, you know that Internationalisation (i18n) has always been a friction point. It is often the task no one wants to do—extracting strings, managing JSON files, and worrying about pluralisation rules.
|
|
25
|
+
|
|
26
|
+
Recently, a new wave of "Compiler-based" i18n tools has emerged, promising to make this pain disappear. The pitch is seductive: **Just write text in your components, and let the build tool handle the rest.** No keys, no imports, just magic.
|
|
27
|
+
|
|
28
|
+
But as with all abstractions in software engineering, magic comes with a price.
|
|
29
|
+
|
|
30
|
+
In this blog post, we will explore the shift from declarative libraries to compiler-based approaches, the hidden architectural debts they introduce, and why the "boring" way might still be the best way for professional applications.
|
|
31
|
+
|
|
32
|
+
## A Brief History of Translation
|
|
33
|
+
|
|
34
|
+
To understand where we are, we have to look back at where we started.
|
|
35
|
+
|
|
36
|
+
Around 2011–2012, the JavaScript landscape was vastly different. Bundlers as we know them (Webpack, Vite) did not exist or were in their infancy. We were gluing scripts together in the browser. In this era, libraries like **i18next** were born.
|
|
37
|
+
|
|
38
|
+
They solved the problem the only way possible at the time: **Runtime Dictionaries**. You loaded a massive JSON object into memory, and a function looked up keys on the fly. It was reliable, explicit, and worked everywhere.
|
|
39
|
+
|
|
40
|
+
Fast forward to today. We have powerful compilers (SWC, Rust-based bundlers) that can parse Abstract Syntax Trees (AST) in milliseconds. This power gave birth to a new idea: _Why are we manually managing keys? Why can't the compiler just see the text "Hello World" and swap it out for us?_
|
|
41
|
+
|
|
42
|
+
Thus, Compiler-based i18n was born.
|
|
43
|
+
|
|
44
|
+
## The Allure of the Compiler (The "Magic" Approach)
|
|
45
|
+
|
|
46
|
+
There is a reason this new approach is trending. For a developer, the experience feels incredible.
|
|
47
|
+
|
|
48
|
+
### 1. Speed and "Flow"
|
|
49
|
+
|
|
50
|
+
When you are in the zone, stopping to think of a variable name (`home_hero_title_v2`) breaks your flow. With a compiler approach, you type `<p>Welcome back</p>` and keep moving. The friction is zero.
|
|
51
|
+
|
|
52
|
+
### 2. The Legacy Rescue Mission
|
|
53
|
+
|
|
54
|
+
Imagine inheriting a massive codebase with 5,000 components and zero translations. Retrofitting this with a manual key-based system is a months-long nightmare. A compiler-based tool acts as a rescue strategy, instantly extracting thousands of strings without you needing to touch a single file manually.
|
|
55
|
+
|
|
56
|
+
### 3. The AI Era
|
|
57
|
+
|
|
58
|
+
This is a modern benefit we shouldn't overlook. AI coding assistants (like Copilot or ChatGPT) naturally generate standard JSX/HTML. They don't know your specific translation key schema.
|
|
59
|
+
|
|
60
|
+
- **Declarative:** You have to rewrite the AI's output to replace text with keys.
|
|
61
|
+
- **Compiler:** You copy-paste the AI's code, and it just works.
|
|
62
|
+
|
|
63
|
+
## The Reality Check: Why "Magic" is Dangerous
|
|
64
|
+
|
|
65
|
+
While the "magic" is appealing, the abstraction leaks. Relying on a build tool to understand human intent introduces architectural fragility.
|
|
66
|
+
|
|
67
|
+
### 1. Heuristic Fragility (The Guessing Game)
|
|
68
|
+
|
|
69
|
+
The compiler has to guess what is content and what is code.
|
|
70
|
+
|
|
71
|
+
- Does `className="active"` get translated? It's a string.
|
|
72
|
+
- Does `status="pending"` get translated?
|
|
73
|
+
- Does `<MyComponent errorMessage="An error occurred" />` get translated?
|
|
74
|
+
- Does a product ID like `"AX-99"` get translated?
|
|
75
|
+
|
|
76
|
+
You inevitably end up "fighting" the compiler, adding specific comments (like `// ignore-translation`) to prevent it from breaking your application logic.
|
|
77
|
+
|
|
78
|
+
### 2. The Dynamic Data Hard Limit
|
|
79
|
+
|
|
80
|
+
Compiler extraction relies on **static analysis**. It must see the literal string in your code to generate a stable ID.
|
|
81
|
+
If your API returns an error code string like `server_error`, you cannot translate it with a compiler because the compiler doesn't know that string exists at build time. You are forced to build a secondary "runtime-only" system just for dynamic data.
|
|
82
|
+
|
|
83
|
+
### 3. "Chunk Explosion" and Network Waterfalls
|
|
84
|
+
|
|
85
|
+
To allow for tree-shaking, compiler tools often split translations per component.
|
|
86
|
+
|
|
87
|
+
- **The Consequence:** A single page view with 50 small components might trigger **50 separate HTTP requests** for tiny translation fragments. Even with HTTP/2, this creates a network waterfall that makes your application feel sluggish compared to loading a single, optimised language bundle.
|
|
88
|
+
|
|
89
|
+
### 4. Runtime Performance Overhead
|
|
90
|
+
|
|
91
|
+
To make translations reactive (so they update instantly when you switch languages), the compiler often injects state management hooks into _every_ component.
|
|
92
|
+
|
|
93
|
+
- **The Cost:** If you render a list of 5,000 items, you are initialising 5,000 `useState` and `useEffect` hooks solely for text. This consumes memory and CPU cycles that declarative libraries (which typically use a single Context provider) save.
|
|
94
|
+
|
|
95
|
+
## The Trap: Vendor Lock-in
|
|
96
|
+
|
|
97
|
+
This is arguably the most dangerous aspect of compiler-based i18n.
|
|
98
|
+
|
|
99
|
+
In a declarative library, your source code contains explicit intent. You own the keys. If you switch libraries, you just change the import.
|
|
100
|
+
|
|
101
|
+
In a compiler-based approach, **your source code is just English text.** The "translation logic" only exists inside the build plugin's configuration.
|
|
102
|
+
If that library stops being maintained, or if you outgrow it, you are stuck. You cannot "eject" easily because you have zero translation keys in your source code. You would have to manually rewrite your entire application to migrate away.
|
|
103
|
+
|
|
104
|
+
## The Other Side: Risks of the Declarative Approach
|
|
105
|
+
|
|
106
|
+
To be fair, the traditional declarative way isn't perfect either. It has its own set of "footguns."
|
|
107
|
+
|
|
108
|
+
1. **Namespace Hell:** You often have to manually manage which JSON files to load (`common.json`, `dashboard.json`, `footer.json`). If you forget one, the user sees raw keys.
|
|
109
|
+
2. **Over-fetching:** Without careful configuration, it is very easy to accidentally load _all_ your translation keys for _all_ pages on the initial load, bloating your bundle size.
|
|
110
|
+
3. **Sync Drift:** It is common for keys to remain in the JSON file long after the component using them has been deleted. Your translation files grow indefinitely, filled with "zombie keys."
|
|
111
|
+
|
|
112
|
+
## The Intlayer Middle Ground
|
|
113
|
+
|
|
114
|
+
This is where tools like **Intlayer** are trying to innovate. Intlayer understands that while compilers are powerful, implicit magic is dangerous.
|
|
115
|
+
|
|
116
|
+
Intlayer offers a unique **`transform` command`**. Instead of just doing magic in the hidden build step, it can actually **rewrite your component code**. It scans your text and replaces it with explicit content declarations in your codebase.
|
|
117
|
+
|
|
118
|
+
This gives you the best of both worlds:
|
|
119
|
+
|
|
120
|
+
1. **Granularity:** You keep your translations close to your components (improving modularity and tree-shaking).
|
|
121
|
+
2. **Safety:** The translation becomes explicit code, not hidden build-time magic.
|
|
122
|
+
3. **No Lock-in:** Since the code is transformed into a standard declarative structure within your repo, you aren't hiding logic in a webpack plugin.
|
|
123
|
+
|
|
124
|
+
## Conclusion
|
|
125
|
+
|
|
126
|
+
So, which should you choose?
|
|
127
|
+
|
|
128
|
+
**If you are a Junior Developer, a Solo Founder, or building an MVP:**
|
|
129
|
+
The compiler-based approach is a valid choice. It allows you to move incredibly fast. You don't need to worry about file structures or keys. You just build. The technical debt is a problem for "Future You."
|
|
130
|
+
|
|
131
|
+
**If you are building a Professional, Enterprise-Grade Application:**
|
|
132
|
+
Magic is generally a bad idea. You need control.
|
|
133
|
+
|
|
134
|
+
- You need to handle dynamic data from backends.
|
|
135
|
+
- You need to ensure performance on low-end devices (avoiding hook explosions).
|
|
136
|
+
- You need to ensure you aren't locked into a specific build tool forever.
|
|
137
|
+
|
|
138
|
+
For professional apps, **Declarative Content Management** (like Intlayer or established libraries) remains the gold standard. It separates your concerns, keeps your architecture clean, and ensures that your application's ability to speak multiple languages isn't dependent on a "black box" compiler guessing your intentions.
|
|
@@ -186,7 +186,6 @@ Exclude generated files from version control:
|
|
|
186
186
|
```plaintext fileName=".gitignore"
|
|
187
187
|
# Ignore files generated by Intlayer
|
|
188
188
|
.intlayer
|
|
189
|
-
intl
|
|
190
189
|
```
|
|
191
190
|
|
|
192
191
|
These files are automatically regenerated during the build process and do not need to be committed to your repository.
|
|
@@ -175,7 +175,6 @@ Exclude generated files from version control:
|
|
|
175
175
|
```plaintext fileName=".gitignore"
|
|
176
176
|
# Ignore files generated by Intlayer
|
|
177
177
|
.intlayer
|
|
178
|
-
intl
|
|
179
178
|
```
|
|
180
179
|
|
|
181
180
|
These files are automatically regenerated during the build process and do not need to be committed to your repository.
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
---
|
|
2
|
+
createdAt: 2025-11-24
|
|
3
|
+
updatedAt: 2025-11-24
|
|
4
|
+
title: Compilador vs. i18n Declarativo
|
|
5
|
+
description: Explorando los compromisos arquitectónicos entre la internacionalización "mágica" basada en compiladores y la gestión explícita y declarativa de contenido.
|
|
6
|
+
keywords:
|
|
7
|
+
- Intlayer
|
|
8
|
+
- Internacionalización
|
|
9
|
+
- Blog
|
|
10
|
+
- Next.js
|
|
11
|
+
- JavaScript
|
|
12
|
+
- React
|
|
13
|
+
- i18n
|
|
14
|
+
- Compilador
|
|
15
|
+
- Declarativo
|
|
16
|
+
slugs:
|
|
17
|
+
- compiler-vs-declarative-i18n
|
|
18
|
+
- blog
|
|
19
|
+
- i18n
|
|
20
|
+
---
|
|
21
|
+
|
|
22
|
+
# El Caso a Favor y en Contra de la i18n Basada en Compiladores
|
|
23
|
+
|
|
24
|
+
Si has estado desarrollando aplicaciones web por más de una década, sabes que la Internacionalización (i18n) siempre ha sido un punto de fricción. A menudo es la tarea que nadie quiere hacer: extraer cadenas, gestionar archivos JSON y preocuparse por las reglas de pluralización.
|
|
25
|
+
|
|
26
|
+
Recientemente, ha surgido una nueva ola de herramientas de i18n "basadas en compiladores", que prometen hacer desaparecer este dolor. La propuesta es seductora: **Simplemente escribe texto en tus componentes y deja que la herramienta de compilación se encargue del resto.** Sin claves, sin importaciones, solo magia.
|
|
27
|
+
|
|
28
|
+
Pero como con todas las abstracciones en la ingeniería de software, la magia tiene un precio.
|
|
29
|
+
|
|
30
|
+
En esta publicación del blog, exploraremos el cambio de bibliotecas declarativas a enfoques basados en compiladores, las deudas arquitectónicas ocultas que introducen y por qué la forma "aburrida" podría seguir siendo la mejor para aplicaciones profesionales.
|
|
31
|
+
|
|
32
|
+
## Una Breve Historia de la Traducción
|
|
33
|
+
|
|
34
|
+
Para entender dónde estamos, tenemos que mirar hacia atrás y ver dónde empezamos.
|
|
35
|
+
|
|
36
|
+
Alrededor de 2011–2012, el panorama de JavaScript era muy diferente. Los bundlers tal como los conocemos (Webpack, Vite) no existían o estaban en sus inicios. Estábamos pegando scripts directamente en el navegador. En esta era, nacieron bibliotecas como **i18next**.
|
|
37
|
+
|
|
38
|
+
Resolvieron el problema de la única manera posible en ese momento: **Diccionarios en tiempo de ejecución**. Cargabas un objeto JSON masivo en memoria, y una función buscaba las claves al vuelo. Era confiable, explícito y funcionaba en todas partes.
|
|
39
|
+
|
|
40
|
+
Avanzando hasta hoy. Contamos con compiladores potentes (SWC, bundlers basados en Rust) que pueden analizar Árboles de Sintaxis Abstracta (AST) en milisegundos. Este poder dio origen a una nueva idea: _¿Por qué gestionamos las claves manualmente? ¿Por qué el compilador no puede simplemente ver el texto "Hello World" y reemplazarlo por nosotros?_
|
|
41
|
+
|
|
42
|
+
Así nació la i18n basada en compiladores.
|
|
43
|
+
|
|
44
|
+
## El Atractivo del Compilador (El Enfoque "Mágico")
|
|
45
|
+
|
|
46
|
+
Hay una razón por la cual este nuevo enfoque está en tendencia. Para un desarrollador, la experiencia se siente increíble.
|
|
47
|
+
|
|
48
|
+
### 1. Velocidad y "Flujo"
|
|
49
|
+
|
|
50
|
+
Cuando estás concentrado, detenerte a pensar en un nombre de variable (`home_hero_title_v2`) rompe tu flujo. Con un enfoque basado en compilador, escribes `<p>Welcome back</p>` y sigues adelante. La fricción es cero.
|
|
51
|
+
|
|
52
|
+
### 2. La Misión de Rescate del Legado
|
|
53
|
+
|
|
54
|
+
Imagina heredar una base de código masiva con 5,000 componentes y cero traducciones. Adaptar esto con un sistema manual basado en claves es una pesadilla que puede durar meses. Una herramienta basada en compilador actúa como una estrategia de rescate, extrayendo instantáneamente miles de cadenas sin que necesites tocar un solo archivo manualmente.
|
|
55
|
+
|
|
56
|
+
### 3. La Era de la IA
|
|
57
|
+
|
|
58
|
+
Este es un beneficio moderno que no deberíamos pasar por alto. Los asistentes de codificación con IA (como Copilot o ChatGPT) generan naturalmente JSX/HTML estándar. No conocen tu esquema específico de claves de traducción.
|
|
59
|
+
|
|
60
|
+
- **Declarativo:** Tienes que reescribir la salida de la IA para reemplazar el texto con claves.
|
|
61
|
+
- **Compilador:** Copias y pegas el código de la IA, y simplemente funciona.
|
|
62
|
+
|
|
63
|
+
## La Verificación de la Realidad: Por Qué la "Magia" es Peligrosa
|
|
64
|
+
|
|
65
|
+
Aunque la "magia" es atractiva, la abstracción tiene fugas. Confiar en una herramienta de compilación para entender la intención humana introduce fragilidad arquitectónica.
|
|
66
|
+
|
|
67
|
+
### 1. Fragilidad Heurística (El Juego de Adivinar)
|
|
68
|
+
|
|
69
|
+
El compilador tiene que adivinar qué es contenido y qué es código.
|
|
70
|
+
|
|
71
|
+
- ¿Se traduce `className="active"`? Es una cadena.
|
|
72
|
+
- ¿Se traduce `status="pending"`?
|
|
73
|
+
- ¿Se traduce `<MyComponent errorMessage="An error occurred" />`?
|
|
74
|
+
- ¿Se traduce un ID de producto como `"AX-99"`?
|
|
75
|
+
|
|
76
|
+
Inevitablemente terminas "peleando" con el compilador, añadiendo comentarios específicos (como `// ignore-translation`) para evitar que rompa la lógica de tu aplicación.
|
|
77
|
+
|
|
78
|
+
### 2. El Límite Rígido de los Datos Dinámicos
|
|
79
|
+
|
|
80
|
+
La extracción del compilador se basa en **análisis estático**. Debe ver la cadena literal en tu código para generar un ID estable.
|
|
81
|
+
Si tu API devuelve un código de error como `server_error`, no puedes traducirlo con un compilador porque este no sabe que esa cadena existe en tiempo de compilación. Te ves obligado a construir un sistema secundario "solo en tiempo de ejecución" solo para datos dinámicos.
|
|
82
|
+
|
|
83
|
+
### 3. "Explosión de Chunks" y Cascadas en la Red
|
|
84
|
+
|
|
85
|
+
Para permitir el tree-shaking, las herramientas del compilador a menudo dividen las traducciones por componente.
|
|
86
|
+
|
|
87
|
+
- **La consecuencia:** Una vista de página única con 50 componentes pequeños podría desencadenar **50 solicitudes HTTP separadas** para pequeños fragmentos de traducción. Incluso con HTTP/2, esto crea una cascada de red que hace que tu aplicación se sienta lenta en comparación con cargar un único paquete de idioma optimizado.
|
|
88
|
+
|
|
89
|
+
### 4. Sobrecarga de rendimiento en tiempo de ejecución
|
|
90
|
+
|
|
91
|
+
Para hacer que las traducciones sean reactivas (para que se actualicen instantáneamente cuando cambias de idioma), el compilador a menudo inyecta hooks de gestión de estado en _cada_ componente.
|
|
92
|
+
|
|
93
|
+
- **El costo:** Si renderizas una lista de 5,000 elementos, estás inicializando 5,000 hooks `useState` y `useEffect` únicamente para el texto. Esto consume memoria y ciclos de CPU que las librerías declarativas (que típicamente usan un único proveedor de Context) ahorran.
|
|
94
|
+
|
|
95
|
+
## La trampa: Vendor Lock-in
|
|
96
|
+
|
|
97
|
+
Este es, sin duda, el aspecto más peligroso de la i18n basada en compiladores.
|
|
98
|
+
|
|
99
|
+
En una librería declarativa, tu código fuente contiene la intención explícita. Tú posees las claves. Si cambias de librería, solo cambias la importación.
|
|
100
|
+
|
|
101
|
+
En un enfoque basado en compiladores, **tu código fuente es solo texto en inglés.** La "lógica de traducción" solo existe dentro de la configuración del plugin de compilación.
|
|
102
|
+
Si esa biblioteca deja de mantenerse, o si la superas, quedas atrapado. No puedes "expulsar" fácilmente porque no tienes ninguna clave de traducción en tu código fuente. Tendrías que reescribir manualmente toda tu aplicación para migrar.
|
|
103
|
+
|
|
104
|
+
## El Otro Lado: Riesgos del Enfoque Declarativo
|
|
105
|
+
|
|
106
|
+
Para ser justos, la forma declarativa tradicional tampoco es perfecta. Tiene su propio conjunto de "peligros".
|
|
107
|
+
|
|
108
|
+
1. **Infierno de Espacios de Nombres:** A menudo tienes que gestionar manualmente qué archivos JSON cargar (`common.json`, `dashboard.json`, `footer.json`). Si olvidas uno, el usuario ve las claves sin procesar.
|
|
109
|
+
2. **Sobre-carga de Datos:** Sin una configuración cuidadosa, es muy fácil cargar accidentalmente _todas_ tus claves de traducción para _todas_ las páginas en la carga inicial, inflando el tamaño de tu paquete.
|
|
110
|
+
3. **Deriva de sincronización:** Es común que las claves permanezcan en el archivo JSON mucho después de que el componente que las usaba haya sido eliminado. Tus archivos de traducción crecen indefinidamente, llenos de "claves zombis".
|
|
111
|
+
|
|
112
|
+
## El punto medio de Intlayer
|
|
113
|
+
|
|
114
|
+
Aquí es donde herramientas como **Intlayer** están intentando innovar. Intlayer entiende que, aunque los compiladores son poderosos, la magia implícita es peligrosa.
|
|
115
|
+
|
|
116
|
+
Intlayer ofrece un comando único **`transform`**. En lugar de hacer magia solo en el paso oculto de compilación, puede realmente **reescribir el código de tu componente**. Escanea tu texto y lo reemplaza con declaraciones explícitas de contenido en tu base de código.
|
|
117
|
+
|
|
118
|
+
Esto te da lo mejor de ambos mundos:
|
|
119
|
+
|
|
120
|
+
1. **Granularidad:** Mantienes tus traducciones cerca de tus componentes (mejorando la modularidad y el tree-shaking).
|
|
121
|
+
2. **Seguridad:** La traducción se convierte en código explícito, no en magia oculta en tiempo de compilación.
|
|
122
|
+
3. **Sin dependencia:** Dado que el código se transforma en una estructura declarativa estándar dentro de tu repositorio, no estás ocultando lógica en un plugin de webpack.
|
|
123
|
+
|
|
124
|
+
## Conclusión
|
|
125
|
+
|
|
126
|
+
Entonces, ¿cuál deberías elegir?
|
|
127
|
+
|
|
128
|
+
**Si eres un desarrollador junior, un fundador en solitario o estás construyendo un MVP:**
|
|
129
|
+
El enfoque basado en compiladores es una opción válida. Te permite avanzar increíblemente rápido. No necesitas preocuparte por la estructura de archivos o las claves. Simplemente construyes. La deuda técnica es un problema para el "Tú del futuro".
|
|
130
|
+
|
|
131
|
+
**Si estás construyendo una aplicación profesional, de nivel empresarial:**
|
|
132
|
+
La magia generalmente es una mala idea. Necesitas control.
|
|
133
|
+
|
|
134
|
+
- Necesitas manejar datos dinámicos desde backends.
|
|
135
|
+
- Necesitas asegurar el rendimiento en dispositivos de gama baja (evitando explosiones de hooks).
|
|
136
|
+
- Necesitas asegurarte de no quedar atrapado para siempre en una herramienta de construcción específica.
|
|
137
|
+
|
|
138
|
+
Para aplicaciones profesionales, la **Gestión Declarativa de Contenidos** (como Intlayer o bibliotecas establecidas) sigue siendo el estándar de oro. Separa tus preocupaciones, mantiene tu arquitectura limpia y garantiza que la capacidad de tu aplicación para hablar múltiples idiomas no dependa de un compilador "caja negra" que adivine tus intenciones.
|
|
@@ -176,7 +176,6 @@ Excluye los archivos generados del control de versiones:
|
|
|
176
176
|
```plaintext fileName=".gitignore"
|
|
177
177
|
# Ignorar archivos generados por Intlayer
|
|
178
178
|
.intlayer
|
|
179
|
-
intl
|
|
180
179
|
```
|
|
181
180
|
|
|
182
181
|
Estos archivos se regeneran automáticamente durante el proceso de compilación y no necesitan ser confirmados en tu repositorio.
|
|
@@ -166,7 +166,6 @@ Excluye los archivos generados del control de versiones:
|
|
|
166
166
|
```plaintext fileName=".gitignore"
|
|
167
167
|
# Ignorar archivos generados por Intlayer
|
|
168
168
|
.intlayer
|
|
169
|
-
intl
|
|
170
169
|
```
|
|
171
170
|
|
|
172
171
|
Estos archivos se regeneran automáticamente durante el proceso de compilación y no necesitan ser comprometidos en tu repositorio.
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
---
|
|
2
|
+
createdAt: 2025-11-24
|
|
3
|
+
updatedAt: 2025-11-24
|
|
4
|
+
title: Compilateur vs. i18n déclaratif
|
|
5
|
+
description: Exploration des compromis architecturaux entre l'internationalisation "magique" basée sur un compilateur et la gestion explicite et déclarative du contenu.
|
|
6
|
+
keywords:
|
|
7
|
+
- Intlayer
|
|
8
|
+
- Internationalisation
|
|
9
|
+
- Blog
|
|
10
|
+
- Next.js
|
|
11
|
+
- JavaScript
|
|
12
|
+
- React
|
|
13
|
+
- i18n
|
|
14
|
+
- Compilateur
|
|
15
|
+
- Déclaratif
|
|
16
|
+
slugs:
|
|
17
|
+
- compiler-vs-declarative-i18n
|
|
18
|
+
- blog
|
|
19
|
+
- i18n
|
|
20
|
+
---
|
|
21
|
+
|
|
22
|
+
# Les arguments pour et contre l’i18n basée sur un compilateur
|
|
23
|
+
|
|
24
|
+
Si vous développez des applications web depuis plus d’une décennie, vous savez que l’internationalisation (i18n) a toujours été un point de friction. C’est souvent la tâche que personne ne veut faire : extraire les chaînes, gérer les fichiers JSON, et se soucier des règles de pluriel.
|
|
25
|
+
|
|
26
|
+
Récemment, une nouvelle vague d’outils i18n « basés sur un compilateur » a émergé, promettant de faire disparaître cette douleur. L’argument est séduisant : **Il suffit d’écrire le texte dans vos composants, et laissez l’outil de build gérer le reste.** Pas de clés, pas d’importations, juste de la magie.
|
|
27
|
+
|
|
28
|
+
Mais comme pour toutes les abstractions en ingénierie logicielle, la magie a un prix.
|
|
29
|
+
|
|
30
|
+
Dans cet article de blog, nous allons explorer le passage des bibliothèques déclaratives aux approches basées sur un compilateur, les dettes architecturales cachées qu’elles introduisent, et pourquoi la méthode « ennuyeuse » pourrait encore être la meilleure pour les applications professionnelles.
|
|
31
|
+
|
|
32
|
+
## Une brève histoire de la traduction
|
|
33
|
+
|
|
34
|
+
Pour comprendre où nous en sommes, il faut revenir à nos débuts.
|
|
35
|
+
|
|
36
|
+
Vers 2011–2012, le paysage JavaScript était très différent. Les bundlers tels que nous les connaissons (Webpack, Vite) n’existaient pas ou étaient à leurs débuts. Nous collions les scripts ensemble dans le navigateur. C’est à cette époque que des bibliothèques comme **i18next** sont nées.
|
|
37
|
+
|
|
38
|
+
Elles ont résolu le problème de la seule manière possible à l’époque : les **Dictionnaires à l’exécution**. Vous chargiez un énorme objet JSON en mémoire, et une fonction recherchait les clés à la volée. C’était fiable, explicite, et fonctionnait partout.
|
|
39
|
+
|
|
40
|
+
Avançons jusqu’à aujourd’hui. Nous disposons de compilateurs puissants (SWC, bundlers basés sur Rust) capables d’analyser des arbres de syntaxe abstraite (AST) en quelques millisecondes. Cette puissance a donné naissance à une nouvelle idée : _Pourquoi gérer manuellement les clés ? Pourquoi le compilateur ne pourrait-il pas simplement voir le texte "Hello World" et le remplacer pour nous ?_
|
|
41
|
+
|
|
42
|
+
Ainsi est née l’i18n basée sur un compilateur.
|
|
43
|
+
|
|
44
|
+
## L’Attrait du Compilateur (L’Approche "Magique")
|
|
45
|
+
|
|
46
|
+
Il y a une raison pour laquelle cette nouvelle approche est tendance. Pour un développeur, l’expérience est incroyable.
|
|
47
|
+
|
|
48
|
+
### 1. Vitesse et "Flow"
|
|
49
|
+
|
|
50
|
+
Quand vous êtes dans votre zone, vous arrêter pour réfléchir à un nom de variable (`home_hero_title_v2`) casse votre flow. Avec une approche compilateur, vous tapez `<p>Welcome back</p>` et continuez. La friction est nulle.
|
|
51
|
+
|
|
52
|
+
### 2. La Mission de Sauvetage du Legacy
|
|
53
|
+
|
|
54
|
+
Imaginez hériter d’une énorme base de code avec 5 000 composants et aucune traduction. Adapter cela avec un système manuel basé sur des clés est un cauchemar qui dure des mois. Un outil basé sur un compilateur agit comme une stratégie de sauvetage, extrayant instantanément des milliers de chaînes sans que vous ayez besoin de toucher un seul fichier manuellement.
|
|
55
|
+
|
|
56
|
+
### 3. L’Ère de l’IA
|
|
57
|
+
|
|
58
|
+
C’est un avantage moderne qu’il ne faut pas négliger. Les assistants de codage IA (comme Copilot ou ChatGPT) génèrent naturellement du JSX/HTML standard. Ils ne connaissent pas votre schéma spécifique de clés de traduction.
|
|
59
|
+
|
|
60
|
+
- **Déclaratif :** Vous devez réécrire la sortie de l’IA pour remplacer le texte par des clés.
|
|
61
|
+
- **Compilateur :** Vous copiez-collez le code de l’IA, et ça fonctionne tout simplement.
|
|
62
|
+
|
|
63
|
+
## La Réalité : Pourquoi la "Magie" est Dangereuse
|
|
64
|
+
|
|
65
|
+
Bien que la "magie" soit séduisante, l’abstraction fuit. Compter sur un outil de build pour comprendre l’intention humaine introduit une fragilité architecturale.
|
|
66
|
+
|
|
67
|
+
### 1. Fragilité Heuristique (Le Jeu de Deviner)
|
|
68
|
+
|
|
69
|
+
Le compilateur doit deviner ce qui est contenu et ce qui est code.
|
|
70
|
+
|
|
71
|
+
- Est-ce que `className="active"` est traduit ? C’est une chaîne de caractères.
|
|
72
|
+
- Est-ce que `status="pending"` est traduit ?
|
|
73
|
+
- Est-ce que `<MyComponent errorMessage="An error occurred" />` est traduit ?
|
|
74
|
+
- Est-ce qu’un identifiant produit comme `"AX-99"` est traduit ?
|
|
75
|
+
|
|
76
|
+
Vous finissez inévitablement par « lutter » contre le compilateur, en ajoutant des commentaires spécifiques (comme `// ignore-translation`) pour l’empêcher de casser la logique de votre application.
|
|
77
|
+
|
|
78
|
+
### 2. La limite stricte des données dynamiques
|
|
79
|
+
|
|
80
|
+
L’extraction par le compilateur repose sur une **analyse statique**. Il doit voir la chaîne littérale dans votre code pour générer un ID stable.
|
|
81
|
+
Si votre API renvoie une chaîne de code d’erreur comme `server_error`, vous ne pouvez pas la traduire avec un compilateur car celui-ci ne connaît pas cette chaîne au moment de la compilation. Vous êtes obligé de construire un système secondaire « runtime-only » uniquement pour les données dynamiques.
|
|
82
|
+
|
|
83
|
+
### 3. « Explosion des chunks » et cascades réseau
|
|
84
|
+
|
|
85
|
+
Pour permettre le tree-shaking, les outils de compilation divisent souvent les traductions par composant.
|
|
86
|
+
|
|
87
|
+
- **La conséquence :** Une seule vue de page avec 50 petits composants peut déclencher **50 requêtes HTTP distinctes** pour de petits fragments de traduction. Même avec HTTP/2, cela crée un effet de cascade réseau qui rend votre application lente comparée au chargement d’un seul bundle de langue optimisé.
|
|
88
|
+
|
|
89
|
+
### 4. Surcharge des performances à l’exécution
|
|
90
|
+
|
|
91
|
+
Pour rendre les traductions réactives (afin qu’elles se mettent à jour instantanément lorsque vous changez de langue), le compilateur injecte souvent des hooks de gestion d’état dans _chaque_ composant.
|
|
92
|
+
|
|
93
|
+
- **Le Coût :** Si vous affichez une liste de 5 000 éléments, vous initialisez 5 000 hooks `useState` et `useEffect` uniquement pour le texte. Cela consomme de la mémoire et des cycles CPU que les bibliothèques déclaratives (qui utilisent généralement un seul fournisseur Context) économisent.
|
|
94
|
+
|
|
95
|
+
## Le Piège : Le Verrouillage Fournisseur
|
|
96
|
+
|
|
97
|
+
C'est sans doute l'aspect le plus dangereux de l'i18n basée sur un compilateur.
|
|
98
|
+
|
|
99
|
+
Dans une bibliothèque déclarative, votre code source contient une intention explicite. Vous possédez les clés. Si vous changez de bibliothèque, vous changez simplement l'import.
|
|
100
|
+
|
|
101
|
+
Dans une approche basée sur un compilateur, **votre code source n'est que du texte en anglais.** La "logique de traduction" n'existe que dans la configuration du plugin de build.
|
|
102
|
+
Si cette bibliothèque cesse d’être maintenue, ou si vous la dépassez, vous êtes bloqué. Vous ne pouvez pas facilement « éjecter » car vous n’avez aucune clé de traduction dans votre code source. Vous devriez réécrire manuellement toute votre application pour migrer.
|
|
103
|
+
|
|
104
|
+
## L’autre côté : risques de l’approche déclarative
|
|
105
|
+
|
|
106
|
+
Pour être juste, la méthode déclarative traditionnelle n’est pas parfaite non plus. Elle a ses propres « pièges ».
|
|
107
|
+
|
|
108
|
+
1. **L’enfer des namespaces :** Vous devez souvent gérer manuellement quels fichiers JSON charger (`common.json`, `dashboard.json`, `footer.json`). Si vous en oubliez un, l’utilisateur voit les clés brutes.
|
|
109
|
+
2. **Surcharge de requêtes :** Sans une configuration soigneuse, il est très facile de charger accidentellement _toutes_ vos clés de traduction pour _toutes_ les pages dès le chargement initial, ce qui alourdit la taille de votre bundle.
|
|
110
|
+
3. **Dérive de synchronisation :** Il est courant que des clés restent dans le fichier JSON bien après que le composant qui les utilise ait été supprimé. Vos fichiers de traduction grossissent indéfiniment, remplis de « clés zombies ».
|
|
111
|
+
|
|
112
|
+
## Le juste milieu avec Intlayer
|
|
113
|
+
|
|
114
|
+
C’est là que des outils comme **Intlayer** cherchent à innover. Intlayer comprend que, bien que les compilateurs soient puissants, la magie implicite est dangereuse.
|
|
115
|
+
|
|
116
|
+
Intlayer propose une commande unique **`transform`**. Au lieu de faire simplement de la magie dans une étape de build cachée, elle peut en réalité **réécrire votre code de composant**. Elle analyse votre texte et le remplace par des déclarations de contenu explicites dans votre base de code.
|
|
117
|
+
|
|
118
|
+
Cela vous offre le meilleur des deux mondes :
|
|
119
|
+
|
|
120
|
+
1. **Granularité :** Vous gardez vos traductions proches de vos composants (améliorant la modularité et le tree-shaking).
|
|
121
|
+
2. **Sécurité :** La traduction devient un code explicite, et non une magie cachée au moment de la compilation.
|
|
122
|
+
3. **Pas de verrouillage :** Puisque le code est transformé en une structure déclarative standard dans votre dépôt, vous ne cachez pas la logique dans un plugin webpack.
|
|
123
|
+
|
|
124
|
+
## Conclusion
|
|
125
|
+
|
|
126
|
+
Alors, que devriez-vous choisir ?
|
|
127
|
+
|
|
128
|
+
**Si vous êtes un développeur junior, un fondateur solo, ou que vous construisez un MVP :**
|
|
129
|
+
L'approche basée sur le compilateur est un choix valide. Elle vous permet d'avancer extrêmement vite. Vous n'avez pas besoin de vous soucier des structures de fichiers ou des clés. Vous construisez simplement. La dette technique est un problème pour le "Vous du futur".
|
|
130
|
+
|
|
131
|
+
**Si vous construisez une application professionnelle de niveau entreprise :**
|
|
132
|
+
La magie est généralement une mauvaise idée. Vous avez besoin de contrôle.
|
|
133
|
+
|
|
134
|
+
- Vous devez gérer des données dynamiques provenant des backends.
|
|
135
|
+
- Vous devez garantir la performance sur des appareils peu puissants (en évitant les explosions de hooks).
|
|
136
|
+
- Vous devez vous assurer de ne pas être enfermé à jamais dans un outil de build spécifique.
|
|
137
|
+
|
|
138
|
+
Pour les applications professionnelles, la **Gestion de Contenu Déclarative** (comme Intlayer ou des bibliothèques établies) reste la référence. Elle sépare vos préoccupations, maintient votre architecture propre, et garantit que la capacité de votre application à parler plusieurs langues ne dépend pas d'un compilateur "boîte noire" devinant vos intentions.
|
|
@@ -176,7 +176,6 @@ Exclure les fichiers générés du contrôle de version :
|
|
|
176
176
|
```plaintext fileName=".gitignore"
|
|
177
177
|
# Ignorer les fichiers générés par Intlayer
|
|
178
178
|
.intlayer
|
|
179
|
-
intl
|
|
180
179
|
```
|
|
181
180
|
|
|
182
181
|
Ces fichiers sont automatiquement régénérés lors du processus de build et n'ont pas besoin d'être commités dans votre dépôt.
|
|
@@ -166,7 +166,6 @@ Exclure les fichiers générés du contrôle de version :
|
|
|
166
166
|
```plaintext fileName=".gitignore"
|
|
167
167
|
# Ignorer les fichiers générés par Intlayer
|
|
168
168
|
.intlayer
|
|
169
|
-
intl
|
|
170
169
|
```
|
|
171
170
|
|
|
172
171
|
Ces fichiers sont automatiquement régénérés lors du processus de build et n'ont pas besoin d'être commités dans votre dépôt.
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
---
|
|
2
|
+
createdAt: 2025-11-24
|
|
3
|
+
updatedAt: 2025-11-24
|
|
4
|
+
title: कंपाइलर बनाम घोषणात्मक i18n
|
|
5
|
+
description: "मैजिक" कंपाइलर-आधारित अंतरराष्ट्रीयकरण और स्पष्ट घोषणात्मक सामग्री प्रबंधन के बीच वास्तुशिल्पीय ट्रेड-ऑफ का अन्वेषण।
|
|
6
|
+
keywords:
|
|
7
|
+
- Intlayer
|
|
8
|
+
- अंतरराष्ट्रीयकरण
|
|
9
|
+
- ब्लॉग
|
|
10
|
+
- Next.js
|
|
11
|
+
- JavaScript
|
|
12
|
+
- React
|
|
13
|
+
- i18n
|
|
14
|
+
- कंपाइलर
|
|
15
|
+
- घोषणात्मक
|
|
16
|
+
slugs:
|
|
17
|
+
- compiler-vs-declarative-i18n
|
|
18
|
+
- blog
|
|
19
|
+
- i18n
|
|
20
|
+
---
|
|
21
|
+
|
|
22
|
+
# कंपाइलर-आधारित i18n के पक्ष और विपक्ष
|
|
23
|
+
|
|
24
|
+
यदि आप एक दशक से अधिक समय से वेब एप्लिकेशन बना रहे हैं, तो आप जानते हैं कि अंतरराष्ट्रीयकरण (i18n) हमेशा एक संघर्ष का बिंदु रहा है। यह अक्सर वह कार्य होता है जिसे कोई करना नहीं चाहता — स्ट्रिंग्स निकालना, JSON फ़ाइलों का प्रबंधन करना, और बहुवचन नियमों की चिंता करना।
|
|
25
|
+
|
|
26
|
+
हाल ही में, "कंपाइलर-आधारित" i18n टूल्स की एक नई लहर उभरी है, जो इस दर्द को गायब करने का वादा करती है। प्रस्तुति आकर्षक है: **बस अपने कंपोनेंट्स में टेक्स्ट लिखें, और बाकी काम बिल्ड टूल पर छोड़ दें।** न कोई कीज़, न कोई इम्पोर्ट्स, बस जादू।
|
|
27
|
+
|
|
28
|
+
लेकिन सॉफ़्टवेयर इंजीनियरिंग में सभी अमूर्तताओं की तरह, जादू की भी एक कीमत होती है।
|
|
29
|
+
|
|
30
|
+
इस ब्लॉग पोस्ट में, हम घोषणात्मक लाइब्रेरीज से कंपाइलर-आधारित दृष्टिकोण की ओर हुए बदलाव, उनके द्वारा लाए गए छिपे हुए वास्तुशिल्पीय ऋण, और क्यों "निरस" तरीका अभी भी पेशेवर एप्लिकेशन के लिए सबसे अच्छा तरीका हो सकता है, का अन्वेषण करेंगे।
|
|
31
|
+
|
|
32
|
+
## अनुवाद का संक्षिप्त इतिहास
|
|
33
|
+
|
|
34
|
+
यह समझने के लिए कि हम कहां हैं, हमें यह देखना होगा कि हमने कहां से शुरुआत की थी।
|
|
35
|
+
|
|
36
|
+
2011–2012 के आसपास, JavaScript का परिदृश्य काफी अलग था। जैसे हम आज जानते हैं, वे बंडलर्स (Webpack, Vite) मौजूद नहीं थे या वे अपने प्रारंभिक चरण में थे। हम ब्राउज़र में स्क्रिप्ट्स को जोड़ रहे थे। इसी युग में, **i18next** जैसी लाइब्रेरीज का जन्म हुआ।
|
|
37
|
+
|
|
38
|
+
उन्होंने उस समय संभव唯一 तरीके से समस्या का समाधान किया: **रनटाइम डिक्शनरीज़**। आप एक विशाल JSON ऑब्जेक्ट मेमोरी में लोड करते थे, और एक फ़ंक्शन तुरंत कीज़ को खोजता था। यह विश्वसनीय, स्पष्ट था, और हर जगह काम करता था।
|
|
39
|
+
|
|
40
|
+
आज की ओर तेजी से बढ़ें। हमारे पास शक्तिशाली कंपाइलर हैं (SWC, Rust-आधारित बंडलर्स) जो Abstract Syntax Trees (AST) को मिलीसेकंड में पार्स कर सकते हैं। इस शक्ति ने एक नया विचार जन्म दिया: _हम मैन्युअली कीज़ क्यों प्रबंधित कर रहे हैं? क्यों कंपाइलर सीधे "Hello World" टेक्स्ट को देख कर हमारे लिए बदल नहीं सकता?_
|
|
41
|
+
|
|
42
|
+
इस प्रकार, कंपाइलर-आधारित i18n का जन्म हुआ।
|
|
43
|
+
|
|
44
|
+
## कंपाइलर का आकर्षण (The "Magic" Approach)
|
|
45
|
+
|
|
46
|
+
इस नए दृष्टिकोण के ट्रेंड में आने का एक कारण है। एक डेवलपर के लिए, यह अनुभव अविश्वसनीय लगता है।
|
|
47
|
+
|
|
48
|
+
### 1. गति और "फ्लो"
|
|
49
|
+
|
|
50
|
+
जब आप काम में डूबे होते हैं, तो एक वेरिएबल नाम (`home_hero_title_v2`) सोचने के लिए रुकना आपके फ्लो को तोड़ देता है। कंपाइलर दृष्टिकोण के साथ, आप `<p>Welcome back</p>` टाइप करते हैं और आगे बढ़ते रहते हैं। कोई रुकावट नहीं होती।
|
|
51
|
+
|
|
52
|
+
### 2. विरासत बचाव मिशन
|
|
53
|
+
|
|
54
|
+
कल्पना करें कि आपको 5,000 कंपोनेंट्स वाला एक विशाल कोडबेस विरासत में मिला है जिसमें कोई अनुवाद नहीं है। इसे मैन्युअल की-आधारित सिस्टम से अनुकूलित करना महीनों लंबा दुःस्वप्न होगा। एक कंपाइलर-आधारित टूल एक बचाव रणनीति के रूप में काम करता है, जो बिना किसी फाइल को मैन्युअली छुए तुरंत हजारों स्ट्रिंग्स निकाल देता है।
|
|
55
|
+
|
|
56
|
+
### 3. एआई युग
|
|
57
|
+
|
|
58
|
+
यह एक आधुनिक लाभ है जिसे हमें नजरअंदाज नहीं करना चाहिए। AI कोडिंग असिस्टेंट्स (जैसे Copilot या ChatGPT) स्वाभाविक रूप से मानक JSX/HTML उत्पन्न करते हैं। वे आपके विशिष्ट अनुवाद कुंजी स्कीमा को नहीं जानते।
|
|
59
|
+
|
|
60
|
+
- **Declarative:** आपको AI के आउटपुट को फिर से लिखना होता है ताकि टेक्स्ट को कुंजियों से बदला जा सके।
|
|
61
|
+
- **Compiler:** आप AI का कोड कॉपी-पेस्ट करते हैं, और यह बस काम करता है।
|
|
62
|
+
|
|
63
|
+
## वास्तविकता जांच: क्यों "मैजिक" खतरनाक है
|
|
64
|
+
|
|
65
|
+
जबकि "मैजिक" आकर्षक है, लेकिन अमूर्तता लीक होती है। एक बिल्ड टूल पर मानव इरादे को समझने के लिए निर्भर रहना वास्तुशिल्पीय कमजोरी लाता है।
|
|
66
|
+
|
|
67
|
+
### 1. हीयूरिस्टिक कमजोरी (अनुमान लगाने का खेल)
|
|
68
|
+
|
|
69
|
+
कंपाइलर को यह अनुमान लगाना होता है कि क्या कंटेंट है और क्या कोड है।
|
|
70
|
+
|
|
71
|
+
- क्या `className="active"` का अनुवाद होता है? यह एक स्ट्रिंग है।
|
|
72
|
+
- क्या `status="pending"` का अनुवाद होता है?
|
|
73
|
+
- क्या `<MyComponent errorMessage="An error occurred" />` का अनुवाद होता है?
|
|
74
|
+
- क्या `"AX-99"` जैसे उत्पाद आईडी का अनुवाद होता है?
|
|
75
|
+
|
|
76
|
+
आप अंततः "कंपाइलर से लड़ते" हुए पाएंगे, विशिष्ट टिप्पणियाँ (जैसे `// ignore-translation`) जोड़कर ताकि यह आपकी एप्लिकेशन लॉजिक को तोड़ने से रोका जा सके।
|
|
77
|
+
|
|
78
|
+
### 2. डायनेमिक डेटा की कठोर सीमा
|
|
79
|
+
|
|
80
|
+
कंपाइलर निष्कर्षण **स्थैतिक विश्लेषण** पर निर्भर करता है। इसे आपके कोड में सटीक स्ट्रिंग देखनी होती है ताकि एक स्थिर ID बनाई जा सके।
|
|
81
|
+
यदि आपका API `server_error` जैसे त्रुटि कोड स्ट्रिंग लौटाता है, तो आप इसे कंपाइलर के साथ अनुवादित नहीं कर सकते क्योंकि कंपाइलर को बिल्ड समय पर उस स्ट्रिंग के अस्तित्व का पता नहीं होता। आपको डायनेमिक डेटा के लिए एक द्वितीयक "रनटाइम-केवल" सिस्टम बनाना पड़ता है।
|
|
82
|
+
|
|
83
|
+
### 3. "चंक विस्फोट" और नेटवर्क वॉटरफॉल्स
|
|
84
|
+
|
|
85
|
+
ट्री-शेकिंग की अनुमति देने के लिए, कंपाइलर टूल अक्सर अनुवादों को प्रत्येक कंपोनेंट के अनुसार विभाजित करते हैं।
|
|
86
|
+
|
|
87
|
+
- **परिणाम:** 50 छोटे कंपोनेंट्स वाली एक ही पेज व्यू में **50 अलग-अलग HTTP अनुरोध** हो सकते हैं छोटे अनुवाद खंडों के लिए। HTTP/2 के बावजूद, यह एक नेटवर्क वॉटरफॉल बनाता है जो आपकी एप्लिकेशन को एकल, अनुकूलित भाषा बंडल की तुलना में धीमा महसूस कराता है।
|
|
88
|
+
|
|
89
|
+
### 4. रनटाइम प्रदर्शन ओवरहेड
|
|
90
|
+
|
|
91
|
+
अनुवादों को प्रतिक्रियाशील बनाने के लिए (ताकि जब आप भाषाएँ बदलें तो वे तुरंत अपडेट हों), कंपाइलर अक्सर _हर_ कंपोनेंट में स्टेट मैनेजमेंट हुक्स इंजेक्ट करता है।
|
|
92
|
+
|
|
93
|
+
- **लागत:** यदि आप 5,000 आइटम की एक सूची रेंडर करते हैं, तो आप केवल टेक्स्ट के लिए 5,000 `useState` और `useEffect` हुक्स इनिशियलाइज़ कर रहे हैं। यह मेमोरी और CPU चक्रों को खपत करता है, जिन्हें डिक्लेरेटिव लाइब्रेरीज़ (जो आमतौर पर एकल Context प्रोवाइडर का उपयोग करती हैं) बचाती हैं।
|
|
94
|
+
|
|
95
|
+
## जाल: विक्रेता लॉक-इन
|
|
96
|
+
|
|
97
|
+
यह संभवतः कंपाइलर-आधारित i18n का सबसे खतरनाक पहलू है।
|
|
98
|
+
|
|
99
|
+
एक डिक्लेरेटिव लाइब्रेरी में, आपके स्रोत कोड में स्पष्ट इरादा होता है। आप कुंजियों के मालिक होते हैं। यदि आप लाइब्रेरी बदलते हैं, तो आप केवल इम्पोर्ट बदलते हैं।
|
|
100
|
+
|
|
101
|
+
कंपाइलर-आधारित दृष्टिकोण में, **आपका स्रोत कोड केवल अंग्रेज़ी टेक्स्ट होता है।** "अनुवाद लॉजिक" केवल बिल्ड प्लगइन की कॉन्फ़िगरेशन के अंदर मौजूद होता है।
|
|
102
|
+
यदि वह लाइब्रेरी मेंटेन करना बंद कर देती है, या यदि आप उससे आगे बढ़ जाते हैं, तो आप फंसे हुए हैं। आप आसानी से "eject" नहीं कर सकते क्योंकि आपके स्रोत कोड में कोई ट्रांसलेशन कीज़ नहीं हैं। आपको मैन्युअली अपना पूरा एप्लिकेशन फिर से लिखना होगा ताकि आप माइग्रेट कर सकें।
|
|
103
|
+
|
|
104
|
+
## दूसरी तरफ: डिक्लेरेटिव दृष्टिकोण के जोखिम
|
|
105
|
+
|
|
106
|
+
सच कहें तो, पारंपरिक डिक्लेरेटिव तरीका भी परफेक्ट नहीं है। इसके अपने "footguns" होते हैं।
|
|
107
|
+
|
|
108
|
+
1. **Namespace Hell:** आपको अक्सर मैन्युअली यह प्रबंधित करना पड़ता है कि कौन से JSON फाइलें लोड करनी हैं (`common.json`, `dashboard.json`, `footer.json`)। यदि आप कोई फाइल भूल जाते हैं, तो उपयोगकर्ता को कच्ची कुंजियाँ दिखाई देती हैं।
|
|
109
|
+
2. **Over-fetching:** सावधानीपूर्वक कॉन्फ़िगरेशन के बिना, यह बहुत आसान है कि आप गलती से प्रारंभिक लोड पर _सभी_ पृष्ठों के लिए _सभी_ ट्रांसलेशन कीज़ लोड कर लें, जिससे आपके बंडल का आकार बढ़ जाता है।
|
|
110
|
+
3. **सिंक ड्रिफ्ट:** यह आम बात है कि JSON फाइल में कुंजियाँ तब तक बनी रहती हैं जब तक कि उन कुंजियों का उपयोग करने वाला कंपोनेंट डिलीट नहीं हो जाता। आपकी ट्रांसलेशन फाइलें अनंत तक बढ़ती रहती हैं, जो "ज़ॉम्बी कीज़" से भरी होती हैं।
|
|
111
|
+
|
|
112
|
+
## Intlayer का मध्य मार्ग
|
|
113
|
+
|
|
114
|
+
यहीं पर **Intlayer** जैसे टूल्स नवाचार करने की कोशिश कर रहे हैं। Intlayer समझता है कि जबकि कंपाइलर शक्तिशाली होते हैं, अप्रत्यक्ष जादू खतरनाक होता है।
|
|
115
|
+
|
|
116
|
+
Intlayer एक अनोखा **`transform` कमांड** प्रदान करता है। छिपे हुए बिल्ड स्टेप में जादू करने के बजाय, यह वास्तव में **आपके कंपोनेंट कोड को फिर से लिख सकता है**। यह आपके टेक्स्ट को स्कैन करता है और इसे आपके कोडबेस में स्पष्ट कंटेंट डिक्लेरेशन से बदल देता है।
|
|
117
|
+
|
|
118
|
+
यह आपको दोनों दुनिया का सर्वश्रेष्ठ देता है:
|
|
119
|
+
|
|
120
|
+
1. **ग्रैन्युलैरिटी:** आप अपनी ट्रांसलेशन्स को अपने कंपोनेंट्स के करीब रखते हैं (जो मॉड्यूलैरिटी और ट्री-शेकिंग में सुधार करता है)।
|
|
121
|
+
2. **सुरक्षा:** अनुवाद स्पष्ट कोड बन जाता है, छिपे हुए बिल्ड-टाइम जादू नहीं।
|
|
122
|
+
3. **कोई लॉक-इन नहीं:** चूंकि कोड आपके रिपॉजिटरी के भीतर एक मानक घोषणात्मक संरचना में परिवर्तित हो जाता है, आप लॉजिक को वेबपैक प्लगइन में छिपा नहीं रहे हैं।
|
|
123
|
+
|
|
124
|
+
## निष्कर्ष
|
|
125
|
+
|
|
126
|
+
तो, आपको क्या चुनना चाहिए?
|
|
127
|
+
|
|
128
|
+
**यदि आप एक जूनियर डेवलपर, एक सोलो फाउंडर, या MVP बना रहे हैं:**
|
|
129
|
+
कंपाइलर-आधारित दृष्टिकोण एक वैध विकल्प है। यह आपको बेहद तेज़ी से आगे बढ़ने की अनुमति देता है। आपको फाइल संरचनाओं या कुंजियों की चिंता करने की जरूरत नहीं है। आप बस निर्माण करते हैं। तकनीकी ऋण "भविष्य के आप" के लिए एक समस्या है।
|
|
130
|
+
|
|
131
|
+
**यदि आप एक पेशेवर, एंटरप्राइज-ग्रेड एप्लिकेशन बना रहे हैं:**
|
|
132
|
+
जादू आमतौर पर एक बुरा विचार है। आपको नियंत्रण की आवश्यकता है।
|
|
133
|
+
|
|
134
|
+
- आपको बैकएंड से डायनेमिक डेटा को संभालना होगा।
|
|
135
|
+
- आपको कम-श्रेणी के उपकरणों पर प्रदर्शन सुनिश्चित करना होगा (हुक विस्फोटों से बचते हुए)।
|
|
136
|
+
- आपको यह सुनिश्चित करना होगा कि आप हमेशा के लिए किसी विशिष्ट बिल्ड टूल में लॉक न हों।
|
|
137
|
+
|
|
138
|
+
पेशेवर ऐप्स के लिए, **घोषणात्मक कंटेंट मैनेजमेंट** (जैसे Intlayer या स्थापित लाइब्रेरी) स्वर्ण मानक बना रहता है। यह आपकी चिंताओं को अलग करता है, आपकी आर्किटेक्चर को साफ़ रखता है, और यह सुनिश्चित करता है कि आपकी एप्लिकेशन की बहुभाषी क्षमता किसी "ब्लैक बॉक्स" कंपाइलर पर निर्भर न हो जो आपकी मंशाओं का अनुमान लगाता हो।
|