You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have added i18n to the BeforeLogin component. I had to convert it from a server component to a client component with 'use client' to make it work. What is best practices, is it possible to keep it as a server component?
ideally I would like to have the translations in a separate package like @payloadcms/translations-seed.
My payload.config:
// Other imports
import { sv } from '@payloadcms/translations/languages/sv'
import { en } from '@payloadcms/translations/languages/en'
// Other imports
export default buildConfig({
i18n: {
supportedLanguages: { sv, en },
fallbackLanguage: 'sv',
translations: {
sv: {
BeforeLogin: {
welcome: 'Välkommen till din manöverpanel!',
welcomeMessage:
'Det är här webbplatsadministratörer loggar in för att hantera din webbplats.',
},
},
en: {
BeforeLogin: {
welcome: 'Welcome to your dashboard!',
welcomeMessage: 'This is where site admins will log in to manage your website.',
},
},
},
},
// Other configurations
})
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hi!
I have added i18n to the BeforeLogin component. I had to convert it from a server component to a client component with
'use client'
to make it work. What is best practices, is it possible to keep it as a server component?I couldn't implement type safety. Tried follow the docs: https://payloadcms.com/docs/configuration/i18n#typescript
Could anyone give me an explanation for a newbie?
ideally I would like to have the translations in a separate package like
@payloadcms/translations-seed
.My payload.config:
Beta Was this translation helpful? Give feedback.
All reactions