Update i18n.ts

Added danish
This commit is contained in:
Frørup Andelskasse
2026-02-03 14:30:54 +01:00
committed by GitHub
parent 86eaf1f045
commit abba411cf0

View File

@@ -16,6 +16,7 @@ export const supportedLanguages = [
'it', 'it',
'pt', 'pt',
'nl', 'nl',
'da',
] as const; ] as const;
export type SupportedLanguage = (typeof supportedLanguages)[number]; export type SupportedLanguage = (typeof supportedLanguages)[number];
@@ -33,6 +34,7 @@ export const languageNames: Record<SupportedLanguage, string> = {
it: 'Italiano', it: 'Italiano',
pt: 'Português', pt: 'Português',
nl: 'Nederlands', nl: 'Nederlands',
da: 'Dansk',
}; };
export const getLanguageFromUrl = (): SupportedLanguage => { export const getLanguageFromUrl = (): SupportedLanguage => {
@@ -48,7 +50,7 @@ export const getLanguageFromUrl = (): SupportedLanguage => {
} }
const langMatch = path.match( const langMatch = path.match(
/^\/(en|fr|es|de|zh|zh-TW|vi|tr|id|it|pt|nl|be)(?:\/|$)/ /^\/(en|fr|es|de|zh|zh-TW|vi|tr|id|it|pt|nl|be|da)(?:\/|$)/
); );
if ( if (
langMatch && langMatch &&
@@ -211,7 +213,7 @@ export const rewriteLinks = (): void => {
} }
const langPrefixRegex = new RegExp( const langPrefixRegex = new RegExp(
`^(${basePath.replace(/[.*+?^${}()|[\]\\]/g, '\\$&')})?/?(en|fr|es|de|zh|zh-TW|vi|tr|id|it|pt|nl|be)(/|$)` `^(${basePath.replace(/[.*+?^${}()|[\]\\]/g, '\\$&')})?/?(en|fr|es|de|zh|zh-TW|vi|tr|id|it|pt|nl|be|da)(/|$)`
); );
if (langPrefixRegex.test(href)) { if (langPrefixRegex.test(href)) {
return; return;