Admin Localization Not Working In 2.0

default discord avatar
bill.son
last month
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
    Payload Team
    last month

    Does it work if you remove the locale labels?

  • default discord avatar
    bill.son
    last month

    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.

Open the post
Continue the discussion in Discord
Like what we're doing?
Star us on GitHub!

Star

Connect with the Payload Community on Discord

Discord

online

Can't find what you're looking for?

Get help straight from the Payload team with an Enterprise License.