From b41744b3e93e56f2d504a4cb504cfe84c5b0c1db Mon Sep 17 00:00:00 2001 From: Chukwudumebi Onwuli <37223065+deeonwuli@users.noreply.github.com> Date: Tue, 25 Jun 2024 12:59:13 +0100 Subject: [PATCH 1/3] fix: set default app namespace --- src/types/i18n.d.ts | 1 + src/webapp/contexts/app-context.ts | 2 ++ 2 files changed, 3 insertions(+) diff --git a/src/types/i18n.d.ts b/src/types/i18n.d.ts index 168a99a..636fc49 100644 --- a/src/types/i18n.d.ts +++ b/src/types/i18n.d.ts @@ -1,4 +1,5 @@ declare module "@dhis2/d2-i18n" { export function t(value: string, namespace?: object): string; export function changeLanguage(locale: string); + export function setDefaultNamespace(namespace: string); } diff --git a/src/webapp/contexts/app-context.ts b/src/webapp/contexts/app-context.ts index fb7ec33..feb7554 100644 --- a/src/webapp/contexts/app-context.ts +++ b/src/webapp/contexts/app-context.ts @@ -2,6 +2,7 @@ import React, { useContext } from "react"; import { CompositionRoot } from "../../CompositionRoot"; import { User } from "../../domain/entities/User"; import { D2Api } from "../../types/d2-api"; +import i18n from "../../locales"; export interface AppContextState { api: D2Api; @@ -13,6 +14,7 @@ export const AppContext = React.createContext(null); export function useAppContext() { const context = useContext(AppContext); + i18n.setDefaultNamespace("sharing-settings-app"); if (context) { return context; } else { From 8fdc96e811ada24b680d7bd3d71260113ceec094 Mon Sep 17 00:00:00 2001 From: Chukwudumebi Onwuli <37223065+deeonwuli@users.noreply.github.com> Date: Tue, 25 Jun 2024 16:11:07 +0100 Subject: [PATCH 2/3] chore: add es translation --- i18n/es.po | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/i18n/es.po b/i18n/es.po index ce1d654..4004449 100644 --- a/i18n/es.po +++ b/i18n/es.po @@ -123,7 +123,7 @@ msgid "No" msgstr "" msgid "Bulk apply sharing settings" -msgstr "" +msgstr "Aplicar configuraciĆ³n de uso compartido en masa" msgid "Select Metadata" msgstr "" From c674c3acaf37757e694f5e5f4944552c9e138f1d Mon Sep 17 00:00:00 2001 From: Chukwudumebi Onwuli <37223065+deeonwuli@users.noreply.github.com> Date: Tue, 25 Jun 2024 18:19:47 +0100 Subject: [PATCH 3/3] fix: translation conflict with Share component --- src/webapp/pages/app/App.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/webapp/pages/app/App.tsx b/src/webapp/pages/app/App.tsx index e97b93a..6bf2b84 100644 --- a/src/webapp/pages/app/App.tsx +++ b/src/webapp/pages/app/App.tsx @@ -9,13 +9,13 @@ import { appConfig } from "../../../app-config"; import { getCompositionRoot } from "../../../CompositionRoot"; import { Instance } from "../../../data/entities/Instance"; import { D2Api } from "../../../types/d2-api"; +import { Feedback } from "@eyeseetea/feedback-component"; import Share from "../../components/share/Share"; import { AppContext, AppContextState } from "../../contexts/app-context"; import { Router } from "../Router"; import "./App.css"; import muiThemeLegacy from "./themes/dhis2-legacy.theme"; import { muiTheme } from "./themes/dhis2.theme"; -import { Feedback } from "@eyeseetea/feedback-component"; export interface AppProps { api: D2Api;