@intlayer/docs 7.0.0 → 7.0.2-canary.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (65) hide show
  1. package/blog/en/next-i18next_vs_next-intl_vs_intlayer.md +4 -11
  2. package/dist/cjs/common.cjs +5 -1
  3. package/dist/cjs/common.cjs.map +1 -1
  4. package/dist/esm/common.mjs +5 -1
  5. package/dist/esm/common.mjs.map +1 -1
  6. package/dist/types/common.d.ts.map +1 -1
  7. package/docs/ar/intlayer_with_nextjs_15.md +10 -6
  8. package/docs/ar/intlayer_with_nextjs_16.md +11 -7
  9. package/docs/de/intlayer_with_nextjs_15.md +10 -6
  10. package/docs/de/intlayer_with_nextjs_16.md +11 -7
  11. package/docs/en/CI_CD.md +4 -0
  12. package/docs/en/configuration.md +29 -42
  13. package/docs/en/formatters.md +4 -0
  14. package/docs/en/how_works_intlayer.md +4 -0
  15. package/docs/en/index.md +1 -0
  16. package/docs/en/intlayer_CMS.md +6 -0
  17. package/docs/en/intlayer_cli.md +8 -0
  18. package/docs/en/intlayer_with_nextjs_14.md +14 -6
  19. package/docs/en/intlayer_with_nextjs_15.md +14 -6
  20. package/docs/en/intlayer_with_nextjs_16.md +15 -7
  21. package/docs/en/intlayer_with_nextjs_page_router.md +4 -0
  22. package/docs/en/intlayer_with_nuxt.md +4 -0
  23. package/docs/en/intlayer_with_react_native+expo.md +7 -0
  24. package/docs/en/intlayer_with_react_router_v7.md +4 -0
  25. package/docs/en/intlayer_with_tanstack.md +4 -0
  26. package/docs/en/intlayer_with_vite+preact.md +4 -0
  27. package/docs/en/intlayer_with_vite+react.md +4 -0
  28. package/docs/en/intlayer_with_vite+solid.md +4 -0
  29. package/docs/en/intlayer_with_vite+svelte.md +4 -0
  30. package/docs/en/intlayer_with_vite+vue.md +4 -0
  31. package/docs/en/introduction.md +1 -0
  32. package/docs/en/roadmap.md +6 -0
  33. package/docs/en-GB/intlayer_with_nextjs_14.md +10 -6
  34. package/docs/en-GB/intlayer_with_nextjs_15.md +10 -6
  35. package/docs/en-GB/intlayer_with_nextjs_16.md +11 -7
  36. package/docs/es/intlayer_with_nextjs_14.md +11 -6
  37. package/docs/es/intlayer_with_nextjs_15.md +7 -4
  38. package/docs/es/intlayer_with_nextjs_16.md +11 -7
  39. package/docs/fr/intlayer_with_nextjs_15.md +10 -6
  40. package/docs/fr/intlayer_with_nextjs_16.md +12 -25
  41. package/docs/hi/intlayer_with_nextjs_15.md +10 -6
  42. package/docs/hi/intlayer_with_nextjs_16.md +11 -7
  43. package/docs/id/intlayer_with_nextjs_16.md +11 -7
  44. package/docs/it/intlayer_with_nextjs_15.md +10 -6
  45. package/docs/it/intlayer_with_nextjs_16.md +11 -7
  46. package/docs/ja/intlayer_with_nextjs_14.md +11 -6
  47. package/docs/ja/intlayer_with_nextjs_15.md +10 -6
  48. package/docs/ja/intlayer_with_nextjs_16.md +11 -7
  49. package/docs/ko/intlayer_with_nextjs_14.md +11 -6
  50. package/docs/ko/intlayer_with_nextjs_15.md +10 -6
  51. package/docs/ko/intlayer_with_nextjs_16.md +11 -7
  52. package/docs/pl/intlayer_with_nextjs_16.md +11 -7
  53. package/docs/pt/intlayer_with_nextjs_14.md +10 -7
  54. package/docs/pt/intlayer_with_nextjs_15.md +10 -6
  55. package/docs/pt/intlayer_with_nextjs_16.md +11 -7
  56. package/docs/ru/intlayer_with_nextjs_15.md +7 -4
  57. package/docs/ru/intlayer_with_nextjs_16.md +11 -7
  58. package/docs/tr/intlayer_with_nextjs_15.md +10 -6
  59. package/docs/tr/intlayer_with_nextjs_16.md +11 -7
  60. package/docs/vi/intlayer_with_nextjs_16.md +11 -7
  61. package/docs/zh/intlayer_with_nextjs_14.md +11 -6
  62. package/docs/zh/intlayer_with_nextjs_15.md +7 -4
  63. package/docs/zh/intlayer_with_nextjs_16.md +11 -7
  64. package/package.json +14 -14
  65. package/src/common.ts +7 -1
@@ -47,6 +47,10 @@ history:
47
47
 
48
48
  See [Application Template](https://github.com/aymericzip/intlayer-next-15-template) on GitHub.
49
49
 
50
+ ## Table of Contents
51
+
52
+ <TOC>
53
+
50
54
  ## What is Intlayer?
51
55
 
52
56
  **Intlayer** is an innovative, open-source internationalization (i18n) library designed to simplify multilingual support in modern web applications. Intlayer seamlessly integrates with the latest **Next.js 15** framework, including its powerful **App Router**. It is optimized to work with **Server Components** for efficient rendering and is fully compatible with [**Turbopack**](https://nextjs.org/docs/architecture/turbopack).
@@ -829,15 +833,17 @@ export const generateMetadata = async ({
829
833
  * ```
830
834
  */
831
835
  const multilingualUrls = getMultilingualUrls("/");
836
+ const localizedUrl =
837
+ multilingualUrls[locale as keyof typeof multilingualUrls];
832
838
 
833
839
  return {
834
840
  ...metadata,
835
841
  alternates: {
836
- canonical: multilingualUrls[locale as keyof typeof multilingualUrls],
842
+ canonical: localizedUrl,
837
843
  languages: { ...multilingualUrls, "x-default": "/" },
838
844
  },
839
845
  openGraph: {
840
- url: multilingualUrls[locale],
846
+ url: localizedUrl,
841
847
  },
842
848
  };
843
849
  };
@@ -869,15 +875,16 @@ export const generateMetadata = async ({ params }) => {
869
875
  * ```
870
876
  */
871
877
  const multilingualUrls = getMultilingualUrls("/");
878
+ const localizedUrl = multilingualUrls[locale];
872
879
 
873
880
  return {
874
881
  ...metadata,
875
882
  alternates: {
876
- canonical: multilingualUrls[locale],
883
+ canonical: localizedUrl,
877
884
  languages: { ...multilingualUrls, "x-default": "/" },
878
885
  },
879
886
  openGraph: {
880
- url: multilingualUrls[locale],
887
+ url: localizedUrl,
881
888
  },
882
889
  };
883
890
  };
@@ -909,15 +916,16 @@ const generateMetadata = async ({ params }) => {
909
916
  * ```
910
917
  */
911
918
  const multilingualUrls = getMultilingualUrls("/");
919
+ const localizedUrl = multilingualUrls[locale];
912
920
 
913
921
  return {
914
922
  ...metadata,
915
923
  alternates: {
916
- canonical: multilingualUrls[locale],
924
+ canonical: localizedUrl,
917
925
  languages: { ...multilingualUrls, "x-default": "/" },
918
926
  },
919
927
  openGraph: {
920
- url: multilingualUrls[locale],
928
+ url: localizedUrl,
921
929
  },
922
930
  };
923
931
  };
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  createdAt: 2024-12-06
3
- updatedAt: 2025-10-09
3
+ updatedAt: 2025-10-26
4
4
  title: How to translate your Next.js 16 app – i18n guide 2025
5
5
  description: Discover how to make your Next.js 16 website multilingual. Follow the documentation to internationalize (i18n) and translate it.
6
6
  keywords:
@@ -28,6 +28,10 @@ history:
28
28
 
29
29
  See [Application Template](https://github.com/aymericzip/intlayer-next-16-template) on GitHub.
30
30
 
31
+ ## Table of Contents
32
+
33
+ <TOC>
34
+
31
35
  ## What is Intlayer?
32
36
 
33
37
  **Intlayer** is an innovative, open-source internationalization (i18n) library designed to simplify multilingual support in modern web applications. Intlayer seamlessly integrates with the latest **Next.js 16** framework, including its powerful **App Router**. It is optimized to work with **Server Components** for efficient rendering and is fully compatible with [**Turbopack**](https://nextjs.org/docs/architecture/turbopack).
@@ -804,15 +808,17 @@ export const generateMetadata = async ({
804
808
  * ```
805
809
  */
806
810
  const multilingualUrls = getMultilingualUrls("/");
811
+ const localizedUrl =
812
+ multilingualUrls[locale as keyof typeof multilingualUrls];
807
813
 
808
814
  return {
809
815
  ...metadata,
810
816
  alternates: {
811
- canonical: multilingualUrls[locale as keyof typeof multilingualUrls],
817
+ canonical: localizedUrl,
812
818
  languages: { ...multilingualUrls, "x-default": "/" },
813
819
  },
814
820
  openGraph: {
815
- url: multilingualUrls[locale],
821
+ url: localizedUrl,
816
822
  },
817
823
  };
818
824
  };
@@ -844,15 +850,16 @@ export const generateMetadata = async ({ params }) => {
844
850
  * ```
845
851
  */
846
852
  const multilingualUrls = getMultilingualUrls("/");
853
+ const localizedUrl = multilingualUrls[locale];
847
854
 
848
855
  return {
849
856
  ...metadata,
850
857
  alternates: {
851
- canonical: multilingualUrls[locale],
858
+ canonical: localizedUrl,
852
859
  languages: { ...multilingualUrls, "x-default": "/" },
853
860
  },
854
861
  openGraph: {
855
- url: multilingualUrls[locale],
862
+ url: localizedUrl,
856
863
  },
857
864
  };
858
865
  };
@@ -884,15 +891,16 @@ const generateMetadata = async ({ params }) => {
884
891
  * ```
885
892
  */
886
893
  const multilingualUrls = getMultilingualUrls("/");
894
+ const localizedUrl = multilingualUrls[locale];
887
895
 
888
896
  return {
889
897
  ...metadata,
890
898
  alternates: {
891
- canonical: multilingualUrls[locale],
899
+ canonical: localizedUrl,
892
900
  languages: { ...multilingualUrls, "x-default": "/" },
893
901
  },
894
902
  openGraph: {
895
- url: multilingualUrls[locale],
903
+ url: localizedUrl,
896
904
  },
897
905
  };
898
906
  };
@@ -27,6 +27,10 @@ history:
27
27
 
28
28
  # Translate your Next.js and Page Router website using Intlayer | Internationalization (i18n)
29
29
 
30
+ ## Table of Contents
31
+
32
+ <TOC>
33
+
30
34
  ## What is Intlayer?
31
35
 
32
36
  **Intlayer** is an innovative, open-source internationalization (i18n) library designed to simplify multilingual support in modern web applications. Intlayer seamlessly integrates with the latest **Next.js** framework, including its traditional **Page Router**.
@@ -25,6 +25,10 @@ history:
25
25
 
26
26
  See [Application Template](https://github.com/aymericzip/intlayer-nuxt-template) on GitHub.
27
27
 
28
+ ## Table of Contents
29
+
30
+ <TOC>
31
+
28
32
  ## What is Intlayer?
29
33
 
30
34
  **Intlayer** is an innovative, open-source internationalization (i18n) library designed to simplify multilingual support in modern web applications.
@@ -28,6 +28,10 @@ history:
28
28
 
29
29
  See [Application Template](https://github.com/aymericzip/intlayer-react-native-template) on GitHub.
30
30
 
31
+ ## Table of Contents
32
+
33
+ <TOC>
34
+
31
35
  ## What is Intlayer?
32
36
 
33
37
  **Intlayer** is an **innovative, open-source internationalization (i18n) library** that simplifies multilingual support in modern applications. It works in many JavaScript/TypeScript environments, **including React Native** (via the `react-intlayer` package).
@@ -153,6 +157,9 @@ module.exports = (async () => {
153
157
  })();
154
158
  ```
155
159
 
160
+ > Note: `configMetroIntlayer` is a promise function. Use `configMetroIntlayerSync` instead if you want to use it synchronously, or avoid IFFE (Immediately Invoked Function Expression).
161
+ > Note: `configMetroIntlayerSync` does not allow to build intlayer dictionaries on server start
162
+
156
163
  ## Step 4: Add the Intlayer provider
157
164
 
158
165
  To keep synchronized the user language across your application, you need to wrap your root component with the `IntlayerProvider` component from `react-intlayer-native`.
@@ -31,6 +31,10 @@ history:
31
31
 
32
32
  This guide demonstrates how to integrate **Intlayer** for seamless internationalization in React Router v7 projects with locale-aware routing, TypeScript support, and modern development practices.
33
33
 
34
+ ## Table of Contents
35
+
36
+ <TOC>
37
+
34
38
  ## What is Intlayer?
35
39
 
36
40
  **Intlayer** is an innovative, open-source internationalization (i18n) library designed to simplify multilingual support in modern web applications.
@@ -28,6 +28,10 @@ history:
28
28
 
29
29
  # Translate your Tanstack Start website using Intlayer | Internationalization (i18n)
30
30
 
31
+ ## Table of Contents
32
+
33
+ <TOC>
34
+
31
35
  This guide demonstrates how to integrate **Intlayer** for seamless internationalization in Tanstack Start projects with locale-aware routing, TypeScript support, and modern development practices.
32
36
 
33
37
  ## What is Intlayer?
@@ -27,6 +27,10 @@ history:
27
27
 
28
28
  See [Application Template](https://github.com/aymericzip/intlayer-vite-preact-template) on GitHub.
29
29
 
30
+ ## Table of Contents
31
+
32
+ <TOC>
33
+
30
34
  ## What is Intlayer?
31
35
 
32
36
  **Intlayer** is an innovative, open-source internationalization (i18n) library designed to simplify multilingual support in modern web applications.
@@ -29,6 +29,10 @@ history:
29
29
 
30
30
  See [Application Template](https://github.com/aymericzip/intlayer-vite-react-template) on GitHub.
31
31
 
32
+ ## Table of Contents
33
+
34
+ <TOC>
35
+
32
36
  ## What is Intlayer?
33
37
 
34
38
  **Intlayer** is an innovative, open-source internationalization (i18n) library designed to simplify multilingual support in modern web applications.
@@ -42,6 +42,10 @@ With Intlayer, you can:
42
42
 
43
43
  ## Step-by-Step Guide to Set Up Intlayer in a Vite and Solid Application
44
44
 
45
+ ## Table of Contents
46
+
47
+ <TOC>
48
+
45
49
  ### Step 1: Install Dependencies
46
50
 
47
51
  Install the necessary packages using npm:
@@ -27,6 +27,10 @@ history:
27
27
 
28
28
  <!-- See [Application Template](https://github.com/aymericzip/intlayer-solid-template) on GitHub. -->
29
29
 
30
+ ## Table of Contents
31
+
32
+ <TOC>
33
+
30
34
  ## What is Intlayer?
31
35
 
32
36
  **Intlayer** is an innovative, open-source internationalization (i18n) library designed to simplify multilingual support in modern web applications.
@@ -25,6 +25,10 @@ history:
25
25
 
26
26
  See [Application Template](https://github.com/aymericzip/intlayer-vite-vue-template) on GitHub.
27
27
 
28
+ ## Table of Contents
29
+
30
+ <TOC>
31
+
28
32
  ## What is Intlayer?
29
33
 
30
34
  **Intlayer** is an innovative, open-source internationalization (i18n) library designed to simplify multilingual support in modern web applications.
@@ -187,6 +187,7 @@ Organize your multilingual content close to your code to keep everything consist
187
187
 
188
188
  We’ve built Intlayer with flexibility in mind, offering seamless integration across popular frameworks and build tools:
189
189
 
190
+ - **[Intlayer with Next.js 16](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en/intlayer_with_nextjs_16.md)**
190
191
  - **[Intlayer with Next.js 15](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en/intlayer_with_nextjs_15.md)**
191
192
  - **[Intlayer with Next.js 14 (App Router)](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en/intlayer_with_nextjs_14.md)**
192
193
  - **[Intlayer with Next.js Page Router](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en/intlayer_with_nextjs_page_router.md)**
@@ -31,6 +31,12 @@ Intlayer is a content management and internationalization solution designed to s
31
31
 
32
32
  ---
33
33
 
34
+ ## Table of Contents
35
+
36
+ <TOC>
37
+
38
+ ---
39
+
34
40
  ## Current Features
35
41
 
36
42
  ### 1. Content Declaration
@@ -722,15 +722,17 @@ export const generateMetadata = ({
722
722
  * ```
723
723
  */
724
724
  const multilingualUrls = getMultilingualUrls("/");
725
+ const localizedUrl =
726
+ multilingualUrls[locale as keyof typeof multilingualUrls];
725
727
 
726
728
  return {
727
729
  ...metadata,
728
730
  alternates: {
729
- canonical: multilingualUrls[locale as keyof typeof multilingualUrls],
731
+ canonical: localizedUrl,
730
732
  languages: { ...multilingualUrls, "x-default": "/" },
731
733
  },
732
734
  openGraph: {
733
- url: multilingualUrls[locale],
735
+ url: localizedUrl,
734
736
  },
735
737
  };
736
738
  };
@@ -760,15 +762,16 @@ export const generateMetadata = ({ params: { locale } }) => {
760
762
  * ```
761
763
  */
762
764
  const multilingualUrls = getMultilingualUrls("/");
765
+ const localizedUrl = multilingualUrls[locale];
763
766
 
764
767
  return {
765
768
  ...metadata,
766
769
  alternates: {
767
- canonical: multilingualUrls[locale],
770
+ canonical: localizedUrl,
768
771
  languages: { ...multilingualUrls, "x-default": "/" },
769
772
  },
770
773
  openGraph: {
771
- url: multilingualUrls[locale],
774
+ url: localizedUrl,
772
775
  },
773
776
  };
774
777
  };
@@ -798,15 +801,16 @@ const generateMetadata = ({ params: { locale } }) => {
798
801
  * ```
799
802
  */
800
803
  const multilingualUrls = getMultilingualUrls("/");
804
+ const localizedUrl = multilingualUrls[locale];
801
805
 
802
806
  return {
803
807
  ...metadata,
804
808
  alternates: {
805
- canonical: multilingualUrls[locale],
809
+ canonical: localizedUrl,
806
810
  languages: { ...multilingualUrls, "x-default": "/" },
807
811
  },
808
812
  openGraph: {
809
- url: multilingualUrls[locale],
813
+ url: localizedUrl,
810
814
  },
811
815
  };
812
816
  };
@@ -795,15 +795,17 @@ export const generateMetadata = async ({
795
795
  * ```
796
796
  */
797
797
  const multilingualUrls = getMultilingualUrls("/");
798
+ const localizedUrl =
799
+ multilingualUrls[locale as keyof typeof multilingualUrls];
798
800
 
799
801
  return {
800
802
  ...metadata,
801
803
  alternates: {
802
- canonical: multilingualUrls[locale as keyof typeof multilingualUrls],
804
+ canonical: localizedUrl,
803
805
  languages: { ...multilingualUrls, "x-default": "/" },
804
806
  },
805
807
  openGraph: {
806
- url: multilingualUrls[locale],
808
+ url: localizedUrl,
807
809
  },
808
810
  };
809
811
  };
@@ -835,15 +837,16 @@ export const generateMetadata = async ({ params }) => {
835
837
  * ```
836
838
  */
837
839
  const multilingualUrls = getMultilingualUrls("/");
840
+ const localizedUrl = multilingualUrls[locale];
838
841
 
839
842
  return {
840
843
  ...metadata,
841
844
  alternates: {
842
- canonical: multilingualUrls[locale],
845
+ canonical: localizedUrl,
843
846
  languages: { ...multilingualUrls, "x-default": "/" },
844
847
  },
845
848
  openGraph: {
846
- url: multilingualUrls[locale],
849
+ url: localizedUrl,
847
850
  },
848
851
  };
849
852
  };
@@ -875,15 +878,16 @@ const generateMetadata = async ({ params }) => {
875
878
  * ```
876
879
  */
877
880
  const multilingualUrls = getMultilingualUrls("/");
881
+ const localizedUrl = multilingualUrls[locale];
878
882
 
879
883
  return {
880
884
  ...metadata,
881
885
  alternates: {
882
- canonical: multilingualUrls[locale],
886
+ canonical: localizedUrl,
883
887
  languages: { ...multilingualUrls, "x-default": "/" },
884
888
  },
885
889
  openGraph: {
886
- url: multilingualUrls[locale],
890
+ url: localizedUrl,
887
891
  },
888
892
  };
889
893
  };
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  createdAt: 2025-10-25
3
- updatedAt: 2025-10-25
3
+ updatedAt: 2025-10-26
4
4
  title: How to translate your Next.js 16 app – i18n guide 2025
5
5
  description: Discover how to make your Next.js 16 website multilingual. Follow the documentation to internationalise (i18n) and translate it.
6
6
  keywords:
@@ -809,15 +809,17 @@ export const generateMetadata = async ({
809
809
  * ```
810
810
  */
811
811
  const multilingualUrls = getMultilingualUrls("/");
812
+ const localizedUrl =
813
+ multilingualUrls[locale as keyof typeof multilingualUrls];
812
814
 
813
815
  return {
814
816
  ...metadata,
815
817
  alternates: {
816
- canonical: multilingualUrls[locale as keyof typeof multilingualUrls],
818
+ canonical: localizedUrl,
817
819
  languages: { ...multilingualUrls, "x-default": "/" },
818
820
  },
819
821
  openGraph: {
820
- url: multilingualUrls[locale],
822
+ url: localizedUrl,
821
823
  },
822
824
  };
823
825
  };
@@ -849,15 +851,16 @@ export const generateMetadata = async ({ params }) => {
849
851
  * ```
850
852
  */
851
853
  const multilingualUrls = getMultilingualUrls("/");
854
+ const localizedUrl = multilingualUrls[locale];
852
855
 
853
856
  return {
854
857
  ...metadata,
855
858
  alternates: {
856
- canonical: multilingualUrls[locale],
859
+ canonical: localizedUrl,
857
860
  languages: { ...multilingualUrls, "x-default": "/" },
858
861
  },
859
862
  openGraph: {
860
- url: multilingualUrls[locale],
863
+ url: localizedUrl,
861
864
  },
862
865
  };
863
866
  };
@@ -889,15 +892,16 @@ const generateMetadata = async ({ params }) => {
889
892
  * ```
890
893
  */
891
894
  const multilingualUrls = getMultilingualUrls("/");
895
+ const localizedUrl = multilingualUrls[locale];
892
896
 
893
897
  return {
894
898
  ...metadata,
895
899
  alternates: {
896
- canonical: multilingualUrls[locale],
900
+ canonical: localizedUrl,
897
901
  languages: { ...multilingualUrls, "x-default": "/" },
898
902
  },
899
903
  openGraph: {
900
- url: multilingualUrls[locale],
904
+ url: localizedUrl,
901
905
  },
902
906
  };
903
907
  };
@@ -762,15 +762,17 @@ export const generateMetadata = ({
762
762
  * ```
763
763
  */
764
764
  const multilingualUrls = getMultilingualUrls("/");
765
+ const localizedUrl =
766
+ multilingualUrls[locale as keyof typeof multilingualUrls];
765
767
 
766
768
  return {
767
769
  ...metadata,
768
770
  alternates: {
769
- canonical: multilingualUrls[locale as keyof typeof multilingualUrls],
771
+ canonical: localizedUrl,
770
772
  languages: { ...multilingualUrls, "x-default": "/" },
771
773
  },
772
774
  openGraph: {
773
- url: multilingualUrls[locale],
775
+ url: localizedUrl,
774
776
  },
775
777
  };
776
778
  };
@@ -797,15 +799,17 @@ export const generateMetadata = ({ params: { locale } }) => {
797
799
  * ```
798
800
  */
799
801
  const multilingualUrls = getMultilingualUrls("/");
802
+ const localizedUrl =
803
+ multilingualUrls[locale];
800
804
 
801
805
  return {
802
806
  ...metadata,
803
807
  alternates: {
804
- canonical: multilingualUrls[locale],
808
+ canonical: localizedUrl,
805
809
  languages: { ...multilingualUrls, "x-default": "/" },
806
810
  },
807
811
  openGraph: {
808
- url: multilingualUrls[locale],
812
+ url: localizedUrl,
809
813
  },
810
814
  };
811
815
  };
@@ -835,15 +839,16 @@ const generateMetadata = ({ params: { locale } }) => {
835
839
  * ```
836
840
  */
837
841
  const multilingualUrls = getMultilingualUrls("/");
842
+ const localizedUrl = multilingualUrls[locale];
838
843
 
839
844
  return {
840
845
  ...metadata,
841
846
  alternates: {
842
- canonical: multilingualUrls[locale],
847
+ canonical: localizedUrl,
843
848
  languages: { ...multilingualUrls, "x-default": "/" },
844
849
  },
845
850
  openGraph: {
846
- url: multilingualUrls[locale],
851
+ url: localizedUrl,
847
852
  },
848
853
  };
849
854
  };
@@ -769,15 +769,17 @@ export const generateMetadata = async ({
769
769
  * ```
770
770
  */
771
771
  const multilingualUrls = getMultilingualUrls("/");
772
+ const localizedUrl =
773
+ multilingualUrls[locale as keyof typeof multilingualUrls];
772
774
 
773
775
  return {
774
776
  ...metadata,
775
777
  alternates: {
776
- canonical: multilingualUrls[locale as keyof typeof multilingualUrls],
778
+ canonical: localizedUrl,
777
779
  languages: { ...multilingualUrls, "x-default": "/" },
778
780
  },
779
781
  openGraph: {
780
- url: multilingualUrls[locale],
782
+ url: localizedUrl,
781
783
  },
782
784
  };
783
785
  };
@@ -848,15 +850,16 @@ const generateMetadata = async ({ params }) => {
848
850
  * ```
849
851
  */
850
852
  const multilingualUrls = getMultilingualUrls("/");
853
+ const localizedUrl = multilingualUrls[locale];
851
854
 
852
855
  return {
853
856
  ...metadata,
854
857
  alternates: {
855
- canonical: multilingualUrls[locale],
858
+ canonical: localizedUrl,
856
859
  languages: { ...multilingualUrls, "x-default": "/" },
857
860
  },
858
861
  openGraph: {
859
- url: multilingualUrls[locale],
862
+ url: localizedUrl,
860
863
  },
861
864
  };
862
865
  };
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  createdAt: 2024-12-06
3
- updatedAt: 2025-10-09
3
+ updatedAt: 2025-10-26
4
4
  title: Cómo traducir tu aplicación Next.js 16 – Guía i18n 2025
5
5
  description: Descubre cómo hacer que tu sitio web Next.js 16 sea multilingüe. Sigue la documentación para internacionalizar (i18n) y traducirlo.
6
6
  keywords:
@@ -836,15 +836,17 @@ export const generateMetadata = async ({
836
836
  * ```
837
837
  */
838
838
  const multilingualUrls = getMultilingualUrls("/");
839
+ const localizedUrl =
840
+ multilingualUrls[locale as keyof typeof multilingualUrls];
839
841
 
840
842
  return {
841
843
  ...metadata,
842
844
  alternates: {
843
- canonical: multilingualUrls[locale as keyof typeof multilingualUrls],
845
+ canonical: localizedUrl,
844
846
  languages: { ...multilingualUrls, "x-default": "/" },
845
847
  },
846
848
  openGraph: {
847
- url: multilingualUrls[locale],
849
+ url: localizedUrl,
848
850
  },
849
851
  };
850
852
  };
@@ -876,15 +878,16 @@ export const generateMetadata = async ({ params }) => {
876
878
  * ```
877
879
  */
878
880
  const multilingualUrls = getMultilingualUrls("/");
881
+ const localizedUrl = multilingualUrls[locale];
879
882
 
880
883
  return {
881
884
  ...metadata,
882
885
  alternates: {
883
- canonical: multilingualUrls[locale],
886
+ canonical: localizedUrl,
884
887
  languages: { ...multilingualUrls, "x-default": "/" },
885
888
  },
886
889
  openGraph: {
887
- url: multilingualUrls[locale],
890
+ url: localizedUrl,
888
891
  },
889
892
  };
890
893
  };
@@ -916,15 +919,16 @@ const generateMetadata = async ({ params }) => {
916
919
  * ```
917
920
  */
918
921
  const multilingualUrls = getMultilingualUrls("/");
922
+ const localizedUrl = multilingualUrls[locale];
919
923
 
920
924
  return {
921
925
  ...metadata,
922
926
  alternates: {
923
- canonical: multilingualUrls[locale],
927
+ canonical: localizedUrl,
924
928
  languages: { ...multilingualUrls, "x-default": "/" },
925
929
  },
926
930
  openGraph: {
927
- url: multilingualUrls[locale],
931
+ url: localizedUrl,
928
932
  },
929
933
  };
930
934
  };