@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,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
createdAt: 2026-03-23
|
|
3
|
-
updatedAt: 2026-
|
|
3
|
+
updatedAt: 2026-09-20
|
|
4
4
|
title: "Vite + Vanilla JS i18n - Hướng dẫn đầy đủ để dịch ứng dụng của bạn"
|
|
5
5
|
description: "Không còn i18next nữa. Hướng dẫn 2026 để xây dựng ứng dụng Vite + 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
6
|
keywords:
|
|
@@ -613,8 +613,14 @@ bun x intlayer extract
|
|
|
613
613
|
</Tab>
|
|
614
614
|
<Tab value='Trình biên dịch Babel'>
|
|
615
615
|
|
|
616
|
+
<Tabs>
|
|
617
|
+
<Tab value='intlayer >= 9'>
|
|
618
|
+
|
|
616
619
|
> Since v9, the `intlayerCompiler` is included in the `intlayer` plugin. So you don't need to add it manually.
|
|
617
620
|
|
|
621
|
+
</Tab>
|
|
622
|
+
<Tab value='intlayer < 9'>
|
|
623
|
+
|
|
618
624
|
Cập nhật `vite.config.ts` của bạn để bao gồm plugin `intlayerCompiler`:
|
|
619
625
|
|
|
620
626
|
```ts fileName="vite.config.ts"
|
|
@@ -629,6 +635,11 @@ export default defineConfig({
|
|
|
629
635
|
});
|
|
630
636
|
```
|
|
631
637
|
|
|
638
|
+
</Tab>
|
|
639
|
+
</Tabs>
|
|
640
|
+
|
|
641
|
+
Build ứng dụng của bạn để chuyển đổi các thành phần và trích xuất nội dung
|
|
642
|
+
|
|
632
643
|
```bash packageManager="npm"
|
|
633
644
|
npm run build # Hoặc npm run dev
|
|
634
645
|
```
|
|
@@ -685,7 +696,9 @@ const pathList = [
|
|
|
685
696
|
{ path: "/about", changefreq: "monthly", priority: 0.7 },
|
|
686
697
|
];
|
|
687
698
|
|
|
688
|
-
const sitemapXml = generateSitemap(pathList, {
|
|
699
|
+
const sitemapXml = generateSitemap(pathList, {
|
|
700
|
+
siteUrl: "https://example.com",
|
|
701
|
+
});
|
|
689
702
|
fs.writeFileSync(path.join(__dirname, "public", "sitemap.xml"), sitemapXml);
|
|
690
703
|
|
|
691
704
|
const getAllMultilingualUrls = (urls) =>
|
|
@@ -698,7 +711,7 @@ const robotsTxt = [
|
|
|
698
711
|
"Allow: /",
|
|
699
712
|
...disallowedPaths.map((path) => `Disallow: ${path}`),
|
|
700
713
|
"",
|
|
701
|
-
`Sitemap:
|
|
714
|
+
`Sitemap: https://example.com/sitemap.xml`,
|
|
702
715
|
].join("\n");
|
|
703
716
|
|
|
704
717
|
fs.writeFileSync(path.join(__dirname, "public", "robots.txt"), robotsTxt);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
createdAt: 2025-04-18
|
|
3
|
-
updatedAt: 2026-
|
|
3
|
+
updatedAt: 2026-09-20
|
|
4
4
|
title: "Vite + Vue i18n - Hướng dẫn đầy đủ để dịch ứng dụng của bạn"
|
|
5
5
|
description: "Không còn i18next nữa. Hướng dẫn 2026 để xây dựng ứng dụng Vite + Vue đ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
6
|
keywords:
|
|
@@ -982,8 +982,14 @@ bun x intlayer extract
|
|
|
982
982
|
</Tab>
|
|
983
983
|
<Tab value='Trình biên dịch Babel'>
|
|
984
984
|
|
|
985
|
+
<Tabs>
|
|
986
|
+
<Tab value='intlayer >= 9'>
|
|
987
|
+
|
|
985
988
|
> Since v9, the `intlayerCompiler` is included in the `intlayer` plugin. So you don't need to add it manually.
|
|
986
989
|
|
|
990
|
+
</Tab>
|
|
991
|
+
<Tab value='intlayer < 9'>
|
|
992
|
+
|
|
987
993
|
Cập nhật `vite.config.ts` của bạn để bao gồm plugin `intlayerCompiler`:
|
|
988
994
|
|
|
989
995
|
```ts fileName="vite.config.ts"
|
|
@@ -998,6 +1004,11 @@ export default defineConfig({
|
|
|
998
1004
|
});
|
|
999
1005
|
```
|
|
1000
1006
|
|
|
1007
|
+
</Tab>
|
|
1008
|
+
</Tabs>
|
|
1009
|
+
|
|
1010
|
+
Build ứng dụng của bạn để chuyển đổi các thành phần và trích xuất nội dung
|
|
1011
|
+
|
|
1001
1012
|
```bash packageManager="npm"
|
|
1002
1013
|
npm run build # Hoặc npm run dev
|
|
1003
1014
|
```
|
|
@@ -1054,7 +1065,9 @@ const pathList = [
|
|
|
1054
1065
|
{ path: "/about", changefreq: "monthly", priority: 0.7 },
|
|
1055
1066
|
];
|
|
1056
1067
|
|
|
1057
|
-
const sitemapXml = generateSitemap(pathList, {
|
|
1068
|
+
const sitemapXml = generateSitemap(pathList, {
|
|
1069
|
+
siteUrl: "https://example.com",
|
|
1070
|
+
});
|
|
1058
1071
|
fs.writeFileSync(path.join(__dirname, "public", "sitemap.xml"), sitemapXml);
|
|
1059
1072
|
|
|
1060
1073
|
const getAllMultilingualUrls = (urls) =>
|
|
@@ -1067,7 +1080,7 @@ const robotsTxt = [
|
|
|
1067
1080
|
"Allow: /",
|
|
1068
1081
|
...disallowedPaths.map((path) => `Disallow: ${path}`),
|
|
1069
1082
|
"",
|
|
1070
|
-
`Sitemap:
|
|
1083
|
+
`Sitemap: https://example.com/sitemap.xml`,
|
|
1071
1084
|
].join("\n");
|
|
1072
1085
|
|
|
1073
1086
|
fs.writeFileSync(path.join(__dirname, "public", "robots.txt"), robotsTxt);
|
package/docs/vi/introduction.md
CHANGED
|
@@ -189,7 +189,6 @@ Chúng tôi đã xây dựng Intlayer với tính linh hoạt cao, cung cấp kh
|
|
|
189
189
|
- **[Intlayer với Astro + Solid](https://github.com/aymericzip/intlayer/blob/main/docs/docs/vi/intlayer_with_astro_solid.md)**
|
|
190
190
|
- **[Intlayer với Astro + Preact](https://github.com/aymericzip/intlayer/blob/main/docs/docs/vi/intlayer_with_astro_preact.md)**
|
|
191
191
|
- **[Intlayer với Astro + Lit](https://github.com/aymericzip/intlayer/blob/main/docs/docs/vi/intlayer_with_astro_lit.md)**
|
|
192
|
-
- **[Intlayer với Astro + Vanilla JS](https://github.com/aymericzip/intlayer/blob/main/docs/docs/vi/intlayer_with_astro_vanilla.md)**
|
|
193
192
|
- **[Intlayer với Vite + Vue](https://github.com/aymericzip/intlayer/blob/main/docs/docs/vi/intlayer_with_vite+vue.md)**
|
|
194
193
|
- **[Intlayer với Nuxt](https://github.com/aymericzip/intlayer/blob/main/docs/docs/vi/intlayer_with_nuxt.md)**
|
|
195
194
|
- **[Intlayer với Vite + Svelte](https://github.com/aymericzip/intlayer/blob/main/docs/docs/vi/intlayer_with_vite+svelte.md)**
|
package/docs/vi/readme.md
CHANGED
|
@@ -212,7 +212,6 @@ Khám phá tài liệu toàn diện của chúng tôi để bắt đầu với I
|
|
|
212
212
|
<li><a href="https://intlayer.org/doc/environment/astro/vue" rel=''>Vue</a></li>
|
|
213
213
|
<li><a href="https://intlayer.org/doc/environment/astro/svelte" rel=''>Svelte</a></li>
|
|
214
214
|
<li><a href="https://intlayer.org/doc/environment/astro/solid" rel=''>Solid</a></li>
|
|
215
|
-
<li><a href="https://intlayer.org/doc/environment/astro/vanilla" rel=''>Vanilla JS</a></li>
|
|
216
215
|
<li><a href="https://intlayer.org/doc/environment/astro/lit" rel=''>Lit</a></li>
|
|
217
216
|
</ul>
|
|
218
217
|
</li>
|
package/docs/vi/releases/v8.md
CHANGED
|
@@ -1328,10 +1328,6 @@ Intlayer hiện tự động tạo sitemap dựa trên các locale và chế đ
|
|
|
1328
1328
|
import { createFileRoute } from "@tanstack/react-router";
|
|
1329
1329
|
import { generateSitemap } from "intlayer";
|
|
1330
1330
|
|
|
1331
|
-
const SITE_URL = (
|
|
1332
|
-
import.meta.env.VITE_SITE_URL ?? "http://localhost:3000"
|
|
1333
|
-
).replace(/\/$/, "");
|
|
1334
|
-
|
|
1335
1331
|
export const Route = createFileRoute("/sitemap.xml")({
|
|
1336
1332
|
server: {
|
|
1337
1333
|
handlers: {
|
|
@@ -1341,7 +1337,7 @@ export const Route = createFileRoute("/sitemap.xml")({
|
|
|
1341
1337
|
{ path: "/", changefreq: "daily", priority: 1.0 },
|
|
1342
1338
|
{ path: "/about", changefreq: "monthly", priority: 0.8 },
|
|
1343
1339
|
],
|
|
1344
|
-
{ siteUrl:
|
|
1340
|
+
{ siteUrl: "https://example.com" }
|
|
1345
1341
|
);
|
|
1346
1342
|
|
|
1347
1343
|
return new Response(sitemap, {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
createdAt: 2024-03-07
|
|
3
|
-
updatedAt: 2026-09-
|
|
3
|
+
updatedAt: 2026-09-20
|
|
4
4
|
title: "Astro i18n - 翻译你的应用的完整指南"
|
|
5
5
|
description: "告别 i18next。2026 年构建多语言 (i18n) Astro 应用的完整指南。使用 AI 代理翻译并优化包体积、SEO 和性能。"
|
|
6
6
|
keywords:
|
|
@@ -401,7 +401,7 @@ const pathWithoutLocale = getPathWithoutLocale(Astro.url.pathname);
|
|
|
401
401
|
```
|
|
402
402
|
|
|
403
403
|
> **持久化注意事项:**
|
|
404
|
-
> 客户端 `useLocale` 中的 `setLocale` 将用户的语言偏好保存在
|
|
404
|
+
> 客户端 `useLocale` 中的 `setLocale` 将用户的语言偏好保存在 cookie 中。这使 Intlayer 能够记住该选择,并在将来的访问中自动将用户重定向到其首选语言:按需渲染的页面(带有 `output: 'server'` 或 `prerender = false` 的适配器)在发送任何 HTML 之前由 Intlayer 中间件重定向,而作为静态文件提供的预渲染页面则由集成注入每个页面的小脚本重定向。将 `routing.enableProxy` 设置为 `false` 可同时关闭两者。在 `astro dev` 中,除非将 `routing.enableProxy` 设置为 `true`,否则 cookie 将被忽略作为重定向来源,因此过期的 cookie 不会劫持你正在处理的页面。
|
|
405
405
|
>
|
|
406
406
|
> **服务端 / 客户端互兼容性:**
|
|
407
407
|
> `astro-intlayer` 在 frontmatter 中解析为服务端钩子(读取 `Astro.locals`),在 `<script>` 块和孤岛(islands)中解析为 `vanilla-intlayer` 的客户端钩子,具有相同的名称和内容结构。`setLocale` 和 `onChange` 仅在客户端起作用,在客户端调用一次 `installIntlayer()` 以初始化客户端存储。`astro-intlayer/client` 显式公开客户端入口。
|
|
@@ -428,10 +428,10 @@ const pathList: SitemapUrlEntry[] = [
|
|
|
428
428
|
{ path: "/about", changefreq: "monthly", priority: 0.7 },
|
|
429
429
|
];
|
|
430
430
|
|
|
431
|
-
const SITE_URL = import.meta.env.SITE ?? "http://localhost:4321";
|
|
432
|
-
|
|
433
431
|
export const GET: APIRoute = async ({ site }) => {
|
|
434
|
-
const xmlOutput = generateSitemap(pathList, {
|
|
432
|
+
const xmlOutput = generateSitemap(pathList, {
|
|
433
|
+
siteUrl: "https://example.com",
|
|
434
|
+
});
|
|
435
435
|
|
|
436
436
|
return new Response(xmlOutput, {
|
|
437
437
|
headers: { "Content-Type": "application/xml" },
|
|
@@ -478,7 +478,6 @@ export const GET: APIRoute = ({ site }) => {
|
|
|
478
478
|
- Intlayer + Solid: [Intlayer with Solid](https://github.com/aymericzip/intlayer/blob/main/docs/docs/zh/intlayer_with_astro_solid.md)
|
|
479
479
|
- Intlayer + Preact: [Intlayer with Preact](https://github.com/aymericzip/intlayer/blob/main/docs/docs/zh/intlayer_with_astro_preact.md)
|
|
480
480
|
- Intlayer + Lit: [Intlayer with Lit](https://github.com/aymericzip/intlayer/blob/main/docs/docs/zh/intlayer_with_astro_lit.md)
|
|
481
|
-
- Intlayer + Vanilla JS: [Intlayer with Vanilla JS](https://github.com/aymericzip/intlayer/blob/main/docs/docs/zh/intlayer_with_astro_vanilla.md)
|
|
482
481
|
</Step>
|
|
483
482
|
|
|
484
483
|
<Step number={15} title="提取组件中的内容" isOptional={true}>
|
|
@@ -544,21 +543,7 @@ bun x intlayer extract
|
|
|
544
543
|
</Tab>
|
|
545
544
|
<Tab value='Babel 编译器'>
|
|
546
545
|
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
更新您的 `vite.config.ts` 以包含 `intlayerCompiler` 插件:
|
|
550
|
-
|
|
551
|
-
```ts fileName="vite.config.ts"
|
|
552
|
-
import { defineConfig } from "vite";
|
|
553
|
-
import { intlayer, intlayerCompiler } from "vite-intlayer";
|
|
554
|
-
|
|
555
|
-
export default defineConfig({
|
|
556
|
-
plugins: [
|
|
557
|
-
intlayer(),
|
|
558
|
-
intlayerCompiler(), // Adds the compiler plugin
|
|
559
|
-
],
|
|
560
|
-
});
|
|
561
|
-
```
|
|
546
|
+
构建你的应用程序来转换你的组件并提取内容
|
|
562
547
|
|
|
563
548
|
```bash packageManager="npm"
|
|
564
549
|
npm run build # 或 npm run dev
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
createdAt: 2026-04-24
|
|
3
|
-
updatedAt: 2026-
|
|
3
|
+
updatedAt: 2026-09-20
|
|
4
4
|
title: "Astro + Lit i18n - 翻译你的应用的完整指南"
|
|
5
5
|
description: "告别 i18next。2026 年构建多语言 (i18n) Astro + Lit 应用的完整指南。使用 AI 代理翻译并优化包体积、SEO 和性能。"
|
|
6
6
|
keywords:
|
|
@@ -20,6 +20,9 @@ slugs:
|
|
|
20
20
|
applicationTemplate: https://github.com/aymericzip/intlayer-astro-template
|
|
21
21
|
applicationShowcase: https://intlayer-astro-template.vercel.app
|
|
22
22
|
history:
|
|
23
|
+
- version: 9.5.5
|
|
24
|
+
date: 2026-09-19
|
|
25
|
+
changes: "在 Astro 页面中使用 astro-intlayer 的 useIntlayer / useLocale 钩子"
|
|
23
26
|
- version: 8.9.0
|
|
24
27
|
date: 2026-05-04
|
|
25
28
|
changes: "更新 Solid useIntlayer API 用法以直接访问属性"
|
|
@@ -151,7 +154,7 @@ bun add intlayer astro-intlayer lit lit-intlayer @astrojs/lit
|
|
|
151
154
|
核心软件包,提供用于配置管理、翻译、[内容声明](https://github.com/aymericzip/intlayer/blob/main/docs/docs/zh/dictionary/content_file.md)、编译和 [CLI 命令](https://github.com/aymericzip/intlayer/blob/main/docs/docs/zh/cli/index.md)的国际化工具。
|
|
152
155
|
|
|
153
156
|
- **astro-intlayer**
|
|
154
|
-
|
|
157
|
+
包含用于将 Intlayer 与 [Vite 打包器](https://vite.dev/guide/why.html#why-bundle-for-production) 集成的 Astro 集成插件、将每个请求的语言环境解析到 `Astro.locals.intlayer` 的中间件,以及 `useIntlayer` / `useDictionary` / `useLocale` 钩子。相同的导入路径在 `.astro` frontmatter 中解析为服务端实现,在 `<script>` 块中解析为客户端实现(由 `vanilla-intlayer` 支持)。
|
|
155
158
|
|
|
156
159
|
- **lit**
|
|
157
160
|
核心 Lit 软件包,用于构建快速且轻量级的 Web Components。
|
|
@@ -245,19 +248,21 @@ export default litDemoContent;
|
|
|
245
248
|
</Step>
|
|
246
249
|
<Step number={5} title="在 Astro 中使用内容">
|
|
247
250
|
|
|
248
|
-
|
|
251
|
+
使用 `astro-intlayer` 导出的钩子在 `.astro` 文件中使用你的字典。它们与 `react-intlayer` 具有相同的签名:`useIntlayer("key")` 返回字典内容,`useLocale()` 返回当前语言环境,无需传递参数。
|
|
252
|
+
|
|
253
|
+
语言环境来自 `astro-intlayer` 中间件,集成会自动在你的 `src/middleware.ts` 之前注册该中间件。它会依次从 URL 前缀、客户端持久化的语言环境(Cookie 或标头)、`Accept-Language` 解析每个请求的语言环境,并将其存储在 `Astro.locals.intlayer` 中。预渲染页面仅使用 URL,因为它们只为每个访客渲染一次。
|
|
254
|
+
|
|
255
|
+
Lit 自定义元素通过客户端 `<script>` 导入并放置在 body 中。
|
|
249
256
|
|
|
250
257
|
```astro fileName="src/pages/[...locale]/index.astro"
|
|
251
258
|
---
|
|
259
|
+
import { useIntlayer, useLocale } from "astro-intlayer";
|
|
252
260
|
import {
|
|
253
|
-
getIntlayer,
|
|
254
|
-
getLocaleFromPath,
|
|
255
261
|
getLocalizedUrl,
|
|
256
|
-
getHTMLTextDir,
|
|
257
262
|
getPrefix,
|
|
258
263
|
localeMap,
|
|
259
264
|
defaultLocale,
|
|
260
|
-
|
|
265
|
+
getHTMLTextDir,
|
|
261
266
|
} from "intlayer";
|
|
262
267
|
|
|
263
268
|
export const getStaticPaths = () => {
|
|
@@ -266,8 +271,11 @@ export const getStaticPaths = () => {
|
|
|
266
271
|
}));
|
|
267
272
|
};
|
|
268
273
|
|
|
269
|
-
|
|
270
|
-
const {
|
|
274
|
+
// 中间件解析的语言环境(例如 /zh/about -> 'zh')
|
|
275
|
+
const { locale } = useLocale();
|
|
276
|
+
|
|
277
|
+
// 该语言环境的 'lit-demo' 字典内容
|
|
278
|
+
const { greeting } = useIntlayer("lit-demo");
|
|
271
279
|
---
|
|
272
280
|
|
|
273
281
|
<!doctype html>
|
|
@@ -326,6 +334,8 @@ const { greeting } = getIntlayer("lit-demo", locale);
|
|
|
326
334
|
> <img src={String(content.image.src)} alt={String(content.image)} />
|
|
327
335
|
> ```
|
|
328
336
|
|
|
337
|
+
> `Astro.locals.intlayer` 还向你自己的中间件和端点公开 `locale`、`defaultLocale` 和 `availableLocales`。将语言环境或选择器作为第二个参数传递(`useIntlayer("app", "fr")`、`useIntlayer("faq", { item: 2 })`)可在单次调用中覆盖请求语言环境。
|
|
338
|
+
|
|
329
339
|
> **关于路由设置的说明:**
|
|
330
340
|
> 您使用的目录结构取决于 `intlayer.config.ts` 中的 `middleware.routing` 设置:
|
|
331
341
|
>
|
|
@@ -482,10 +492,10 @@ const pathList: SitemapUrlEntry[] = [
|
|
|
482
492
|
{ path: "/about", changefreq: "monthly", priority: 0.7 },
|
|
483
493
|
];
|
|
484
494
|
|
|
485
|
-
const SITE_URL = import.meta.env.SITE ?? "http://localhost:4321";
|
|
486
|
-
|
|
487
495
|
export const GET: APIRoute = async ({ site }) => {
|
|
488
|
-
const xmlOutput = generateSitemap(pathList, {
|
|
496
|
+
const xmlOutput = generateSitemap(pathList, {
|
|
497
|
+
siteUrl: "https://example.com",
|
|
498
|
+
});
|
|
489
499
|
|
|
490
500
|
return new Response(xmlOutput, {
|
|
491
501
|
headers: { "Content-Type": "application/xml" },
|
|
@@ -585,21 +595,7 @@ bun x intlayer extract
|
|
|
585
595
|
</Tab>
|
|
586
596
|
<Tab value='Babel 编译器'>
|
|
587
597
|
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
更新您的 `vite.config.ts` 以包含 `intlayerCompiler` 插件:
|
|
591
|
-
|
|
592
|
-
```ts fileName="vite.config.ts"
|
|
593
|
-
import { defineConfig } from "vite";
|
|
594
|
-
import { intlayer, intlayerCompiler } from "vite-intlayer";
|
|
595
|
-
|
|
596
|
-
export default defineConfig({
|
|
597
|
-
plugins: [
|
|
598
|
-
intlayer(),
|
|
599
|
-
intlayerCompiler(), // Adds the compiler plugin
|
|
600
|
-
],
|
|
601
|
-
});
|
|
602
|
-
```
|
|
598
|
+
构建你的应用程序来转换你的组件并提取内容
|
|
603
599
|
|
|
604
600
|
```bash packageManager="npm"
|
|
605
601
|
npm run build # 或 npm run dev
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
createdAt: 2026-04-24
|
|
3
|
-
updatedAt: 2026-
|
|
3
|
+
updatedAt: 2026-09-20
|
|
4
4
|
title: "Astro + Preact i18n - 翻译你的应用的完整指南"
|
|
5
5
|
description: "告别 i18next。2026 年构建多语言 (i18n) Astro + Preact 应用的完整指南。使用 AI 代理翻译并优化包体积、SEO 和性能。"
|
|
6
6
|
keywords:
|
|
@@ -19,6 +19,9 @@ slugs:
|
|
|
19
19
|
applicationTemplate: https://github.com/aymericzip/intlayer-astro-template
|
|
20
20
|
applicationShowcase: https://intlayer-astro-template.vercel.app
|
|
21
21
|
history:
|
|
22
|
+
- version: 9.5.5
|
|
23
|
+
date: 2026-09-19
|
|
24
|
+
changes: "在 Astro 页面中使用 astro-intlayer 的 useIntlayer / useLocale 钩子"
|
|
22
25
|
- version: 8.9.0
|
|
23
26
|
date: 2026-05-04
|
|
24
27
|
changes: "更新 Solid useIntlayer API 用法以直接访问属性"
|
|
@@ -150,7 +153,7 @@ bun add intlayer astro-intlayer preact preact-intlayer @astrojs/preact
|
|
|
150
153
|
核心软件包,提供用于配置管理、翻译、[内容声明](https://github.com/aymericzip/intlayer/blob/main/docs/docs/zh/dictionary/content_file.md)、编译和 [CLI 命令](https://github.com/aymericzip/intlayer/blob/main/docs/docs/zh/cli/index.md)的国际化工具。
|
|
151
154
|
|
|
152
155
|
- **astro-intlayer**
|
|
153
|
-
|
|
156
|
+
包含用于将 Intlayer 与 [Vite 打包器](https://vite.dev/guide/why.html#why-bundle-for-production) 集成的 Astro 集成插件、将每个请求的语言环境解析到 `Astro.locals.intlayer` 的中间件,以及 `useIntlayer` / `useDictionary` / `useLocale` 钩子。相同的导入路径在 `.astro` frontmatter 中解析为服务端实现,在 `<script>` 块中解析为客户端实现(由 `vanilla-intlayer` 支持)。
|
|
154
157
|
|
|
155
158
|
- **preact**
|
|
156
159
|
核心 Preact 软件包 - React 的快速且轻量级的替代方案。
|
|
@@ -242,19 +245,21 @@ export default appContent;
|
|
|
242
245
|
</Step>
|
|
243
246
|
<Step number={5} title="在 Astro 中使用内容">
|
|
244
247
|
|
|
245
|
-
|
|
248
|
+
使用 `astro-intlayer` 导出的钩子在 `.astro` 文件中使用你的字典。它们与 `react-intlayer` 具有相同的签名:`useIntlayer("key")` 返回字典内容,`useLocale()` 返回当前语言环境,无需传递参数。
|
|
249
|
+
|
|
250
|
+
语言环境来自 `astro-intlayer` 中间件,集成会自动在你的 `src/middleware.ts` 之前注册该中间件。它会依次从 URL 前缀、客户端持久化的语言环境(Cookie 或标头)、`Accept-Language` 解析每个请求的语言环境,并将其存储在 `Astro.locals.intlayer` 中。预渲染页面仅使用 URL,因为它们只为每个访客渲染一次。
|
|
251
|
+
|
|
252
|
+
您还应在每个页面添加 SEO 元数据(如 hreflang 和规范链接),并为客户端交互内容引入 Preact 岛。
|
|
246
253
|
|
|
247
254
|
```astro fileName="src/pages/[...locale]/index.astro"
|
|
248
255
|
---
|
|
256
|
+
import { useIntlayer, useLocale } from "astro-intlayer";
|
|
249
257
|
import {
|
|
250
|
-
getIntlayer,
|
|
251
|
-
getLocaleFromPath,
|
|
252
258
|
getLocalizedUrl,
|
|
253
|
-
getHTMLTextDir,
|
|
254
259
|
getPrefix,
|
|
255
260
|
localeMap,
|
|
256
261
|
defaultLocale,
|
|
257
|
-
|
|
262
|
+
getHTMLTextDir,
|
|
258
263
|
} from "intlayer";
|
|
259
264
|
import { PreactIsland } from "../../components/preact/PreactIsland";
|
|
260
265
|
|
|
@@ -264,8 +269,11 @@ export const getStaticPaths = () => {
|
|
|
264
269
|
}));
|
|
265
270
|
};
|
|
266
271
|
|
|
267
|
-
|
|
268
|
-
const {
|
|
272
|
+
// 中间件解析的语言环境(例如 /zh/about -> 'zh')
|
|
273
|
+
const { locale } = useLocale();
|
|
274
|
+
|
|
275
|
+
// 该语言环境的 'app' 字典内容
|
|
276
|
+
const { title } = useIntlayer("app");
|
|
269
277
|
---
|
|
270
278
|
|
|
271
279
|
<!doctype html>
|
|
@@ -321,6 +329,8 @@ const { title } = getIntlayer("app", locale);
|
|
|
321
329
|
> <img src={String(content.image.src)} alt={String(content.image)} />
|
|
322
330
|
> ```
|
|
323
331
|
|
|
332
|
+
> `Astro.locals.intlayer` 还向你自己的中间件和端点公开 `locale`、`defaultLocale` 和 `availableLocales`。将语言环境或选择器作为第二个参数传递(`useIntlayer("app", "fr")`、`useIntlayer("faq", { item: 2 })`)可在单次调用中覆盖请求语言环境。
|
|
333
|
+
|
|
324
334
|
> **关于路由设置的说明:**
|
|
325
335
|
> 您使用的目录结构取决于 `intlayer.config.ts` 中的 `middleware.routing` 设置:
|
|
326
336
|
>
|
|
@@ -437,10 +447,10 @@ const pathList: SitemapUrlEntry[] = [
|
|
|
437
447
|
{ path: "/about", changefreq: "monthly", priority: 0.7 },
|
|
438
448
|
];
|
|
439
449
|
|
|
440
|
-
const SITE_URL = import.meta.env.SITE ?? "http://localhost:4321";
|
|
441
|
-
|
|
442
450
|
export const GET: APIRoute = async ({ site }) => {
|
|
443
|
-
const xmlOutput = generateSitemap(pathList, {
|
|
451
|
+
const xmlOutput = generateSitemap(pathList, {
|
|
452
|
+
siteUrl: "https://example.com",
|
|
453
|
+
});
|
|
444
454
|
|
|
445
455
|
return new Response(xmlOutput, {
|
|
446
456
|
headers: { "Content-Type": "application/xml" },
|
|
@@ -540,21 +550,7 @@ bun x intlayer extract
|
|
|
540
550
|
</Tab>
|
|
541
551
|
<Tab value='Babel 编译器'>
|
|
542
552
|
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
更新您的 `vite.config.ts` 以包含 `intlayerCompiler` 插件:
|
|
546
|
-
|
|
547
|
-
```ts fileName="vite.config.ts"
|
|
548
|
-
import { defineConfig } from "vite";
|
|
549
|
-
import { intlayer, intlayerCompiler } from "vite-intlayer";
|
|
550
|
-
|
|
551
|
-
export default defineConfig({
|
|
552
|
-
plugins: [
|
|
553
|
-
intlayer(),
|
|
554
|
-
intlayerCompiler(), // Adds the compiler plugin
|
|
555
|
-
],
|
|
556
|
-
});
|
|
557
|
-
```
|
|
553
|
+
构建你的应用程序来转换你的组件并提取内容
|
|
558
554
|
|
|
559
555
|
```bash packageManager="npm"
|
|
560
556
|
npm run build # 或 npm run dev
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
createdAt: 2024-03-07
|
|
3
|
-
updatedAt: 2026-
|
|
3
|
+
updatedAt: 2026-09-20
|
|
4
4
|
title: "Astro + React i18n - 翻译你的应用的完整指南"
|
|
5
5
|
description: "告别 i18next。2026 年构建多语言 (i18n) Astro + React 应用的完整指南。使用 AI 代理翻译并优化包体积、SEO 和性能。"
|
|
6
6
|
keywords:
|
|
@@ -19,6 +19,9 @@ slugs:
|
|
|
19
19
|
applicationTemplate: https://github.com/aymericzip/intlayer-astro-template
|
|
20
20
|
applicationShowcase: https://intlayer-astro-template.vercel.app
|
|
21
21
|
history:
|
|
22
|
+
- version: 9.5.5
|
|
23
|
+
date: 2026-09-19
|
|
24
|
+
changes: "在 Astro 页面中使用 astro-intlayer 的 useIntlayer / useLocale 钩子"
|
|
22
25
|
- version: 8.9.0
|
|
23
26
|
date: 2026-05-04
|
|
24
27
|
changes: "更新 Solid useIntlayer API 用法以直接访问属性"
|
|
@@ -153,7 +156,7 @@ bun add intlayer astro-intlayer react react-dom react-intlayer @astrojs/react
|
|
|
153
156
|
核心软件包,提供用于配置管理、翻译、[内容声明](https://github.com/aymericzip/intlayer/blob/main/docs/docs/zh/dictionary/content_file.md)、编译和 [CLI 命令](https://github.com/aymericzip/intlayer/blob/main/docs/docs/zh/cli/index.md)的国际化工具。
|
|
154
157
|
|
|
155
158
|
- **astro-intlayer**
|
|
156
|
-
|
|
159
|
+
包含用于将 Intlayer 与 [Vite 打包器](https://vite.dev/guide/why.html#why-bundle-for-production) 集成的 Astro 集成插件、将每个请求的语言环境解析到 `Astro.locals.intlayer` 的中间件,以及 `useIntlayer` / `useDictionary` / `useLocale` 钩子。相同的导入路径在 `.astro` frontmatter 中解析为服务端实现,在 `<script>` 块中解析为客户端实现(由 `vanilla-intlayer` 支持)。
|
|
157
160
|
|
|
158
161
|
- **react**, **react-dom**
|
|
159
162
|
在浏览器中渲染 React 组件所需的核心 React 软件包。
|
|
@@ -242,19 +245,21 @@ export default appContent;
|
|
|
242
245
|
</Step>
|
|
243
246
|
<Step number={5} title="在 Astro 中使用内容">
|
|
244
247
|
|
|
245
|
-
|
|
248
|
+
使用 `astro-intlayer` 导出的钩子在 `.astro` 文件中使用你的字典。它们与 `react-intlayer` 具有相同的签名:`useIntlayer("key")` 返回字典内容,`useLocale()` 返回当前语言环境,无需传递参数。
|
|
249
|
+
|
|
250
|
+
语言环境来自 `astro-intlayer` 中间件,集成会自动在你的 `src/middleware.ts` 之前注册该中间件。它会依次从 URL 前缀、客户端持久化的语言环境(Cookie 或标头)、`Accept-Language` 解析每个请求的语言环境,并将其存储在 `Astro.locals.intlayer` 中。预渲染页面仅使用 URL,因为它们只为每个访客渲染一次。
|
|
251
|
+
|
|
252
|
+
您还应在每个页面添加 SEO 元数据(如 hreflang 和规范链接),并为客户端交互内容引入 React 岛。
|
|
246
253
|
|
|
247
254
|
```astro fileName="src/pages/[...locale]/index.astro"
|
|
248
255
|
---
|
|
256
|
+
import { useIntlayer, useLocale } from "astro-intlayer";
|
|
249
257
|
import {
|
|
250
|
-
getIntlayer,
|
|
251
|
-
getLocaleFromPath,
|
|
252
258
|
getLocalizedUrl,
|
|
253
|
-
getHTMLTextDir,
|
|
254
259
|
getPrefix,
|
|
255
260
|
localeMap,
|
|
256
261
|
defaultLocale,
|
|
257
|
-
|
|
262
|
+
getHTMLTextDir,
|
|
258
263
|
} from "intlayer";
|
|
259
264
|
import { ReactIsland } from "../../components/react/ReactIsland";
|
|
260
265
|
|
|
@@ -264,8 +269,11 @@ export const getStaticPaths = () => {
|
|
|
264
269
|
}));
|
|
265
270
|
};
|
|
266
271
|
|
|
267
|
-
|
|
268
|
-
const {
|
|
272
|
+
// 中间件解析的语言环境(例如 /zh/about -> 'zh')
|
|
273
|
+
const { locale } = useLocale();
|
|
274
|
+
|
|
275
|
+
// 该语言环境的 'app' 字典内容
|
|
276
|
+
const { title } = useIntlayer("app");
|
|
269
277
|
---
|
|
270
278
|
|
|
271
279
|
<!doctype html>
|
|
@@ -321,6 +329,8 @@ const { title } = getIntlayer("app", locale);
|
|
|
321
329
|
> <img src={String(content.image.src)} alt={String(content.image)} />
|
|
322
330
|
> ```
|
|
323
331
|
|
|
332
|
+
> `Astro.locals.intlayer` 还向你自己的中间件和端点公开 `locale`、`defaultLocale` 和 `availableLocales`。将语言环境或选择器作为第二个参数传递(`useIntlayer("app", "fr")`、`useIntlayer("faq", { item: 2 })`)可在单次调用中覆盖请求语言环境。
|
|
333
|
+
|
|
324
334
|
> **关于路由设置的说明:**
|
|
325
335
|
> 您使用的目录结构取决于 `intlayer.config.ts` 中的 `middleware.routing` 设置:
|
|
326
336
|
>
|
|
@@ -433,10 +443,10 @@ const pathList: SitemapUrlEntry[] = [
|
|
|
433
443
|
{ path: "/about", changefreq: "monthly", priority: 0.7 },
|
|
434
444
|
];
|
|
435
445
|
|
|
436
|
-
const SITE_URL = import.meta.env.SITE ?? "http://localhost:4321";
|
|
437
|
-
|
|
438
446
|
export const GET: APIRoute = async ({ site }) => {
|
|
439
|
-
const xmlOutput = generateSitemap(pathList, {
|
|
447
|
+
const xmlOutput = generateSitemap(pathList, {
|
|
448
|
+
siteUrl: "https://example.com",
|
|
449
|
+
});
|
|
440
450
|
|
|
441
451
|
return new Response(xmlOutput, {
|
|
442
452
|
headers: { "Content-Type": "application/xml" },
|
|
@@ -536,21 +546,7 @@ bun x intlayer extract
|
|
|
536
546
|
</Tab>
|
|
537
547
|
<Tab value='Babel 编译器'>
|
|
538
548
|
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
更新您的 `vite.config.ts` 以包含 `intlayerCompiler` 插件:
|
|
542
|
-
|
|
543
|
-
```ts fileName="vite.config.ts"
|
|
544
|
-
import { defineConfig } from "vite";
|
|
545
|
-
import { intlayer, intlayerCompiler } from "vite-intlayer";
|
|
546
|
-
|
|
547
|
-
export default defineConfig({
|
|
548
|
-
plugins: [
|
|
549
|
-
intlayer(),
|
|
550
|
-
intlayerCompiler(), // Adds the compiler plugin
|
|
551
|
-
],
|
|
552
|
-
});
|
|
553
|
-
```
|
|
549
|
+
构建你的应用程序来转换你的组件并提取内容
|
|
554
550
|
|
|
555
551
|
```bash packageManager="npm"
|
|
556
552
|
npm run build # 或 npm run dev
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
createdAt: 2026-04-24
|
|
3
|
-
updatedAt: 2026-
|
|
3
|
+
updatedAt: 2026-09-20
|
|
4
4
|
title: "Astro + Solid i18n - 翻译你的应用的完整指南"
|
|
5
5
|
description: "告别 i18next。2026 年构建多语言 (i18n) Astro + Solid 应用的完整指南。使用 AI 代理翻译并优化包体积、SEO 和性能。"
|
|
6
6
|
keywords:
|
|
@@ -19,6 +19,9 @@ slugs:
|
|
|
19
19
|
applicationTemplate: https://github.com/aymericzip/intlayer-astro-template
|
|
20
20
|
applicationShowcase: https://intlayer-astro-template.vercel.app
|
|
21
21
|
history:
|
|
22
|
+
- version: 9.5.5
|
|
23
|
+
date: 2026-09-19
|
|
24
|
+
changes: "在 Astro 页面中使用 astro-intlayer 的 useIntlayer / useLocale 钩子"
|
|
22
25
|
- version: 8.9.0
|
|
23
26
|
date: 2026-05-04
|
|
24
27
|
changes: "更新 Solid useIntlayer API 用法以直接访问属性"
|
|
@@ -150,7 +153,7 @@ bun add intlayer astro-intlayer solid-js solid-intlayer @astrojs/solid-js
|
|
|
150
153
|
核心软件包,提供用于配置管理、翻译、[内容声明](https://github.com/aymericzip/intlayer/blob/main/docs/docs/zh/dictionary/content_file.md)、编译和 [CLI 命令](https://github.com/aymericzip/intlayer/blob/main/docs/docs/zh/cli/index.md)的国际化工具。
|
|
151
154
|
|
|
152
155
|
- **astro-intlayer**
|
|
153
|
-
|
|
156
|
+
包含用于将 Intlayer 与 [Vite 打包器](https://vite.dev/guide/why.html#why-bundle-for-production) 集成的 Astro 集成插件、将每个请求的语言环境解析到 `Astro.locals.intlayer` 的中间件,以及 `useIntlayer` / `useDictionary` / `useLocale` 钩子。相同的导入路径在 `.astro` frontmatter 中解析为服务端实现,在 `<script>` 块中解析为客户端实现(由 `vanilla-intlayer` 支持)。
|
|
154
157
|
|
|
155
158
|
- **solid-js**
|
|
156
159
|
核心 Solid 软件包。
|
|
@@ -238,19 +241,21 @@ export default appContent;
|
|
|
238
241
|
</Step>
|
|
239
242
|
<Step number={5} title="在 Astro 中使用内容">
|
|
240
243
|
|
|
241
|
-
|
|
244
|
+
使用 `astro-intlayer` 导出的钩子在 `.astro` 文件中使用你的字典。它们与 `react-intlayer` 具有相同的签名:`useIntlayer("key")` 返回字典内容,`useLocale()` 返回当前语言环境,无需传递参数。
|
|
245
|
+
|
|
246
|
+
语言环境来自 `astro-intlayer` 中间件,集成会自动在你的 `src/middleware.ts` 之前注册该中间件。它会依次从 URL 前缀、客户端持久化的语言环境(Cookie 或标头)、`Accept-Language` 解析每个请求的语言环境,并将其存储在 `Astro.locals.intlayer` 中。预渲染页面仅使用 URL,因为它们只为每个访客渲染一次。
|
|
247
|
+
|
|
248
|
+
您还应在每个页面添加 SEO 元数据(如 hreflang 和规范链接),并为客户端交互内容引入 Solid 岛。
|
|
242
249
|
|
|
243
250
|
```astro fileName="src/pages/[...locale]/index.astro"
|
|
244
251
|
---
|
|
252
|
+
import { useIntlayer, useLocale } from "astro-intlayer";
|
|
245
253
|
import {
|
|
246
|
-
getIntlayer,
|
|
247
|
-
getLocaleFromPath,
|
|
248
254
|
getLocalizedUrl,
|
|
249
|
-
getHTMLTextDir,
|
|
250
255
|
getPrefix,
|
|
251
256
|
localeMap,
|
|
252
257
|
defaultLocale,
|
|
253
|
-
|
|
258
|
+
getHTMLTextDir,
|
|
254
259
|
} from "intlayer";
|
|
255
260
|
import { SolidIsland } from "../../components/solid/SolidIsland";
|
|
256
261
|
|
|
@@ -260,8 +265,11 @@ export const getStaticPaths = () => {
|
|
|
260
265
|
}));
|
|
261
266
|
};
|
|
262
267
|
|
|
263
|
-
|
|
264
|
-
const {
|
|
268
|
+
// 中间件解析的语言环境(例如 /zh/about -> 'zh')
|
|
269
|
+
const { locale } = useLocale();
|
|
270
|
+
|
|
271
|
+
// 该语言环境的 'app' 字典内容
|
|
272
|
+
const { title } = useIntlayer("app");
|
|
265
273
|
---
|
|
266
274
|
|
|
267
275
|
<!doctype html>
|
|
@@ -317,6 +325,8 @@ const { title } = getIntlayer("app", locale);
|
|
|
317
325
|
> <img src={String(content.image.src)} alt={String(content.image)} />
|
|
318
326
|
> ```
|
|
319
327
|
|
|
328
|
+
> `Astro.locals.intlayer` 还向你自己的中间件和端点公开 `locale`、`defaultLocale` 和 `availableLocales`。将语言环境或选择器作为第二个参数传递(`useIntlayer("app", "fr")`、`useIntlayer("faq", { item: 2 })`)可在单次调用中覆盖请求语言环境。
|
|
329
|
+
|
|
320
330
|
> **关于路由设置的说明:**
|
|
321
331
|
> 您使用的目录结构取决于 `intlayer.config.ts` 中的 `middleware.routing` 设置:
|
|
322
332
|
>
|
|
@@ -433,10 +443,10 @@ const pathList: SitemapUrlEntry[] = [
|
|
|
433
443
|
{ path: "/about", changefreq: "monthly", priority: 0.7 },
|
|
434
444
|
];
|
|
435
445
|
|
|
436
|
-
const SITE_URL = import.meta.env.SITE ?? "http://localhost:4321";
|
|
437
|
-
|
|
438
446
|
export const GET: APIRoute = async ({ site }) => {
|
|
439
|
-
const xmlOutput = generateSitemap(pathList, {
|
|
447
|
+
const xmlOutput = generateSitemap(pathList, {
|
|
448
|
+
siteUrl: "https://example.com",
|
|
449
|
+
});
|
|
440
450
|
|
|
441
451
|
return new Response(xmlOutput, {
|
|
442
452
|
headers: { "Content-Type": "application/xml" },
|
|
@@ -536,21 +546,7 @@ bun x intlayer extract
|
|
|
536
546
|
</Tab>
|
|
537
547
|
<Tab value='Babel 编译器'>
|
|
538
548
|
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
更新您的 `vite.config.ts` 以包含 `intlayerCompiler` 插件:
|
|
542
|
-
|
|
543
|
-
```ts fileName="vite.config.ts"
|
|
544
|
-
import { defineConfig } from "vite";
|
|
545
|
-
import { intlayer, intlayerCompiler } from "vite-intlayer";
|
|
546
|
-
|
|
547
|
-
export default defineConfig({
|
|
548
|
-
plugins: [
|
|
549
|
-
intlayer(),
|
|
550
|
-
intlayerCompiler(), // Adds the compiler plugin
|
|
551
|
-
],
|
|
552
|
-
});
|
|
553
|
-
```
|
|
549
|
+
构建你的应用程序来转换你的组件并提取内容
|
|
554
550
|
|
|
555
551
|
```bash packageManager="npm"
|
|
556
552
|
npm run build # 或 npm run dev
|