Simplify your stack and build anything. Or everything.
Build tomorrow’s web with a modern solution you truly own.
Code-based nature means you can build on top of it to power anything.
It’s time to take back your content infrastructure.

Admin Localization Not Working In 2.0

default discord avatar
bill.sonlast year
2

After updating to payload 2.0 my localizations stopped working.



Here is my config:


export default buildConfig({
    localization: {
        locales: [
            {
                label: "English",
                code: "en",
            },
            {
                label: "Français",
                code: "fr",
            },
        ],
        defaultLocale: "en",
        fallback: true,
    },
    i18n: {
        fallbackLng: "en",
        resources: {
            en: {
                info: {
                    icon: "All icons must conform to the Font Awesome 5 icons found",
                },
            },
            fr: {
                info: {
                    icon: "Tous les icônes doivent être conformes aux icônes Font Awesome 5 trouvées",
                },
            },
        },
    },
    collections: [Users, ContactForm, Partners, Updates, Devices],
    globals: [Config],
    editor: slateEditor({}),
    db: mongooseAdapter({
        url: process.env.MONGODB_URI!,
    }),
    typescript: {
        outputFile: path.resolve(__dirname, "../../../packages/lib/payload-types.ts"),
    },
    admin: {
        components: {
            graphics: {
                Icon: Icon,
                Logo: Logo,
            },
        },
    },
    cors: "*",
    rateLimit: {
        max: 150,
    },
});


Here is an example field:


{
    label: { en: "Name", fr: "Nom" },
    name: "name",
    type: "text",
    required: true,
},



Not sure what happened. Didn't change any localization settings except for the locale labels.

  • discord user avatar
    denolfe
    last year

    Does it work if you remove the locale labels?

  • default discord avatar
    bill.sonlast year

    No it doesn't



    Actually it seems to have happened before 2.0, im going to find where.



    Ahh ok, I was changing the locale not the language in my user settings. That is confusing.

Star on GitHub

Star

Chat on Discord

Discord

online

Can't find what you're looking for?

Get dedicated engineering support directly from the Payload team.