QuiiBz / next-international

Type-safe internationalization (i18n) for Next.js
https://next-international.vercel.app
MIT License
1.19k stars 52 forks source link

[SSG][Metadata] AlternateURLs/Languages ; OpenGraphMetadata #400

Open gustaveWPM opened 1 month ago

gustaveWPM commented 1 month ago

Hello!

In Next, using App Router, we can specify a Metadata object.

https://nextjs.org/docs/app/building-your-application/optimizing/metadata In this Metadata object, we have a alternates field, which is defined as: alternates?: null | AlternateURLs;

If we give a look inside AlternateURLs, then, we can see this:

export type AlternateURLs = {
    canonical?: null | string | URL | AlternateLinkDescriptor;
    languages?: Languages<null | string | URL | AlternateLinkDescriptor[]>;
    media?: {
        [media: string]: null | string | URL | AlternateLinkDescriptor[];
    };
    types?: {
        [types: string]: null | string | URL | AlternateLinkDescriptor[];
    };
};

The languages field is interesting.

I would like to know if Next International should provide helpers for this.


Same concern for OpenGraphMetadata, which has locale and alternateLocale fields.


EDIT: see also https://victorious.com/blog/what-is-x-default/