Skip to content

Commit

Permalink
Merge pull request #23 from EyeSeeTea/fix/translation-namespace
Browse files Browse the repository at this point in the history
use default app namespace
  • Loading branch information
MiquelAdell authored Jul 1, 2024
2 parents a8a6e89 + c674c3a commit b231696
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion i18n/es.po
Original file line number Diff line number Diff line change
Expand Up @@ -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 ""
Expand Down
1 change: 1 addition & 0 deletions src/types/i18n.d.ts
Original file line number Diff line number Diff line change
@@ -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);
}
2 changes: 2 additions & 0 deletions src/webapp/contexts/app-context.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -13,6 +14,7 @@ export const AppContext = React.createContext<AppContextState | null>(null);

export function useAppContext() {
const context = useContext(AppContext);
i18n.setDefaultNamespace("sharing-settings-app");
if (context) {
return context;
} else {
Expand Down
2 changes: 1 addition & 1 deletion src/webapp/pages/app/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit b231696

Please sign in to comment.