@intlayer/docs 9.5.5 → 9.5.6
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 +0 -1
- package/blog/ar/transform_existing_vite_react_app_using_compiler.md +4 -2
- package/blog/de/transform_existing_vite_react_app_using_compiler.md +4 -2
- package/blog/en/transform_existing_vite_react_app_using_compiler.md +4 -2
- package/blog/en-GB/transform_existing_vite_react_app_using_compiler.md +4 -2
- package/blog/es/transform_existing_vite_react_app_using_compiler.md +4 -2
- package/blog/fr/transform_existing_vite_react_app_using_compiler.md +4 -2
- package/blog/hi/transform_existing_vite_react_app_using_compiler.md +4 -2
- package/blog/id/transform_existing_vite_react_app_using_compiler.md +4 -2
- package/blog/it/transform_existing_vite_react_app_using_compiler.md +4 -2
- package/blog/ja/transform_existing_vite_react_app_using_compiler.md +4 -2
- package/blog/ko/transform_existing_vite_react_app_using_compiler.md +4 -2
- package/blog/pl/transform_existing_vite_react_app_using_compiler.md +4 -2
- package/blog/pt/transform_existing_vite_react_app_using_compiler.md +4 -2
- package/blog/ru/transform_existing_vite_react_app_using_compiler.md +4 -2
- package/blog/tr/transform_existing_vite_react_app_using_compiler.md +4 -2
- package/blog/uk/transform_existing_vite_react_app_using_compiler.md +4 -2
- package/blog/vi/transform_existing_vite_react_app_using_compiler.md +4 -2
- package/blog/zh/transform_existing_vite_react_app_using_compiler.md +4 -2
- package/docs/ar/intlayer_with_astro.md +19 -32
- package/docs/ar/intlayer_with_astro_lit.md +32 -36
- package/docs/ar/intlayer_with_astro_preact.md +32 -36
- package/docs/ar/intlayer_with_astro_react.md +32 -36
- package/docs/ar/intlayer_with_astro_solid.md +32 -36
- package/docs/ar/intlayer_with_astro_svelte.md +32 -36
- package/docs/ar/intlayer_with_astro_vue.md +32 -36
- package/docs/ar/intlayer_with_react_router_v7.md +12 -1
- package/docs/ar/intlayer_with_solid_start.md +14 -7
- package/docs/ar/intlayer_with_svelte_kit.md +12 -1
- package/docs/ar/intlayer_with_tanstack+solid.md +13 -2
- package/docs/ar/intlayer_with_tanstack.md +13 -6
- package/docs/ar/intlayer_with_vite+lit.md +75 -3
- package/docs/ar/intlayer_with_vite+preact.md +27 -19
- package/docs/ar/intlayer_with_vite+react.md +27 -19
- package/docs/ar/intlayer_with_vite+solid.md +27 -19
- package/docs/ar/intlayer_with_vite+svelte.md +27 -19
- package/docs/ar/intlayer_with_vite+vanilla.md +16 -3
- package/docs/ar/intlayer_with_vite+vue.md +27 -19
- package/docs/ar/introduction.md +0 -1
- package/docs/ar/readme.md +0 -1
- package/docs/ar/releases/v8.md +1 -5
- package/docs/bn/intlayer_with_vite+lit.md +75 -3
- package/docs/bn/intlayer_with_vite+vanilla.md +16 -3
- package/docs/bn/introduction.md +0 -1
- package/docs/cs/intlayer_with_vite+lit.md +75 -3
- package/docs/cs/intlayer_with_vite+vanilla.md +16 -3
- package/docs/cs/introduction.md +0 -1
- package/docs/de/intlayer_with_astro.md +12 -25
- package/docs/de/intlayer_with_astro_lit.md +23 -27
- package/docs/de/intlayer_with_astro_preact.md +23 -27
- package/docs/de/intlayer_with_astro_react.md +23 -27
- package/docs/de/intlayer_with_astro_solid.md +23 -27
- package/docs/de/intlayer_with_astro_svelte.md +23 -27
- package/docs/de/intlayer_with_astro_vue.md +23 -27
- package/docs/de/intlayer_with_react_router_v7.md +12 -1
- package/docs/de/intlayer_with_solid_start.md +14 -7
- package/docs/de/intlayer_with_svelte_kit.md +12 -1
- package/docs/de/intlayer_with_tanstack+solid.md +13 -2
- package/docs/de/intlayer_with_tanstack.md +13 -6
- package/docs/de/intlayer_with_vite+lit.md +75 -3
- package/docs/de/intlayer_with_vite+preact.md +16 -3
- package/docs/de/intlayer_with_vite+react.md +16 -3
- package/docs/de/intlayer_with_vite+solid.md +16 -3
- package/docs/de/intlayer_with_vite+svelte.md +16 -3
- package/docs/de/intlayer_with_vite+vanilla.md +16 -3
- package/docs/de/intlayer_with_vite+vue.md +16 -3
- package/docs/de/introduction.md +0 -1
- package/docs/de/readme.md +0 -1
- package/docs/de/releases/v8.md +1 -5
- package/docs/en/intlayer_with_astro.md +5 -20
- package/docs/en/intlayer_with_astro_lit.md +22 -26
- package/docs/en/intlayer_with_astro_preact.md +22 -26
- package/docs/en/intlayer_with_astro_react.md +22 -26
- package/docs/en/intlayer_with_astro_solid.md +22 -26
- package/docs/en/intlayer_with_astro_svelte.md +22 -26
- package/docs/en/intlayer_with_astro_vanilla.md +20 -13
- package/docs/en/intlayer_with_astro_vue.md +22 -26
- package/docs/en/intlayer_with_react_router_v7.md +12 -1
- package/docs/en/intlayer_with_solid_start.md +14 -7
- package/docs/en/intlayer_with_svelte_kit.md +12 -1
- package/docs/en/intlayer_with_tanstack+solid.md +13 -2
- package/docs/en/intlayer_with_tanstack.md +12 -5
- package/docs/en/intlayer_with_vite+lit.md +75 -3
- package/docs/en/intlayer_with_vite+preact.md +16 -3
- package/docs/en/intlayer_with_vite+react.md +16 -3
- package/docs/en/intlayer_with_vite+solid.md +16 -3
- package/docs/en/intlayer_with_vite+svelte.md +16 -3
- package/docs/en/intlayer_with_vite+vanilla.md +16 -3
- package/docs/en/intlayer_with_vite+vue.md +16 -3
- package/docs/en/introduction.md +0 -1
- package/docs/en/readme.md +0 -1
- package/docs/en/releases/v8.md +1 -5
- package/docs/en-GB/intlayer_with_astro.md +12 -25
- package/docs/en-GB/intlayer_with_astro_lit.md +23 -27
- package/docs/en-GB/intlayer_with_astro_preact.md +23 -27
- package/docs/en-GB/intlayer_with_astro_react.md +23 -27
- package/docs/en-GB/intlayer_with_astro_solid.md +23 -27
- package/docs/en-GB/intlayer_with_astro_svelte.md +23 -27
- package/docs/en-GB/intlayer_with_astro_vue.md +23 -27
- package/docs/en-GB/intlayer_with_react_router_v7.md +12 -1
- package/docs/en-GB/intlayer_with_solid_start.md +14 -7
- package/docs/en-GB/intlayer_with_svelte_kit.md +12 -1
- package/docs/en-GB/intlayer_with_tanstack+solid.md +13 -2
- package/docs/en-GB/intlayer_with_tanstack.md +13 -6
- package/docs/en-GB/intlayer_with_vite+lit.md +75 -3
- package/docs/en-GB/intlayer_with_vite+preact.md +16 -3
- package/docs/en-GB/intlayer_with_vite+react.md +16 -3
- package/docs/en-GB/intlayer_with_vite+solid.md +25 -15
- package/docs/en-GB/intlayer_with_vite+svelte.md +16 -3
- package/docs/en-GB/intlayer_with_vite+vanilla.md +16 -3
- package/docs/en-GB/intlayer_with_vite+vue.md +16 -3
- package/docs/en-GB/introduction.md +0 -1
- package/docs/en-GB/readme.md +0 -1
- package/docs/en-GB/releases/v8.md +1 -5
- package/docs/es/intlayer_with_astro.md +12 -25
- package/docs/es/intlayer_with_astro_lit.md +23 -27
- package/docs/es/intlayer_with_astro_preact.md +23 -27
- package/docs/es/intlayer_with_astro_react.md +23 -27
- package/docs/es/intlayer_with_astro_solid.md +23 -27
- package/docs/es/intlayer_with_astro_svelte.md +23 -27
- package/docs/es/intlayer_with_astro_vue.md +23 -27
- package/docs/es/intlayer_with_react_router_v7.md +12 -1
- package/docs/es/intlayer_with_solid_start.md +14 -7
- package/docs/es/intlayer_with_svelte_kit.md +12 -1
- package/docs/es/intlayer_with_tanstack+solid.md +13 -2
- package/docs/es/intlayer_with_tanstack.md +13 -6
- package/docs/es/intlayer_with_vite+lit.md +75 -3
- package/docs/es/intlayer_with_vite+preact.md +16 -3
- package/docs/es/intlayer_with_vite+react.md +16 -3
- package/docs/es/intlayer_with_vite+solid.md +16 -3
- package/docs/es/intlayer_with_vite+svelte.md +16 -3
- package/docs/es/intlayer_with_vite+vanilla.md +16 -3
- package/docs/es/intlayer_with_vite+vue.md +16 -3
- package/docs/es/introduction.md +0 -1
- package/docs/es/readme.md +0 -1
- package/docs/es/releases/v8.md +1 -5
- package/docs/fr/intlayer_with_astro.md +13 -26
- package/docs/fr/intlayer_with_astro_lit.md +24 -28
- package/docs/fr/intlayer_with_astro_preact.md +24 -28
- package/docs/fr/intlayer_with_astro_react.md +24 -28
- package/docs/fr/intlayer_with_astro_solid.md +24 -28
- package/docs/fr/intlayer_with_astro_svelte.md +24 -28
- package/docs/fr/intlayer_with_astro_vue.md +24 -28
- package/docs/fr/intlayer_with_react_router_v7.md +15 -4
- package/docs/fr/intlayer_with_solid_start.md +14 -7
- package/docs/fr/intlayer_with_svelte_kit.md +15 -4
- package/docs/fr/intlayer_with_tanstack+solid.md +15 -4
- package/docs/fr/intlayer_with_tanstack.md +13 -6
- package/docs/fr/intlayer_with_vite+lit.md +75 -3
- package/docs/fr/intlayer_with_vite+preact.md +19 -6
- package/docs/fr/intlayer_with_vite+react.md +19 -6
- package/docs/fr/intlayer_with_vite+solid.md +19 -6
- package/docs/fr/intlayer_with_vite+svelte.md +19 -6
- package/docs/fr/intlayer_with_vite+vanilla.md +19 -6
- package/docs/fr/intlayer_with_vite+vue.md +19 -6
- package/docs/fr/introduction.md +0 -1
- package/docs/fr/readme.md +0 -1
- package/docs/fr/releases/v8.md +1 -5
- package/docs/hi/intlayer_with_astro.md +15 -31
- package/docs/hi/intlayer_with_astro_lit.md +26 -33
- package/docs/hi/intlayer_with_astro_preact.md +26 -33
- package/docs/hi/intlayer_with_astro_react.md +26 -33
- package/docs/hi/intlayer_with_astro_solid.md +26 -33
- package/docs/hi/intlayer_with_astro_svelte.md +26 -33
- package/docs/hi/intlayer_with_astro_vue.md +26 -33
- package/docs/hi/intlayer_with_react_router_v7.md +20 -12
- package/docs/hi/intlayer_with_solid_start.md +14 -7
- package/docs/hi/intlayer_with_svelte_kit.md +20 -12
- package/docs/hi/intlayer_with_tanstack+solid.md +13 -2
- package/docs/hi/intlayer_with_tanstack.md +21 -17
- package/docs/hi/intlayer_with_vite+lit.md +75 -3
- package/docs/hi/intlayer_with_vite+preact.md +24 -14
- package/docs/hi/intlayer_with_vite+react.md +24 -14
- package/docs/hi/intlayer_with_vite+solid.md +24 -14
- package/docs/hi/intlayer_with_vite+svelte.md +24 -14
- package/docs/hi/intlayer_with_vite+vanilla.md +16 -3
- package/docs/hi/intlayer_with_vite+vue.md +24 -14
- package/docs/hi/introduction.md +0 -1
- package/docs/hi/readme.md +0 -1
- package/docs/hi/releases/v8.md +1 -5
- package/docs/id/intlayer_with_astro.md +12 -25
- package/docs/id/intlayer_with_astro_lit.md +23 -27
- package/docs/id/intlayer_with_astro_preact.md +23 -27
- package/docs/id/intlayer_with_astro_react.md +23 -27
- package/docs/id/intlayer_with_astro_solid.md +23 -27
- package/docs/id/intlayer_with_astro_svelte.md +23 -27
- package/docs/id/intlayer_with_astro_vue.md +23 -27
- package/docs/id/intlayer_with_react_router_v7.md +12 -1
- package/docs/id/intlayer_with_solid_start.md +14 -7
- package/docs/id/intlayer_with_svelte_kit.md +12 -1
- package/docs/id/intlayer_with_tanstack+solid.md +13 -2
- package/docs/id/intlayer_with_tanstack.md +13 -6
- package/docs/id/intlayer_with_vite+lit.md +75 -3
- package/docs/id/intlayer_with_vite+preact.md +16 -3
- package/docs/id/intlayer_with_vite+react.md +16 -3
- package/docs/id/intlayer_with_vite+solid.md +16 -3
- package/docs/id/intlayer_with_vite+svelte.md +16 -3
- package/docs/id/intlayer_with_vite+vanilla.md +16 -3
- package/docs/id/intlayer_with_vite+vue.md +16 -3
- package/docs/id/introduction.md +0 -1
- package/docs/id/readme.md +0 -1
- package/docs/id/releases/v8.md +1 -5
- package/docs/it/intlayer_with_astro.md +12 -25
- package/docs/it/intlayer_with_astro_lit.md +23 -27
- package/docs/it/intlayer_with_astro_preact.md +23 -27
- package/docs/it/intlayer_with_astro_react.md +23 -27
- package/docs/it/intlayer_with_astro_solid.md +23 -27
- package/docs/it/intlayer_with_astro_svelte.md +23 -27
- package/docs/it/intlayer_with_astro_vue.md +23 -27
- package/docs/it/intlayer_with_react_router_v7.md +12 -1
- package/docs/it/intlayer_with_solid_start.md +14 -7
- package/docs/it/intlayer_with_svelte_kit.md +12 -1
- package/docs/it/intlayer_with_tanstack+solid.md +13 -2
- package/docs/it/intlayer_with_tanstack.md +13 -6
- package/docs/it/intlayer_with_vite+lit.md +75 -3
- package/docs/it/intlayer_with_vite+preact.md +16 -3
- package/docs/it/intlayer_with_vite+react.md +16 -3
- package/docs/it/intlayer_with_vite+solid.md +16 -3
- package/docs/it/intlayer_with_vite+svelte.md +16 -3
- package/docs/it/intlayer_with_vite+vanilla.md +16 -3
- package/docs/it/intlayer_with_vite+vue.md +16 -3
- package/docs/it/introduction.md +0 -1
- package/docs/it/readme.md +0 -1
- package/docs/it/releases/v8.md +1 -5
- package/docs/ja/intlayer_with_astro.md +12 -25
- package/docs/ja/intlayer_with_astro_lit.md +23 -27
- package/docs/ja/intlayer_with_astro_preact.md +23 -27
- package/docs/ja/intlayer_with_astro_react.md +23 -27
- package/docs/ja/intlayer_with_astro_solid.md +23 -27
- package/docs/ja/intlayer_with_astro_svelte.md +23 -27
- package/docs/ja/intlayer_with_astro_vue.md +23 -27
- package/docs/ja/intlayer_with_react_router_v7.md +12 -1
- package/docs/ja/intlayer_with_solid_start.md +14 -7
- package/docs/ja/intlayer_with_svelte_kit.md +21 -15
- package/docs/ja/intlayer_with_tanstack+solid.md +13 -2
- package/docs/ja/intlayer_with_tanstack.md +13 -6
- package/docs/ja/intlayer_with_vite+lit.md +75 -3
- package/docs/ja/intlayer_with_vite+preact.md +16 -3
- package/docs/ja/intlayer_with_vite+react.md +16 -3
- package/docs/ja/intlayer_with_vite+solid.md +16 -3
- package/docs/ja/intlayer_with_vite+svelte.md +16 -3
- package/docs/ja/intlayer_with_vite+vanilla.md +16 -3
- package/docs/ja/intlayer_with_vite+vue.md +16 -3
- package/docs/ja/introduction.md +0 -1
- package/docs/ja/readme.md +0 -1
- package/docs/ja/releases/v8.md +1 -5
- package/docs/ko/intlayer_with_astro.md +6 -21
- package/docs/ko/intlayer_with_astro_lit.md +23 -27
- package/docs/ko/intlayer_with_astro_preact.md +23 -27
- package/docs/ko/intlayer_with_astro_react.md +23 -27
- package/docs/ko/intlayer_with_astro_solid.md +23 -27
- package/docs/ko/intlayer_with_astro_svelte.md +23 -27
- package/docs/ko/intlayer_with_astro_vue.md +23 -27
- package/docs/ko/intlayer_with_react_router_v7.md +12 -1
- package/docs/ko/intlayer_with_solid_start.md +14 -7
- package/docs/ko/intlayer_with_svelte_kit.md +12 -1
- package/docs/ko/intlayer_with_tanstack+solid.md +13 -2
- package/docs/ko/intlayer_with_tanstack.md +13 -6
- package/docs/ko/intlayer_with_vite+lit.md +75 -3
- package/docs/ko/intlayer_with_vite+preact.md +16 -3
- package/docs/ko/intlayer_with_vite+react.md +16 -3
- package/docs/ko/intlayer_with_vite+solid.md +26 -16
- package/docs/ko/intlayer_with_vite+svelte.md +16 -3
- package/docs/ko/intlayer_with_vite+vanilla.md +16 -3
- package/docs/ko/intlayer_with_vite+vue.md +16 -3
- package/docs/ko/introduction.md +0 -1
- package/docs/ko/readme.md +0 -1
- package/docs/ko/releases/v8.md +1 -5
- package/docs/nl/intlayer_with_vite+lit.md +75 -3
- package/docs/nl/intlayer_with_vite+vanilla.md +16 -3
- package/docs/nl/introduction.md +0 -1
- package/docs/pl/intlayer_with_astro.md +6 -21
- package/docs/pl/intlayer_with_astro_lit.md +23 -27
- package/docs/pl/intlayer_with_astro_preact.md +23 -27
- package/docs/pl/intlayer_with_astro_react.md +23 -27
- package/docs/pl/intlayer_with_astro_solid.md +23 -27
- package/docs/pl/intlayer_with_astro_svelte.md +23 -27
- package/docs/pl/intlayer_with_astro_vue.md +23 -27
- package/docs/pl/intlayer_with_react_router_v7.md +12 -1
- package/docs/pl/intlayer_with_solid_start.md +14 -7
- package/docs/pl/intlayer_with_svelte_kit.md +12 -1
- package/docs/pl/intlayer_with_tanstack+solid.md +13 -2
- package/docs/pl/intlayer_with_tanstack.md +13 -6
- package/docs/pl/intlayer_with_vite+lit.md +75 -3
- package/docs/pl/intlayer_with_vite+preact.md +16 -3
- package/docs/pl/intlayer_with_vite+react.md +16 -3
- package/docs/pl/intlayer_with_vite+solid.md +16 -3
- package/docs/pl/intlayer_with_vite+svelte.md +16 -3
- package/docs/pl/intlayer_with_vite+vanilla.md +16 -3
- package/docs/pl/intlayer_with_vite+vue.md +16 -3
- package/docs/pl/introduction.md +0 -1
- package/docs/pl/readme.md +0 -1
- package/docs/pl/releases/v8.md +1 -5
- package/docs/pt/intlayer_with_astro.md +6 -21
- package/docs/pt/intlayer_with_astro_lit.md +23 -27
- package/docs/pt/intlayer_with_astro_preact.md +23 -27
- package/docs/pt/intlayer_with_astro_react.md +23 -27
- package/docs/pt/intlayer_with_astro_solid.md +23 -27
- package/docs/pt/intlayer_with_astro_svelte.md +23 -27
- package/docs/pt/intlayer_with_astro_vue.md +23 -27
- package/docs/pt/intlayer_with_react_router_v7.md +12 -1
- package/docs/pt/intlayer_with_solid_start.md +14 -7
- package/docs/pt/intlayer_with_svelte_kit.md +12 -1
- package/docs/pt/intlayer_with_tanstack+solid.md +13 -2
- package/docs/pt/intlayer_with_tanstack.md +13 -6
- package/docs/pt/intlayer_with_vite+lit.md +75 -3
- package/docs/pt/intlayer_with_vite+preact.md +16 -3
- package/docs/pt/intlayer_with_vite+react.md +16 -3
- package/docs/pt/intlayer_with_vite+solid.md +16 -3
- package/docs/pt/intlayer_with_vite+svelte.md +16 -3
- package/docs/pt/intlayer_with_vite+vanilla.md +16 -3
- package/docs/pt/intlayer_with_vite+vue.md +16 -3
- package/docs/pt/introduction.md +0 -1
- package/docs/pt/readme.md +0 -1
- package/docs/pt/releases/v8.md +1 -5
- package/docs/ru/intlayer_with_astro.md +12 -25
- package/docs/ru/intlayer_with_astro_lit.md +23 -27
- package/docs/ru/intlayer_with_astro_preact.md +23 -27
- package/docs/ru/intlayer_with_astro_react.md +23 -27
- package/docs/ru/intlayer_with_astro_solid.md +23 -27
- package/docs/ru/intlayer_with_astro_svelte.md +23 -27
- package/docs/ru/intlayer_with_astro_vue.md +23 -27
- package/docs/ru/intlayer_with_react_router_v7.md +12 -1
- package/docs/ru/intlayer_with_solid_start.md +14 -7
- package/docs/ru/intlayer_with_svelte_kit.md +12 -1
- package/docs/ru/intlayer_with_tanstack+solid.md +13 -2
- package/docs/ru/intlayer_with_tanstack.md +13 -6
- package/docs/ru/intlayer_with_vite+lit.md +75 -3
- package/docs/ru/intlayer_with_vite+preact.md +16 -3
- package/docs/ru/intlayer_with_vite+react.md +16 -3
- package/docs/ru/intlayer_with_vite+solid.md +16 -3
- package/docs/ru/intlayer_with_vite+svelte.md +16 -3
- package/docs/ru/intlayer_with_vite+vanilla.md +16 -3
- package/docs/ru/intlayer_with_vite+vue.md +16 -3
- package/docs/ru/introduction.md +0 -1
- package/docs/ru/readme.md +0 -1
- package/docs/ru/releases/v8.md +1 -5
- package/docs/tr/intlayer_with_astro.md +12 -25
- package/docs/tr/intlayer_with_astro_lit.md +24 -28
- package/docs/tr/intlayer_with_astro_preact.md +24 -28
- package/docs/tr/intlayer_with_astro_react.md +24 -28
- package/docs/tr/intlayer_with_astro_solid.md +24 -28
- package/docs/tr/intlayer_with_astro_svelte.md +24 -28
- package/docs/tr/intlayer_with_astro_vue.md +24 -28
- package/docs/tr/intlayer_with_react_router_v7.md +12 -1
- package/docs/tr/intlayer_with_solid_start.md +14 -7
- package/docs/tr/intlayer_with_svelte_kit.md +12 -1
- package/docs/tr/intlayer_with_tanstack+solid.md +13 -2
- package/docs/tr/intlayer_with_tanstack.md +13 -6
- package/docs/tr/intlayer_with_vite+lit.md +75 -3
- package/docs/tr/intlayer_with_vite+preact.md +16 -3
- package/docs/tr/intlayer_with_vite+react.md +16 -3
- package/docs/tr/intlayer_with_vite+solid.md +16 -3
- package/docs/tr/intlayer_with_vite+svelte.md +16 -3
- package/docs/tr/intlayer_with_vite+vanilla.md +16 -3
- package/docs/tr/intlayer_with_vite+vue.md +16 -3
- package/docs/tr/introduction.md +0 -1
- package/docs/tr/readme.md +0 -1
- package/docs/tr/releases/v8.md +1 -5
- package/docs/uk/intlayer_with_astro.md +12 -25
- package/docs/uk/intlayer_with_astro_lit.md +23 -27
- package/docs/uk/intlayer_with_astro_preact.md +23 -27
- package/docs/uk/intlayer_with_astro_react.md +23 -27
- package/docs/uk/intlayer_with_astro_solid.md +23 -27
- package/docs/uk/intlayer_with_astro_svelte.md +23 -27
- package/docs/uk/intlayer_with_astro_vue.md +23 -27
- package/docs/uk/intlayer_with_react_router_v7.md +12 -1
- package/docs/uk/intlayer_with_solid_start.md +14 -7
- package/docs/uk/intlayer_with_svelte_kit.md +12 -1
- package/docs/uk/intlayer_with_tanstack+solid.md +13 -2
- package/docs/uk/intlayer_with_tanstack.md +13 -6
- package/docs/uk/intlayer_with_vite+lit.md +75 -3
- package/docs/uk/intlayer_with_vite+preact.md +16 -3
- package/docs/uk/intlayer_with_vite+react.md +16 -3
- package/docs/uk/intlayer_with_vite+solid.md +16 -3
- package/docs/uk/intlayer_with_vite+svelte.md +16 -3
- package/docs/uk/intlayer_with_vite+vanilla.md +16 -3
- package/docs/uk/intlayer_with_vite+vue.md +16 -3
- package/docs/uk/introduction.md +0 -1
- package/docs/uk/readme.md +0 -1
- package/docs/uk/releases/v8.md +1 -5
- package/docs/ur/intlayer_with_vite+lit.md +75 -3
- package/docs/ur/intlayer_with_vite+vanilla.md +16 -3
- package/docs/ur/introduction.md +0 -1
- package/docs/vi/intlayer_with_astro.md +12 -25
- package/docs/vi/intlayer_with_astro_lit.md +23 -27
- package/docs/vi/intlayer_with_astro_preact.md +23 -27
- package/docs/vi/intlayer_with_astro_react.md +23 -27
- package/docs/vi/intlayer_with_astro_solid.md +23 -27
- package/docs/vi/intlayer_with_astro_svelte.md +23 -27
- package/docs/vi/intlayer_with_astro_vue.md +23 -27
- package/docs/vi/intlayer_with_react_router_v7.md +12 -1
- package/docs/vi/intlayer_with_solid_start.md +14 -7
- package/docs/vi/intlayer_with_svelte_kit.md +12 -1
- package/docs/vi/intlayer_with_tanstack+solid.md +13 -2
- package/docs/vi/intlayer_with_tanstack.md +13 -6
- package/docs/vi/intlayer_with_vite+lit.md +75 -3
- package/docs/vi/intlayer_with_vite+preact.md +16 -3
- package/docs/vi/intlayer_with_vite+react.md +16 -3
- package/docs/vi/intlayer_with_vite+solid.md +16 -3
- package/docs/vi/intlayer_with_vite+svelte.md +16 -3
- package/docs/vi/intlayer_with_vite+vanilla.md +16 -3
- package/docs/vi/intlayer_with_vite+vue.md +16 -3
- package/docs/vi/introduction.md +0 -1
- package/docs/vi/readme.md +0 -1
- package/docs/vi/releases/v8.md +1 -5
- package/docs/zh/intlayer_with_astro.md +6 -21
- package/docs/zh/intlayer_with_astro_lit.md +23 -27
- package/docs/zh/intlayer_with_astro_preact.md +23 -27
- package/docs/zh/intlayer_with_astro_react.md +23 -27
- package/docs/zh/intlayer_with_astro_solid.md +23 -27
- package/docs/zh/intlayer_with_astro_svelte.md +23 -27
- package/docs/zh/intlayer_with_astro_vue.md +23 -27
- package/docs/zh/intlayer_with_react_router_v7.md +12 -1
- package/docs/zh/intlayer_with_solid_start.md +14 -7
- package/docs/zh/intlayer_with_svelte_kit.md +12 -1
- package/docs/zh/intlayer_with_tanstack+solid.md +13 -2
- package/docs/zh/intlayer_with_tanstack.md +13 -6
- package/docs/zh/intlayer_with_vite+lit.md +75 -3
- package/docs/zh/intlayer_with_vite+preact.md +16 -3
- package/docs/zh/intlayer_with_vite+react.md +16 -3
- package/docs/zh/intlayer_with_vite+solid.md +16 -3
- package/docs/zh/intlayer_with_vite+svelte.md +16 -3
- package/docs/zh/intlayer_with_vite+vanilla.md +16 -3
- package/docs/zh/intlayer_with_vite+vue.md +16 -3
- package/docs/zh/introduction.md +0 -1
- package/docs/zh/readme.md +0 -1
- package/docs/zh/releases/v8.md +1 -5
- package/docs/zh-TW/introduction.md +0 -1
- package/package.json +6 -6
- package/docs/ar/intlayer_with_astro_vanilla.md +0 -709
- package/docs/de/intlayer_with_astro_vanilla.md +0 -705
- package/docs/en-GB/intlayer_with_astro_vanilla.md +0 -709
- package/docs/es/intlayer_with_astro_vanilla.md +0 -701
- package/docs/fr/intlayer_with_astro_vanilla.md +0 -701
- package/docs/hi/intlayer_with_astro_vanilla.md +0 -720
- package/docs/id/intlayer_with_astro_vanilla.md +0 -705
- package/docs/it/intlayer_with_astro_vanilla.md +0 -705
- package/docs/ja/intlayer_with_astro_vanilla.md +0 -708
- package/docs/ko/intlayer_with_astro_vanilla.md +0 -720
- package/docs/pl/intlayer_with_astro_vanilla.md +0 -705
- package/docs/pt/intlayer_with_astro_vanilla.md +0 -705
- package/docs/ru/intlayer_with_astro_vanilla.md +0 -716
- package/docs/tr/intlayer_with_astro_vanilla.md +0 -705
- package/docs/uk/intlayer_with_astro_vanilla.md +0 -705
- package/docs/vi/intlayer_with_astro_vanilla.md +0 -705
- package/docs/zh/intlayer_with_astro_vanilla.md +0 -704
|
@@ -1,705 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
createdAt: 2026-04-24
|
|
3
|
-
updatedAt: 2026-06-23
|
|
4
|
-
title: "Astro + Vanilla JS i18n - Hướng dẫn đầy đủ để dịch ứng dụng của bạn"
|
|
5
|
-
description: "Không còn i18next nữa. Hướng dẫn 2026 để xây dựng ứng dụng Astro + Vanilla JS đa ngôn ngữ (i18n). Dịch với các AI agent và tối ưu hóa kích thước bundle, SEO và hiệu suất."
|
|
6
|
-
keywords:
|
|
7
|
-
- đa ngôn ngữ
|
|
8
|
-
- tài liệu
|
|
9
|
-
- Intlayer
|
|
10
|
-
- Astro
|
|
11
|
-
- Vanilla JS
|
|
12
|
-
- JavaScript
|
|
13
|
-
- TypeScript
|
|
14
|
-
slugs:
|
|
15
|
-
- doc
|
|
16
|
-
- environment
|
|
17
|
-
- astro
|
|
18
|
-
- vanilla
|
|
19
|
-
applicationTemplate: https://github.com/aymericzip/intlayer-astro-template
|
|
20
|
-
applicationShowcase: https://intlayer-astro-template.vercel.app
|
|
21
|
-
history:
|
|
22
|
-
- version: 8.9.0
|
|
23
|
-
date: 2026-05-04
|
|
24
|
-
changes: "Cập nhật cách sử dụng API useIntlayer của Solid sang truy cập thuộc tính trực tiếp"
|
|
25
|
-
- version: 8.7.7
|
|
26
|
-
date: 2026-04-24
|
|
27
|
-
changes: "Tài liệu ban đầu cho Astro + Vanilla JS"
|
|
28
|
-
author: aymericzip
|
|
29
|
-
---
|
|
30
|
-
|
|
31
|
-
# Dịch trang web Astro + Vanilla JS của bạn với Intlayer | Đa ngôn ngữ (i18n)
|
|
32
|
-
|
|
33
|
-
<Tabs defaultTab="code">
|
|
34
|
-
<Tab label="Mã nguồn" value="code">
|
|
35
|
-
|
|
36
|
-
<iframe
|
|
37
|
-
src="https://ide.intlayer.org/aymericzip/intlayer-astro-template?file=intlayer.config.ts"
|
|
38
|
-
className="m-auto overflow-hidden rounded-lg border-0 max-md:size-full max-md:h-[700px] md:aspect-16/9 md:w-full"
|
|
39
|
-
title="Demo CodeSandbox - Cách đa ngôn ngữ hóa ứng dụng của bạn với Intlayer"
|
|
40
|
-
sandbox="allow-forms allow-modals allow-popups allow-presentation allow-same-origin allow-scripts"
|
|
41
|
-
loading="lazy"
|
|
42
|
-
/>
|
|
43
|
-
|
|
44
|
-
</Tab>
|
|
45
|
-
<Tab label="Bản demo" value="demo">
|
|
46
|
-
|
|
47
|
-
<iframe
|
|
48
|
-
src="https://intlayer-astro-template.vercel.app"
|
|
49
|
-
className="m-auto overflow-hidden rounded-lg border-0 max-md:size-full max-md:h-[700px] md:aspect-16/9 md:w-full"
|
|
50
|
-
title="Bản demo - intlayer-astro-template"
|
|
51
|
-
sandbox="allow-forms allow-modals allow-popups allow-presentation allow-same-origin allow-scripts"
|
|
52
|
-
loading="lazy"
|
|
53
|
-
/>
|
|
54
|
-
|
|
55
|
-
</Tab>
|
|
56
|
-
</Tabs>
|
|
57
|
-
|
|
58
|
-
## Mục lục
|
|
59
|
-
|
|
60
|
-
<TOC/>
|
|
61
|
-
|
|
62
|
-
## Tại sao Intlayer thay thế các lựa chọn thay thế?
|
|
63
|
-
|
|
64
|
-
So với các giải pháp chính như `astro-i18n` hay `i18next`, Intlayer là giải pháp đi kèm với các tính năng tối ưu hóa tích hợp như:
|
|
65
|
-
|
|
66
|
-
<AccordionGroup>
|
|
67
|
-
<Accordion header="Bảo hiểm đầy đủ của Astro">
|
|
68
|
-
|
|
69
|
-
Intlayer được tối ưu hóa để hoạt động hoàn hảo với Astro bằng cách cung cấp **định tuyến đa ngôn ngữ**, **sơ đồ trang web** và tất cả các tính năng cần thiết để mở rộng quy mô quốc tế hóa (i18n).
|
|
70
|
-
|
|
71
|
-
</Accordion>
|
|
72
|
-
<Accordion header="Kích thước bundle">
|
|
73
|
-
|
|
74
|
-
Thay vì tải các tệp JSON lớn vào trang của bạn, hãy chỉ tải nội dung cần thiết. Intlayer giúp **giảm tới 50% kích thước bundle và kích thước trang**.
|
|
75
|
-
|
|
76
|
-
</Accordion>
|
|
77
|
-
<Accordion header="Khả năng bảo trì">
|
|
78
|
-
|
|
79
|
-
Xác định phạm vi nội dung ứng dụng của bạn **tạo điều kiện bảo trì** cho các ứng dụng quy mô lớn. Bạn có thể sao chép hoặc xóa một thư mục tính năng mà không phải lo lắng về việc xem lại toàn bộ cơ sở mã nội dung của mình. Ngoài ra, Intlayer **được nhập đầy đủ** để đảm bảo tính chính xác cho nội dung của bạn.
|
|
80
|
-
|
|
81
|
-
</Accordion>
|
|
82
|
-
<Accordion header="Đại lý AI">
|
|
83
|
-
|
|
84
|
-
Nội dung cùng định vị **giảm ngữ cảnh cần thiết** của Mô hình ngôn ngữ lớn (LLM). Intlayer cũng đi kèm một bộ công cụ, chẳng hạn như **CLI** để kiểm tra các bản dịch bị thiếu,**[LSP](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en/lsp.md)**, **[MCP](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en/mcp_server.md)** và **[agent skills](https://github.com/aymericzip/intlayer/blob/main/docs/docs/vi/agent_skills.md)**, để giúp trải nghiệm của nhà phát triển (DX) trở nên mượt mà hơn nữa đối với các tác nhân AI.
|
|
85
|
-
|
|
86
|
-
</Accordion>
|
|
87
|
-
<Accordion header="Tự động hóa">
|
|
88
|
-
|
|
89
|
-
Sử dụng tính năng tự động hóa để dịch trong quy trình CI/CD của bạn bằng cách sử dụng LLM mà bạn chọn với chi phí do nhà cung cấp AI của bạn chi trả. Intlayer cũng cung cấp **trình biên dịch** để tự động trích xuất nội dung cũng như [nền tảng web](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en/intlayer_CMS.md) để giúp **dịch ở chế độ nền**.
|
|
90
|
-
|
|
91
|
-
</Accordion>
|
|
92
|
-
<Accordion header="Hiệu suất">
|
|
93
|
-
|
|
94
|
-
Việc kết nối các tệp JSON lớn với các thành phần có thể dẫn đến các vấn đề về hiệu suất và khả năng phản hồi. Intlayer tối ưu hóa việc tải nội dung của bạn tại thời điểm build.
|
|
95
|
-
|
|
96
|
-
</Accordion>
|
|
97
|
-
<Accordion header="Mở rộng quy mô không có nhà phát triển">
|
|
98
|
-
|
|
99
|
-
Không chỉ là giải pháp i18n, Intlayer còn cung cấp **[trình chỉnh sửa trực quan](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en/intlayer_visual_editor.md)** và **[CMS đầy đủ](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en/intlayer_CMS.md)** để giúp bạn quản lý nội dung đa ngôn ngữ của mình trong **thời gian thực**, giúp việc cộng tác với người dịch, người viết quảng cáo và các thành viên khác trong nhóm trở nên liền mạch. Nội dung có thể được lưu trữ cục bộ và/hoặc từ xa.
|
|
100
|
-
|
|
101
|
-
</Accordion>
|
|
102
|
-
</AccordionGroup>
|
|
103
|
-
|
|
104
|
-
## Hướng dẫn từng bước để cấu hình Intlayer trong Astro + Vanilla JS
|
|
105
|
-
|
|
106
|
-
Xem [mẫu ứng dụng](https://github.com/aymericzip/intlayer-astro-template) trên GitHub.
|
|
107
|
-
|
|
108
|
-
<Steps>
|
|
109
|
-
<Step number={1} title="Cài đặt các phụ thuộc">
|
|
110
|
-
|
|
111
|
-
Cài đặt các gói cần thiết bằng trình quản lý gói ưa thích của bạn:
|
|
112
|
-
|
|
113
|
-
```bash packageManager="npm"
|
|
114
|
-
npx intlayer init --interactive
|
|
115
|
-
```
|
|
116
|
-
|
|
117
|
-
```bash packageManager="pnpm"
|
|
118
|
-
pnpm dlx intlayer init --interactive
|
|
119
|
-
```
|
|
120
|
-
|
|
121
|
-
```bash packageManager="yarn"
|
|
122
|
-
yarn dlx intlayer init --interactive
|
|
123
|
-
```
|
|
124
|
-
|
|
125
|
-
```bash packageManager="bun"
|
|
126
|
-
bunx intlayer init --interactive
|
|
127
|
-
```
|
|
128
|
-
|
|
129
|
-
> cờ `--interactive` là tùy chọn. Sử dụng `intlayer-cli init` nếu bạn là tác nhân AI.
|
|
130
|
-
|
|
131
|
-
> Lệnh này sẽ phát hiện môi trường của bạn và cài đặt các gói cần thiết. Ví dụ:
|
|
132
|
-
|
|
133
|
-
```bash packageManager="npm"
|
|
134
|
-
npm install intlayer astro-intlayer vanilla-intlayer
|
|
135
|
-
```
|
|
136
|
-
|
|
137
|
-
```bash packageManager="pnpm"
|
|
138
|
-
pnpm add intlayer astro-intlayer vanilla-intlayer
|
|
139
|
-
```
|
|
140
|
-
|
|
141
|
-
```bash packageManager="yarn"
|
|
142
|
-
yarn add intlayer astro-intlayer vanilla-intlayer
|
|
143
|
-
```
|
|
144
|
-
|
|
145
|
-
```bash packageManager="bun"
|
|
146
|
-
bun add intlayer astro-intlayer vanilla-intlayer
|
|
147
|
-
```
|
|
148
|
-
|
|
149
|
-
- **intlayer**
|
|
150
|
-
Gói cốt lõi cung cấp các công cụ i18n để quản lý cấu hình, bản dịch, [khai báo nội dung](https://github.com/aymericzip/intlayer/blob/main/docs/docs/vi/dictionary/content_file.md), chuyển mã và [các lệnh CLI](https://github.com/aymericzip/intlayer/blob/main/docs/docs/vi/cli/index.md).
|
|
151
|
-
|
|
152
|
-
- **astro-intlayer**
|
|
153
|
-
Plugin tích hợp Astro để kết nối Intlayer với [trình đóng gói Vite](https://vite.dev/guide/why.html#why-bundle-for-production); nó cũng bao gồm middleware để phát hiện ngôn ngữ ưa thích của người dùng, quản lý cookie và xử lý chuyển hướng URL.
|
|
154
|
-
|
|
155
|
-
- **vanilla-intlayer**
|
|
156
|
-
Gói để tích hợp Intlayer vào các ứng dụng Vanilla JavaScript / TypeScript. Nó cung cấp singleton Pub/Sub (`IntlayerClient`) và các hàm hỗ trợ dựa trên callback (`useIntlayer`, `useLocale`, v.v.) để bất kỳ phần nào trong `<script>` Astro của bạn cũng có thể phản ứng với các thay đổi ngôn ngữ mà không cần framework UI.
|
|
157
|
-
|
|
158
|
-
</Step>
|
|
159
|
-
<Step number={2} title="Cấu hình dự án của bạn">
|
|
160
|
-
|
|
161
|
-
Tạo một file cấu hình để xác định các ngôn ngữ của ứng dụng:
|
|
162
|
-
|
|
163
|
-
```typescript fileName="intlayer.config.ts"
|
|
164
|
-
import { Locales, type IntlayerConfig } from "intlayer";
|
|
165
|
-
|
|
166
|
-
const config: IntlayerConfig = {
|
|
167
|
-
internationalization: {
|
|
168
|
-
locales: [
|
|
169
|
-
Locales.ENGLISH,
|
|
170
|
-
Locales.FRENCH,
|
|
171
|
-
Locales.SPANISH,
|
|
172
|
-
Locales.VIETNAMESE,
|
|
173
|
-
// Các ngôn ngữ khác của bạn
|
|
174
|
-
],
|
|
175
|
-
defaultLocale: Locales.ENGLISH,
|
|
176
|
-
},
|
|
177
|
-
};
|
|
178
|
-
|
|
179
|
-
export default config;
|
|
180
|
-
```
|
|
181
|
-
|
|
182
|
-
> Thông qua file cấu hình này, bạn có thể thiết lập các URL bản địa hóa, chuyển hướng middleware, tên cookie, vị trí và phần mở rộng của các khai báo nội dung, tắt log Intlayer trong console, v.v. Để biết danh sách đầy đủ các tham số có sẵn, hãy xem [tài liệu cấu hình](https://github.com/aymericzip/intlayer/blob/main/docs/docs/vi/configuration.md).
|
|
183
|
-
|
|
184
|
-
</Step>
|
|
185
|
-
<Step number={3} title="Tích hợp Intlayer vào cấu hình Astro của bạn">
|
|
186
|
-
|
|
187
|
-
Thêm plugin `intlayer` vào cấu hình Astro của bạn. Không cần tích hợp thêm framework UI nào cho Vanilla JS.
|
|
188
|
-
|
|
189
|
-
```typescript fileName="astro.config.ts"
|
|
190
|
-
// @ts-check
|
|
191
|
-
|
|
192
|
-
import { intlayer } from "astro-intlayer";
|
|
193
|
-
import { defineConfig } from "astro/config";
|
|
194
|
-
|
|
195
|
-
// https://astro.build/config
|
|
196
|
-
export default defineConfig({
|
|
197
|
-
integrations: [intlayer()],
|
|
198
|
-
});
|
|
199
|
-
```
|
|
200
|
-
|
|
201
|
-
> Plugin tích hợp `intlayer()` được sử dụng để tích hợp Intlayer với Astro. Nó đảm bảo việc tạo các file khai báo nội dung và theo dõi chúng trong chế độ phát triển. Nó xác định các biến môi trường Intlayer bên trong ứng dụng Astro và cung cấp các alias để tối ưu hóa hiệu suất.
|
|
202
|
-
|
|
203
|
-
</Step>
|
|
204
|
-
<Step number={4} title="Khai báo nội dung của bạn">
|
|
205
|
-
|
|
206
|
-
Tạo và quản lý các khai báo nội dung của bạn để lưu trữ các bản dịch:
|
|
207
|
-
|
|
208
|
-
```typescript fileName="src/app.content.ts"
|
|
209
|
-
import { t, type Dictionary } from "intlayer";
|
|
210
|
-
|
|
211
|
-
const appContent = {
|
|
212
|
-
key: "app",
|
|
213
|
-
content: {
|
|
214
|
-
greeting: t({
|
|
215
|
-
en: "Hello World",
|
|
216
|
-
fr: "Bonjour le monde",
|
|
217
|
-
es: "Hola mundo",
|
|
218
|
-
vi: "Xin chào thế giới",
|
|
219
|
-
}),
|
|
220
|
-
description: t({
|
|
221
|
-
en: "Welcome to my multilingual Astro site.",
|
|
222
|
-
fr: "Bienvenue sur mon site Astro multilingue.",
|
|
223
|
-
es: "Bienvenido a mi sitio Astro multilingüe.",
|
|
224
|
-
vi: "Chào mừng bạn đến với trang web Astro đa ngôn ngữ của tôi.",
|
|
225
|
-
}),
|
|
226
|
-
switchLocale: t({
|
|
227
|
-
en: "Switch language:",
|
|
228
|
-
fr: "Changer de langue :",
|
|
229
|
-
es: "Cambiar idioma:",
|
|
230
|
-
vi: "Thay đổi ngôn ngữ:",
|
|
231
|
-
}),
|
|
232
|
-
},
|
|
233
|
-
} satisfies Dictionary;
|
|
234
|
-
|
|
235
|
-
export default appContent;
|
|
236
|
-
```
|
|
237
|
-
|
|
238
|
-
> Các khai báo nội dung có thể được định nghĩa ở bất kỳ đâu trong ứng dụng của bạn, miễn là chúng nằm trong `contentDir` (mặc định là `./src`) và khớp với phần mở rộng của file khai báo nội dung (mặc định là `.content.{json,ts,tsx,js,jsx,mjs,cjs,md,mdx,yaml,yml}`).
|
|
239
|
-
|
|
240
|
-
> Để biết thêm thông tin, hãy xem [tài liệu khai báo nội dung](https://github.com/aymericzip/intlayer/blob/main/docs/docs/vi/dictionary/content_file.md).
|
|
241
|
-
|
|
242
|
-
</Step>
|
|
243
|
-
<Step number={5} title="Sử dụng nội dung trong Astro">
|
|
244
|
-
|
|
245
|
-
Với Vanilla JS, tất cả các quá trình render phía máy chủ (SSR) diễn ra trực tiếp trong các file `.astro` bằng cách sử dụng `getIntlayer`. Sau đó, ở phía client, khối `<script>` khởi tạo thư viện `vanilla-intlayer` để cho phép chuyển đổi ngôn ngữ.
|
|
246
|
-
|
|
247
|
-
```astro fileName="src/pages/[...locale]/index.astro"
|
|
248
|
-
---
|
|
249
|
-
import {
|
|
250
|
-
getIntlayer,
|
|
251
|
-
getLocaleFromPath,
|
|
252
|
-
getLocalizedUrl,
|
|
253
|
-
getPrefix,
|
|
254
|
-
getLocaleName,
|
|
255
|
-
localeMap,
|
|
256
|
-
locales,
|
|
257
|
-
defaultLocale,
|
|
258
|
-
getPathWithoutLocale,
|
|
259
|
-
type LocalesValues,
|
|
260
|
-
} from "intlayer";
|
|
261
|
-
|
|
262
|
-
export const getStaticPaths = () => {
|
|
263
|
-
return localeMap(({ locale }) => ({
|
|
264
|
-
params: { locale: getPrefix(locale).localePrefix },
|
|
265
|
-
}));
|
|
266
|
-
};
|
|
267
|
-
|
|
268
|
-
const locale = getLocaleFromPath(Astro.url.pathname) as LocalesValues;
|
|
269
|
-
const pathWithoutLocale = getPathWithoutLocale(Astro.url.pathname);
|
|
270
|
-
const { greeting, description, switchLocale } = getIntlayer("app", locale);
|
|
271
|
-
---
|
|
272
|
-
|
|
273
|
-
<!doctype html>
|
|
274
|
-
<html lang={locale} dir={getHTMLTextDir(locale)}>
|
|
275
|
-
<head>
|
|
276
|
-
<meta charset="utf-8" />
|
|
277
|
-
<meta name="viewport" content="width=device-width" />
|
|
278
|
-
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
|
|
279
|
-
<title>{greeting}</title>
|
|
280
|
-
|
|
281
|
-
<!-- Liên kết Canonical -->
|
|
282
|
-
<link
|
|
283
|
-
rel="canonical"
|
|
284
|
-
href={new URL(getLocalizedUrl(Astro.url.pathname, locale), Astro.site)}
|
|
285
|
-
/>
|
|
286
|
-
|
|
287
|
-
<!-- Liên kết Hreflang -->
|
|
288
|
-
{
|
|
289
|
-
localeMap(({ locale: mapLocale }) => (
|
|
290
|
-
<link
|
|
291
|
-
rel="alternate"
|
|
292
|
-
hreflang={mapLocale}
|
|
293
|
-
href={new URL(
|
|
294
|
-
getLocalizedUrl(Astro.url.pathname, mapLocale),
|
|
295
|
-
Astro.site
|
|
296
|
-
)}
|
|
297
|
-
/>
|
|
298
|
-
))
|
|
299
|
-
}
|
|
300
|
-
|
|
301
|
-
<link
|
|
302
|
-
rel="alternate"
|
|
303
|
-
hreflang="x-default"
|
|
304
|
-
href={new URL(
|
|
305
|
-
getLocalizedUrl(Astro.url.pathname, defaultLocale),
|
|
306
|
-
Astro.site
|
|
307
|
-
)}
|
|
308
|
-
/>
|
|
309
|
-
</head>
|
|
310
|
-
<body>
|
|
311
|
-
<main>
|
|
312
|
-
<h1 id="greeting">{greeting}</h1>
|
|
313
|
-
<p id="description">{description}</p>
|
|
314
|
-
|
|
315
|
-
<div class="locale-switcher">
|
|
316
|
-
<span class="switcher-label">{switchLocale}</span>
|
|
317
|
-
<div class="locale-buttons">
|
|
318
|
-
{
|
|
319
|
-
locales.map((localeItem) => (
|
|
320
|
-
<a
|
|
321
|
-
href={localeItem === locale ? undefined : getLocalizedUrl(pathWithoutLocale, localeItem)}
|
|
322
|
-
class={`locale-btn ${localeItem === locale ? "active" : ""}`}
|
|
323
|
-
data-locale={localeItem}
|
|
324
|
-
aria-disabled={localeItem === locale}
|
|
325
|
-
>
|
|
326
|
-
{getLocaleName(localeItem)}
|
|
327
|
-
</a>
|
|
328
|
-
))
|
|
329
|
-
}
|
|
330
|
-
</div>
|
|
331
|
-
</div>
|
|
332
|
-
</main>
|
|
333
|
-
</body>
|
|
334
|
-
</html>
|
|
335
|
-
```
|
|
336
|
-
|
|
337
|
-
> Nếu bạn muốn sử dụng nội dung của mình trong một thuộc tính `chuỗi`, chẳng hạn như `alt`, `title`, `href`, `aria-label`, v. b., bạn có thể sử dụng giá trị của hàm, như:
|
|
338
|
-
|
|
339
|
-
> ```tsx
|
|
340
|
-
> <img src={content.image.src.value} alt={content.image.value} />
|
|
341
|
-
> <img src={content.image.src.toString()} alt={content.image.toString()} />
|
|
342
|
-
> <img src={String(content.image.src)} alt={String(content.image)} />
|
|
343
|
-
> ```
|
|
344
|
-
|
|
345
|
-
> **Lưu ý về thiết lập định tuyến:**
|
|
346
|
-
> Cấu trúc thư mục bạn sử dụng phụ thuộc vào cài đặt `middleware.routing` trong `intlayer.config.ts`:
|
|
347
|
-
>
|
|
348
|
-
> - **`prefix-no-default` (mặc định):** Giữ ngôn ngữ mặc định ở root (không có tiền tố) và thêm tiền tố cho các ngôn ngữ khác. Sử dụng `[...locale]` để bao gồm tất cả các trường hợp.
|
|
349
|
-
> - **`prefix-all`:** Tất cả các URL đều có tiền tố ngôn ngữ. Bạn có thể sử dụng `[locale]` tiêu chuẩn nếu không cần xử lý root riêng biệt.
|
|
350
|
-
> - **`search-param` hoặc `no-prefix`:** Không yêu cầu các thư mục ngôn ngữ. Ngôn ngữ được quản lý qua tham số truy vấn hoặc cookie.
|
|
351
|
-
|
|
352
|
-
</Step>
|
|
353
|
-
<Step number={6} title="Thêm bộ chuyển đổi ngôn ngữ">
|
|
354
|
-
|
|
355
|
-
Trong Astro với Vanilla JS, bộ chuyển đổi ngôn ngữ được tạo trên máy chủ dưới dạng các liên kết thông thường và được kích hoạt ở phía client thông qua khối `<script>`. Khi người dùng nhấp vào liên kết ngôn ngữ, `vanilla-intlayer` sẽ thiết lập cookie ngôn ngữ thông qua `setLocale` trước khi điều hướng đến URL bản địa hóa.
|
|
356
|
-
|
|
357
|
-
```astro fileName="src/pages/[...locale]/index.astro"
|
|
358
|
-
<!-- Bao gồm mã nguồn phía máy chủ từ Bước 5 tại đây -->
|
|
359
|
-
|
|
360
|
-
<script>
|
|
361
|
-
import { installIntlayer, useLocale } from "vanilla-intlayer";
|
|
362
|
-
import { getLocaleFromPath, getLocalizedUrl, type LocalesValues } from "intlayer";
|
|
363
|
-
|
|
364
|
-
// Khởi tạo Intlayer ở client với ngôn ngữ lấy từ đường dẫn hiện tại
|
|
365
|
-
const locale = getLocaleFromPath(window.location.pathname);
|
|
366
|
-
installIntlayer({ locale: locale as LocalesValues });
|
|
367
|
-
|
|
368
|
-
const { setLocale } = useLocale({
|
|
369
|
-
onLocaleChange: (newLocale: LocalesValues) => {
|
|
370
|
-
window.location.href = getLocalizedUrl(window.location.pathname, newLocale);
|
|
371
|
-
},
|
|
372
|
-
});
|
|
373
|
-
|
|
374
|
-
// Gắn sự kiện nhấp chuột cho các liên kết chuyển đổi ngôn ngữ
|
|
375
|
-
const localeLinks = document.querySelectorAll("[data-locale]");
|
|
376
|
-
localeLinks.forEach((link) => {
|
|
377
|
-
link.addEventListener("click", (e) => {
|
|
378
|
-
const localeValue = link.getAttribute("data-locale") as LocalesValues;
|
|
379
|
-
if (localeValue && localeValue !== locale) {
|
|
380
|
-
e.preventDefault();
|
|
381
|
-
setLocale(localeValue);
|
|
382
|
-
}
|
|
383
|
-
});
|
|
384
|
-
});
|
|
385
|
-
</script>
|
|
386
|
-
```
|
|
387
|
-
|
|
388
|
-
> **Lưu ý về tính bền vững:**
|
|
389
|
-
> `installIntlayer` khởi tạo singleton Intlayer với ngôn ngữ được định nghĩa bởi máy chủ. `useLocale` cùng với `onLocaleChange` đảm bảo cookie ngôn ngữ được thiết lập trước khi chuyển hướng thông qua middleware, cho phép ghi nhớ tùy chọn ngôn ngữ của người dùng cho các lần truy cập sau.
|
|
390
|
-
|
|
391
|
-
> **Lưu ý về Progressive Enhancement:**
|
|
392
|
-
> Các liên kết trong bộ chuyển đổi ngôn ngữ sẽ hoạt động như mã `<a>` tiêu chuẩn ngay cả khi không có JavaScript. Khi có JavaScript, lệnh gọi `setLocale` sẽ cập nhật cookie trước khi chuyển hướng, đảm bảo middleware xử lý đúng lựa chọn ngôn ngữ.
|
|
393
|
-
|
|
394
|
-
</Step>
|
|
395
|
-
<Step number={7} title="Sitemap và Robots.txt">
|
|
396
|
-
|
|
397
|
-
Intlayer cung cấp các tiện ích để tự động tạo sơ đồ trang web (sitemap) bản địa hóa và file robots.txt của bạn.
|
|
398
|
-
|
|
399
|
-
#### Sitemap
|
|
400
|
-
|
|
401
|
-
Intlayer comes with a built-in sitemap generator to help you create a sitemap for your application easily. It handles localized routes and adds the necessary metadata for search engines.
|
|
402
|
-
|
|
403
|
-
> The Intlayer generated sitemap supports the `xhtml:link` namespace (Hreflang XML Extensions). Unlike the default sitemap generators that only list raw URLs, Intlayer automatically creates the required bidirectional links between all language versions of a page (e.g., `/about`, `/about?lang=fr`, and `/about?lang=es`). This ensures search engines correctly index and serve the right language version to the right audience.
|
|
404
|
-
|
|
405
|
-
Tạo `src/pages/sitemap.xml.ts` để tạo sơ đồ trang web bao gồm tất cả các route bản địa hóa của bạn.
|
|
406
|
-
|
|
407
|
-
```typescript fileName="src/pages/sitemap.xml.ts"
|
|
408
|
-
import type { APIRoute } from "astro";
|
|
409
|
-
import { generateSitemap, type SitemapUrlEntry } from "intlayer";
|
|
410
|
-
|
|
411
|
-
const pathList: SitemapUrlEntry[] = [
|
|
412
|
-
{ path: "/", changefreq: "daily", priority: 1.0 },
|
|
413
|
-
{ path: "/about", changefreq: "monthly", priority: 0.7 },
|
|
414
|
-
];
|
|
415
|
-
|
|
416
|
-
const SITE_URL = import.meta.env.SITE ?? "http://localhost:4321";
|
|
417
|
-
|
|
418
|
-
export const GET: APIRoute = async ({ site }) => {
|
|
419
|
-
const xmlOutput = generateSitemap(pathList, { siteUrl: SITE_URL });
|
|
420
|
-
|
|
421
|
-
return new Response(xmlOutput, {
|
|
422
|
-
headers: { "Content-Type": "application/xml" },
|
|
423
|
-
});
|
|
424
|
-
};
|
|
425
|
-
```
|
|
426
|
-
|
|
427
|
-
#### Robots.txt
|
|
428
|
-
|
|
429
|
-
Tạo `src/pages/robots.txt.ts` để kiểm soát hoạt động thu thập thông tin của các công cụ tìm kiếm.
|
|
430
|
-
|
|
431
|
-
```typescript fileName="src/pages/robots.txt.ts"
|
|
432
|
-
import type { APIRoute } from "astro";
|
|
433
|
-
import { getMultilingualUrls } from "intlayer";
|
|
434
|
-
|
|
435
|
-
const getAllMultilingualUrls = (urls: string[]) =>
|
|
436
|
-
urls.flatMap((url) => Object.values(getMultilingualUrls(url)) as string[]);
|
|
437
|
-
|
|
438
|
-
const disallowedPaths = getAllMultilingualUrls(["/admin", "/private"]);
|
|
439
|
-
|
|
440
|
-
export const GET: APIRoute = ({ site }) => {
|
|
441
|
-
const robotsTxt = [
|
|
442
|
-
"User-agent: *",
|
|
443
|
-
"Allow: /",
|
|
444
|
-
...disallowedPaths.map((path) => `Disallow: ${path}`),
|
|
445
|
-
"",
|
|
446
|
-
`Sitemap: ${new URL("/sitemap.xml", site).href}`,
|
|
447
|
-
].join("\n");
|
|
448
|
-
|
|
449
|
-
return new Response(robotsTxt, {
|
|
450
|
-
headers: { "Content-Type": "text/plain" },
|
|
451
|
-
});
|
|
452
|
-
};
|
|
453
|
-
```
|
|
454
|
-
|
|
455
|
-
</Step>
|
|
456
|
-
<Step number={1} title="Trích xuất nội dung các thành phần của bạn" isOptional={true}>
|
|
457
|
-
|
|
458
|
-
Nếu bạn có một cơ sở mã hiện có, việc chuyển đổi hàng nghìn tệp có thể tốn nhiều thời gian.
|
|
459
|
-
|
|
460
|
-
Để đơn giản hóa quy trình này, Intlayer đề xuất một [trình biên dịch](https://github.com/aymericzip/intlayer/blob/main/docs/docs/vi/compiler.md) / [trình trích xuất](https://github.com/aymericzip/intlayer/blob/main/docs/docs/vi/cli/extract.md) để chuyển đổi các thành phần của bạn và trích xuất nội dung.
|
|
461
|
-
|
|
462
|
-
Để thiết lập, bạn có thể thêm phần `compiler` vào tệp `intlayer.config.ts` của mình:
|
|
463
|
-
|
|
464
|
-
```typescript fileName="intlayer.config.ts" codeFormat={["typescript", "esm", "commonjs"]}
|
|
465
|
-
import { type IntlayerConfig } from "intlayer";
|
|
466
|
-
|
|
467
|
-
const config: IntlayerConfig = {
|
|
468
|
-
// ... Phần còn lại của cấu hình
|
|
469
|
-
compiler: {
|
|
470
|
-
/**
|
|
471
|
-
* Cho biết trình biên dịch có nên được bật hay không.
|
|
472
|
-
*/
|
|
473
|
-
enabled: true,
|
|
474
|
-
|
|
475
|
-
/**
|
|
476
|
-
* Xác định đường dẫn các tệp đầu ra
|
|
477
|
-
*/
|
|
478
|
-
output: ({ fileName, extension }) => `./${fileName}${extension}`,
|
|
479
|
-
|
|
480
|
-
/**
|
|
481
|
-
* Cho biết các thành phần có nên được lưu sau khi chuyển đổi hay không. Bằng cách đó, trình biên dịch có thể được chạy chỉ một lần để chuyển đổi ứng dụng, sau đó có thể được gỡ bỏ.
|
|
482
|
-
*/
|
|
483
|
-
saveComponents: false,
|
|
484
|
-
|
|
485
|
-
/**
|
|
486
|
-
* Tiền tố khóa từ điển
|
|
487
|
-
*/
|
|
488
|
-
dictionaryKeyPrefix: "",
|
|
489
|
-
},
|
|
490
|
-
};
|
|
491
|
-
|
|
492
|
-
export default config;
|
|
493
|
-
```
|
|
494
|
-
|
|
495
|
-
<Tabs>
|
|
496
|
-
<Tab value='Lệnh trích xuất'>
|
|
497
|
-
|
|
498
|
-
Chạy trình trích xuất để chuyển đổi các thành phần và trích xuất nội dung
|
|
499
|
-
|
|
500
|
-
```bash packageManager="npm"
|
|
501
|
-
npx intlayer extract
|
|
502
|
-
```
|
|
503
|
-
|
|
504
|
-
```bash packageManager="pnpm"
|
|
505
|
-
pnpm intlayer extract
|
|
506
|
-
```
|
|
507
|
-
|
|
508
|
-
```bash packageManager="yarn"
|
|
509
|
-
yarn intlayer extract
|
|
510
|
-
```
|
|
511
|
-
|
|
512
|
-
```bash packageManager="bun"
|
|
513
|
-
bun x intlayer extract
|
|
514
|
-
```
|
|
515
|
-
|
|
516
|
-
</Tab>
|
|
517
|
-
<Tab value='Trình biên dịch Babel'>
|
|
518
|
-
|
|
519
|
-
> Since v9, the `intlayerCompiler` is included in the `intlayer` plugin. So you don't need to add it manually.
|
|
520
|
-
|
|
521
|
-
Cập nhật `vite.config.ts` của bạn để bao gồm plugin `intlayerCompiler`:
|
|
522
|
-
|
|
523
|
-
```ts fileName="vite.config.ts"
|
|
524
|
-
import { defineConfig } from "vite";
|
|
525
|
-
import { intlayer, intlayerCompiler } from "vite-intlayer";
|
|
526
|
-
|
|
527
|
-
export default defineConfig({
|
|
528
|
-
plugins: [
|
|
529
|
-
intlayer(),
|
|
530
|
-
intlayerCompiler(), // Adds the compiler plugin
|
|
531
|
-
],
|
|
532
|
-
});
|
|
533
|
-
```
|
|
534
|
-
|
|
535
|
-
```bash packageManager="npm"
|
|
536
|
-
npm run build # Hoặc npm run dev
|
|
537
|
-
```
|
|
538
|
-
|
|
539
|
-
```bash packageManager="pnpm"
|
|
540
|
-
pnpm run build # Or pnpm run dev
|
|
541
|
-
```
|
|
542
|
-
|
|
543
|
-
```bash packageManager="yarn"
|
|
544
|
-
yarn build # Or yarn dev
|
|
545
|
-
```
|
|
546
|
-
|
|
547
|
-
```bash packageManager="bun"
|
|
548
|
-
bun run build # Or bun run dev
|
|
549
|
-
```
|
|
550
|
-
|
|
551
|
-
</Tab>
|
|
552
|
-
</Tabs>
|
|
553
|
-
|
|
554
|
-
</Step>
|
|
555
|
-
|
|
556
|
-
</Steps>
|
|
557
|
-
|
|
558
|
-
### Cấu hình TypeScript
|
|
559
|
-
|
|
560
|
-
Intlayer sử dụng cơ chế mở rộng module (module augmentation) để tận dụng TypeScript, làm cho cơ sở mã của bạn mạnh mẽ hơn.
|
|
561
|
-
|
|
562
|
-

|
|
563
|
-
|
|
564
|
-

|
|
565
|
-
|
|
566
|
-
Đảm bảo cấu hình TypeScript của bạn bao gồm các kiểu dữ liệu được tạo tự động.
|
|
567
|
-
|
|
568
|
-
```json5 fileName="tsconfig.json"
|
|
569
|
-
{
|
|
570
|
-
// ... cấu hình TypeScript hiện tại của bạn
|
|
571
|
-
"include": [
|
|
572
|
-
// ... cấu hình TypeScript hiện tại của bạn
|
|
573
|
-
".intlayer/**/*.ts", // Bao gồm các kiểu dữ liệu được tạo tự động
|
|
574
|
-
],
|
|
575
|
-
}
|
|
576
|
-
```
|
|
577
|
-
|
|
578
|
-
### Cấu hình Git
|
|
579
|
-
|
|
580
|
-
Khuyên bạn nên bỏ qua các file được tạo bởi Intlayer. Điều này ngăn chúng được commit vào kho lưu trữ Git của bạn.
|
|
581
|
-
|
|
582
|
-
Để làm điều đó, hãy thêm các hướng dẫn sau vào file `.gitignore` của bạn:
|
|
583
|
-
|
|
584
|
-
```bash
|
|
585
|
-
# Bỏ qua các file được tạo bởi Intlayer
|
|
586
|
-
.intlayer
|
|
587
|
-
```
|
|
588
|
-
|
|
589
|
-
### Tiện ích mở rộng VS Code
|
|
590
|
-
|
|
591
|
-
Để cải thiện trải nghiệm phát triển của bạn với Intlayer, bạn có thể cài đặt **tiện ích mở rộng Intlayer chính thức cho VS Code**.
|
|
592
|
-
|
|
593
|
-
[Cài đặt từ VS Code Marketplace](https://marketplace.visualstudio.com/items?itemName=intlayer.intlayer-vs-code-extension)
|
|
594
|
-
|
|
595
|
-
Tiện ích này sẽ cung cấp:
|
|
596
|
-
|
|
597
|
-
- **Tự động hoàn thành** cho các khóa dịch.
|
|
598
|
-
- **Phát hiện lỗi thời gian thực** cho các bản dịch còn thiếu.
|
|
599
|
-
- **Xem trước trực tiếp** nội dung đã dịch.
|
|
600
|
-
- **Các hành động nhanh** để tạo và cập nhật bản dịch dễ dàng.
|
|
601
|
-
|
|
602
|
-
Để biết thêm thông tin về cách sử dụng tiện ích này, hãy xem [tài liệu tiện ích VS Code](https://intlayer.org/doc/vs-code-extension).
|
|
603
|
-
|
|
604
|
-
### Tìm hiểu sâu hơn
|
|
605
|
-
|
|
606
|
-
Nếu bạn muốn tìm hiểu thêm, bạn cũng có thể triển khai [Visual Editor](https://github.com/aymericzip/intlayer/blob/main/docs/docs/vi/intlayer_visual_editor.md) hoặc sử dụng [CMS](https://github.com/aymericzip/intlayer/blob/main/docs/docs/vi/intlayer_CMS.md) để quản lý nội dung bên ngoài.
|
|
607
|
-
|
|
608
|
-
## Các Câu Hỏi Thường Gặp
|
|
609
|
-
|
|
610
|
-
<FAQ>
|
|
611
|
-
|
|
612
|
-
<Question title="Những giải pháp khác nhau nào có sẵn để quốc tế hóa trang Astro không dùng framework UI?">
|
|
613
|
-
|
|
614
|
-
Tùy chọn `i18n` tích hợp của Astro quản lý tiền tố đường dẫn, nhưng để việc quản lý nội dung cho bạn:
|
|
615
|
-
|
|
616
|
-
- **Các đối tượng từ điển thủ công**: các đối tượng JSON/TS đơn giản được nhập trên từng trang: không có kiểm tra kiểu, quy tắc số nhiều hay công cụ kiểm tra.
|
|
617
|
-
- **`Intlayer`**: nội dung được khai báo cạnh component ([cục bộ hoặc tập trung](https://intlayer.org/blog/per-component-vs-centralized-i18n)), biên dịch lúc build, kiểm tra trong CI, hỗ trợ dịch thuật AI và visual editor.
|
|
618
|
-
|
|
619
|
-
Khi không dùng framework UI, bạn muốn tránh việc tải thư viện i18n ở runtime, và Intlayer giải quyết nội dung tại thời điểm build để trang tĩnh Astro chứa mã HTML hoàn chỉnh mà không kèm theo từ điển thừa. Xem [lý do chọn Intlayer](https://github.com/aymericzip/intlayer/blob/main/docs/docs/vi/interest_of_intlayer.md).
|
|
620
|
-
|
|
621
|
-
</Question>
|
|
622
|
-
<Question title="i18n làm tăng kích thước bundle Astro của tôi bao nhiêu?">
|
|
623
|
-
|
|
624
|
-
Ít hơn đáng kể so với các giải pháp dựa trên namespace, vì trang không bao giờ tải catalog mà nó không hiển thị. Các trang Astro được hiển thị tại thời điểm build, do đó chỉ có HTML đã dịch được gửi đi mà không kèm theo từ điển; chỉ các đảo (island) tương tác mới nhận từ điển. [Từ điển động](https://github.com/aymericzip/intlayer/blob/main/docs/docs/vi/dynamic_dictionaries/index.md) chia nội dung theo từng locale, giảm kích thước bundle tới 50%. Xem [tối ưu hóa bundle](https://github.com/aymericzip/intlayer/blob/main/docs/docs/vi/bundle_optimization.md) và [benchmark](https://github.com/aymericzip/intlayer/blob/main/docs/docs/vi/benchmark/index.md).
|
|
625
|
-
|
|
626
|
-
</Question>
|
|
627
|
-
<Question title="Tôi có thể di chuyển từ i18next hoặc các từ điển thủ công mà không cần viết lại component không?">
|
|
628
|
-
|
|
629
|
-
Phần lớn là có. Làm theo [hướng dẫn di chuyển từ i18next](https://github.com/aymericzip/intlayer/blob/main/docs/docs/vi/migration_from_i18next_to_intlayer.md).
|
|
630
|
-
|
|
631
|
-
</Question>
|
|
632
|
-
<Question title="Tôi có thể giữ các tệp dịch JSON hiện có của mình không?">
|
|
633
|
-
|
|
634
|
-
Có. Plugin [sync JSON](https://github.com/aymericzip/intlayer/blob/main/docs/docs/vi/plugins/sync-json.md) giữ cho các tệp `/messages/{locale}/{namespace}.json` của bạn là nguồn sự thật duy nhất và tạo các từ điển Intlayer từ chúng theo cả hai hướng. Plugin [sync PO](https://github.com/aymericzip/intlayer/blob/main/docs/docs/vi/plugins/sync-po.md) làm điều tương tự cho các catalog gettext, và [các tệp theo locale](https://github.com/aymericzip/intlayer/blob/main/docs/docs/vi/per_locale_file.md) cho phép bạn chia nội dung theo ngôn ngữ thay vì nhóm các locale trong một tệp.
|
|
635
|
-
|
|
636
|
-
</Question>
|
|
637
|
-
<Question title="Tôi có phải di chuyển nội dung từng khóa một không?">
|
|
638
|
-
|
|
639
|
-
Không. Chạy `npx intlayer extract` và Intlayer sẽ đọc các tệp của bạn, trích xuất các chuỗi dành cho người dùng và tạo tệp `.content` bên cạnh mỗi tệp, nhờ đó bạn xem lại diff thay vì sao chép chuỗi vào catalog thủ công. Bước 15 của hướng dẫn này mô tả chi tiết.
|
|
640
|
-
|
|
641
|
-
Để tự động hóa hoàn toàn, [Intlayer Compiler](https://github.com/aymericzip/intlayer/blob/main/docs/docs/vi/compiler.md) thực hiện việc tương tự trong quá trình build: quét mã nguồn trên mỗi thay đổi, tạo từ điển và đồng bộ hóa với HMR.
|
|
642
|
-
|
|
643
|
-
Hai giới hạn đáng lưu ý trước khi bạn bật compiler. Nó hoạt động bằng phân tích tĩnh, do đó các chuỗi chỉ tồn tại khi runtime, chẳng hạn như mã lỗi API hoặc các trường CMS, nằm ngoài phạm vi tiếp cận. Và nó phải phân biệt văn bản hiển thị cho người dùng với logic ứng dụng như `className="active"` hoặc mã trạng thái, điều này cần một vài chú thích trong một codebase lớn. [Lệnh extract](https://github.com/aymericzip/intlayer/blob/main/docs/docs/vi/cli/extract.md) tránh cả hai điều này bằng cách giữ bạn luôn kiểm soát.
|
|
644
|
-
|
|
645
|
-
</Question>
|
|
646
|
-
<Question title="Có những công cụ editor và AI agent nào có sẵn?">
|
|
647
|
-
|
|
648
|
-
Năm công cụ, tất cả đều là tùy chọn:
|
|
649
|
-
|
|
650
|
-
- **[VS Code extension](https://github.com/aymericzip/intlayer/blob/main/docs/docs/vi/vs_code_extension.md)**: nhảy từ khóa `useIntlayer` đến tệp nội dung khai báo nó, trích xuất nội dung từ component, và chạy build, fill, test, push và pull từ command palette hoặc tab Intlayer.
|
|
651
|
-
- **[LSP server](https://github.com/aymericzip/intlayer/blob/main/docs/docs/vi/lsp.md)**: trải nghiệm tương tự trong bất kỳ trình soạn thảo nào hỗ trợ LSP, với go to definition, xem trước giá trị bản dịch khi hover, tự động hoàn thành khóa, và cảnh báo khi khóa chưa được khai báo. Hỗ trợ cả các lệnh gọi `i18next`, `react-i18next`, `next-intl` và `use-intl`.
|
|
652
|
-
- **[MCP server](https://github.com/aymericzip/intlayer/blob/main/docs/docs/vi/mcp_server.md)**: cung cấp tài liệu và CLI Intlayer cho Cursor, VS Code, Claude Desktop, Claude Code và ChatGPT.
|
|
653
|
-
- **[Agent skills](https://github.com/aymericzip/intlayer/blob/main/docs/docs/vi/agent_skills.md)**: các kỹ năng chuyên biệt như `intlayer-config`, `intlayer-cli` và `intlayer-content`.
|
|
654
|
-
- **[ESLint plugin](https://github.com/aymericzip/intlayer/blob/main/docs/docs/vi/eslint.md)**: quy tắc `no-raw-text` phát hiện các chuỗi chưa được bản địa hóa.
|
|
655
|
-
|
|
656
|
-
</Question>
|
|
657
|
-
<Question title="Tôi có cần JavaScript trên trang để các bản dịch hoạt động không?">
|
|
658
|
-
|
|
659
|
-
Không. Các trang Astro được render tại thời điểm build và Intlayer giải quyết nội dung trong quá trình render đó, do đó HTML được tạo ra đã chứa sẵn văn bản dịch. Gói `vanilla-intlayer` chỉ cần thiết cho những phần bạn muốn tạo tương tác trong trình duyệt.
|
|
660
|
-
|
|
661
|
-
</Question>
|
|
662
|
-
<Question title="Tôi có thể thêm các đảo tương tác sau này mà không cần thay đổi nội dung không?">
|
|
663
|
-
|
|
664
|
-
Có, đó là mục tiêu chính của một lớp nội dung duy nhất. Cùng một khai báo được đọc bởi `astro-intlayer` trên trang và bởi các framework binding khi bạn thêm đảo, cho dù là [React](https://github.com/aymericzip/intlayer/blob/main/docs/docs/vi/intlayer_with_astro_react.md), [Vue](https://github.com/aymericzip/intlayer/blob/main/docs/docs/vi/intlayer_with_astro_vue.md), [Svelte](https://github.com/aymericzip/intlayer/blob/main/docs/docs/vi/intlayer_with_astro_svelte.md), [Solid](https://github.com/aymericzip/intlayer/blob/main/docs/docs/vi/intlayer_with_astro_solid.md), [Preact](https://github.com/aymericzip/intlayer/blob/main/docs/docs/vi/intlayer_with_astro_preact.md), hay [Lit](https://github.com/aymericzip/intlayer/blob/main/docs/docs/vi/intlayer_with_astro_lit.md).
|
|
665
|
-
|
|
666
|
-
</Question>
|
|
667
|
-
<Question title="Làm cách nào để thiết lập định tuyến được bản địa hóa và bộ chuyển đổi ngôn ngữ?">
|
|
668
|
-
|
|
669
|
-
Các bước 6 và 7 của hướng dẫn này giải thích điều đó. `routing.mode` kiểm soát xem ngôn ngữ mặc định có tiền tố (`"prefix-no-default"`), tất cả ngôn ngữ đều có tiền tố (`"prefix-all"`), hay ngôn ngữ độc lập với đường dẫn (`"no-prefix"`). `getLocalizedUrl` chuyển đổi đường dẫn hiện tại sang ngôn ngữ đích mà vẫn giữ người truy cập ở nguyên trang đó.
|
|
670
|
-
|
|
671
|
-
</Question>
|
|
672
|
-
<Question title="Làm cách nào để tạo sitemap được bản địa hóa và thẻ hreflang?">
|
|
673
|
-
|
|
674
|
-
Bước 8 hướng dẫn cấu hình `sitemap.xml` và `robots.txt`. Hàm `getMultilingualUrls` tạo các liên kết thay thế cho mỗi locale đã khai báo, bao gồm cả `x-default`, giúp công cụ tìm kiếm lập chỉ mục chính xác.
|
|
675
|
-
|
|
676
|
-
</Question>
|
|
677
|
-
<Question title="Làm cách nào tôi có thể dịch trang web tự động bằng AI?">
|
|
678
|
-
|
|
679
|
-
Chạy `npx intlayer fill`. Lệnh này điền các bản dịch còn thiếu bằng LLM bạn chọn sử dụng provider và API key của riêng bạn, và `--git-diff` giới hạn thao tác ở các tệp đã thay đổi. Xem [lệnh fill](https://github.com/aymericzip/intlayer/blob/main/docs/docs/vi/cli/fill.md) và [tích hợp CI/CD](https://github.com/aymericzip/intlayer/blob/main/docs/docs/vi/CI_CD.md).
|
|
680
|
-
|
|
681
|
-
</Question>
|
|
682
|
-
<Question title="Intlayer có hỗ trợ dạng số nhiều, giới tính và rich text không?">
|
|
683
|
-
|
|
684
|
-
Có: [dạng số nhiều (plurals)](https://github.com/aymericzip/intlayer/blob/main/docs/docs/vi/dictionary/plurial.md), [nội dung dựa trên giới tính](https://github.com/aymericzip/intlayer/blob/main/docs/docs/vi/dictionary/gender.md), điều kiện, [chèn (insertions)](https://github.com/aymericzip/intlayer/blob/main/docs/docs/vi/dictionary/insertion.md), và [định dạng](https://github.com/aymericzip/intlayer/blob/main/docs/docs/vi/formatters.md) cho số, ngày tháng và tiền tệ.
|
|
685
|
-
|
|
686
|
-
</Question>
|
|
687
|
-
<Question title="Làm thế nào người dịch có thể chỉnh sửa nội dung mà không cần chạm vào mã nguồn?">
|
|
688
|
-
|
|
689
|
-
Thông qua [visual editor](https://github.com/aymericzip/intlayer/blob/main/docs/docs/vi/intlayer_visual_editor.md), cho phép bất kỳ ai chỉnh sửa văn bản trực tiếp trên ứng dụng đang chạy, hoặc qua [CMS](https://github.com/aymericzip/intlayer/blob/main/docs/docs/vi/intlayer_CMS.md), giúp tách biệt nội dung để cập nhật mà không cần triển khai lại mã nguồn.
|
|
690
|
-
|
|
691
|
-
</Question>
|
|
692
|
-
<Question title="Chi phí của trình chỉnh sửa trực quan là bao nhiêu? Nó có dư thừa nếu tôi không cần đến không?">
|
|
693
|
-
|
|
694
|
-
[Trình chỉnh sửa trực quan Intlayer](https://github.com/aymericzip/intlayer/blob/main/docs/docs/vi/intlayer_visual_editor.md) có **chi phí bằng không** đối với ứng dụng của bạn nếu không được thiết lập. Logic bổ sung chỉ được tải nếu được bật rõ ràng và khi cần thiết.
|
|
695
|
-
|
|
696
|
-
Ngay cả khi được bật, chi phí cũng cực kỳ nhẹ (+5 KB, chỉ tải động khi được kích hoạt) vì phần lớn logic được xử lý bởi trình chỉnh sửa máy chủ trên [app.intlayer.org](https://app.intlayer.org) hoặc thông qua gói `intlayer-editor`. Nếu bạn chỉ cần một giải pháp dịch thuật đơn giản mà không cần chỉnh sửa trực quan, Intlayer sẽ không tạo ra bất kỳ tải phụ nào cho ứng dụng của bạn.
|
|
697
|
-
|
|
698
|
-
</Question>
|
|
699
|
-
<Question title="Intlayer có phải là mã nguồn mở và miễn phí không?">
|
|
700
|
-
|
|
701
|
-
Có, theo giấy phép Apache 2.0, bao gồm cả mục đích thương mại. CMS lưu trữ trên đám mây là một dịch vụ trả phí tùy chọn và cũng có thể [tự lưu trữ (self-host)](https://github.com/aymericzip/intlayer/blob/main/docs/docs/vi/self_hosting.md).
|
|
702
|
-
|
|
703
|
-
</Question>
|
|
704
|
-
|
|
705
|
-
</FAQ>
|