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.
Does it work if you remove the locale labels?
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
Discord
online
Get help straight from the Payload team with an Enterprise License.