Update i18n.ts
Added danish
This commit is contained in:
committed by
GitHub
parent
86eaf1f045
commit
abba411cf0
@@ -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;
|
||||||
|
|||||||
Reference in New Issue
Block a user