diff --git a/i18n/en.pot b/i18n/en.pot index ddaa6b6..72cee02 100644 --- a/i18n/en.pot +++ b/i18n/en.pot @@ -5,8 +5,8 @@ msgstr "" "Content-Type: text/plain; charset=utf-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1)\n" -"POT-Creation-Date: 2024-05-06T08:44:12.108Z\n" -"PO-Revision-Date: 2024-05-06T08:44:12.108Z\n" +"POT-Creation-Date: 2024-06-04T15:47:01.351Z\n" +"PO-Revision-Date: 2024-06-04T15:47:01.351Z\n" msgid "There are pending migrations" msgstr "" @@ -470,6 +470,9 @@ msgstr "" msgid "Loading the user configuration..." msgstr "" +msgid "Available Home Pages" +msgstr "" + msgid "Create" msgstr "" diff --git a/i18n/es.po b/i18n/es.po index 0e7e6a6..2040919 100644 --- a/i18n/es.po +++ b/i18n/es.po @@ -1,7 +1,7 @@ msgid "" msgstr "" "Project-Id-Version: i18next-conv\n" -"POT-Creation-Date: 2024-05-06T08:44:12.108Z\n" +"POT-Creation-Date: 2024-06-04T15:47:01.351Z\n" "PO-Revision-Date: 2018-10-25T09:02:35.143Z\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" @@ -469,6 +469,9 @@ msgstr "" msgid "Loading the user configuration..." msgstr "" +msgid "Available Home Pages" +msgstr "Páginas de inicio disponibles" + msgid "Create" msgstr "" 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.tsx b/src/webapp/contexts/app-context.tsx index d6746fe..f0b2b41 100644 --- a/src/webapp/contexts/app-context.tsx +++ b/src/webapp/contexts/app-context.tsx @@ -91,6 +91,7 @@ async function getLaunchAppBaseUrl() { export function useAppContext(): AppContextState { const context = useContext(AppContext); + i18n.setDefaultNamespace("homepage-app"); if (context) { return context; } else { diff --git a/src/webapp/pages/home/HomePage.tsx b/src/webapp/pages/home/HomePage.tsx index 89b1ebb..a785ac7 100644 --- a/src/webapp/pages/home/HomePage.tsx +++ b/src/webapp/pages/home/HomePage.tsx @@ -177,7 +177,7 @@ export const HomePage: React.FC = React.memo(() => { ) : initLandings && pageType === "userLandings" ? ( <> -

Available Home Pages

+

{i18n.t("Available Home Pages")}

{initLandings?.map(landing => { return (