Replies: 1 comment
-
Force Payload Admin UI LanguageTo override browser language detection: Option 1: Set supportedLanguages to only your language// payload.config.ts
import { buildConfig } from 'payload/config';
export default buildConfig({
i18n: {
supportedLanguages: {
de: require('@payloadcms/translations/languages/de'),
},
fallbackLanguage: 'de',
},
});By only including German (de), Payload has no choice but to use it. Option 2: Custom language detectioni18n: {
supportedLanguages: { en, de, fr },
fallbackLanguage: 'de',
// Override detection
debug: false,
}And handle via middleware or cookie. Option 3: Force via cookieSet Option 4: Custom Admin componentadmin: {
components: {
beforeDashboard: [
() => {
// Force language on mount
localStorage.setItem('i18nextLng', 'de');
return null;
}
]
}
}RecommendedOption 1 is cleanest - only include the language(s) you want to support. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
I was trying to force payload admin UI NOT to use default language English since it detects browser language, is there a way to override this somehow?
I didn't find anything that can help me do this in documentation only fallbackLanguage, but that doesn't fix my problem.
Beta Was this translation helpful? Give feedback.
All reactions