Skip to content

Commit

Permalink
Merge pull request #574 from InseeFrLab/german-trad
Browse files Browse the repository at this point in the history
Add German language 🇩🇪
  • Loading branch information
garronej authored Aug 29, 2023
2 parents 66e62aa + e368685 commit 9259f70
Show file tree
Hide file tree
Showing 7 changed files with 440 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/core/ports/OnyxiaApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ export type User = {
username: string;
};

export type Language = "en" | "fr" | "zh-CN" | "no" | "fi" | "nl" | "it";
export type Language = "en" | "fr" | "zh-CN" | "no" | "fi" | "nl" | "it" | "de";
export type LocalizedString = GenericLocalizedString<Language>;

export type DeploymentRegion = {
Expand Down
3 changes: 2 additions & 1 deletion src/ui/i18n/i18n.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ export const {
"no": () => import("./resources/no").then(({ translations }) => translations),
"fi": () => import("./resources/fi").then(({ translations }) => translations),
"nl": () => import("./resources/nl").then(({ translations }) => translations),
"it": () => import("./resources/it").then(({ translations }) => translations)
"it": () => import("./resources/it").then(({ translations }) => translations),
"de": () => import("./resources/de").then(({ translations }) => translations)
}
);

Expand Down
427 changes: 427 additions & 0 deletions src/ui/i18n/resources/de.tsx

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/ui/i18n/types.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { GenericTranslations } from "i18nifty";

//List the languages you with to support
export const languages = ["en", "fr", "zh-CN", "no", "fi", "nl", "it"] as const;
export const languages = ["en", "fr", "zh-CN", "no", "fi", "nl", "it", "de"] as const;

//If the user's browser language doesn't match any
//of the languages above specify the language to fallback to:
Expand Down
7 changes: 4 additions & 3 deletions src/ui/theme.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -231,11 +231,12 @@ export const { LanguageSelect } = createLanguageSelect<Language>({
"languagesPrettyPrint": {
"en": "English",
"fr": "Français",
"zh-CN": "简体中文",
"de": "Deutsch",
"it": "Italiano",
"nl": "Nederlands",
"no": "Norsk",
"fi": "Suomi",
"nl": "Nederlands",
"it": "Italiano"
"zh-CN": "简体中文"
}
});

Expand Down
4 changes: 3 additions & 1 deletion src/ui/tools/elementsToSentence.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
export function elementsToSentence(params: {
elements: ArrayLike<JSX.Element>;
language: "fr" | "en" | "zh-CN" | "no" | "fi" | "nl" | "it";
language: "fr" | "en" | "zh-CN" | "no" | "fi" | "nl" | "it" | "de";
}): JSX.Element {
const { elements, language } = params;

Expand All @@ -18,6 +18,8 @@ export function elementsToSentence(params: {
return "ja";
case "it":
return "e";
case "de":
return "und";
}
})();

Expand Down
3 changes: 2 additions & 1 deletion src/ui/useMoment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ export const { getFormattedDate } = (() => {
"no": `dddd, Do MMMM${isSameYear ? "" : " YYYY"}, HH:mm`,
"fi": `dddd, Do MMMM${isSameYear ? "" : " YYYY"}, HH:mm`,
"nl": `dddd, Do MMMM${isSameYear ? "" : " YYYY"}, HH:mm`,
"it": `dddd, Do MMMM${isSameYear ? "" : " YYYY"}, HH:mm`
"it": `dddd, Do MMMM${isSameYear ? "" : " YYYY"}, HH:mm`,
"de": `dddd, Do MMMM${isSameYear ? "" : " YYYY"}, HH:mm`
/* spell-checker: enable */
});

Expand Down

0 comments on commit 9259f70

Please sign in to comment.