Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

set app namespace in appcontext #36

Merged
merged 1 commit into from
Jun 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions i18n/en.pot
Original file line number Diff line number Diff line change
Expand Up @@ -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 ""
Expand Down Expand Up @@ -470,6 +470,9 @@ msgstr ""
msgid "Loading the user configuration..."
msgstr ""

msgid "Available Home Pages"
msgstr ""

msgid "Create"
msgstr ""

Expand Down
5 changes: 4 additions & 1 deletion i18n/es.po
Original file line number Diff line number Diff line change
@@ -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"
Expand Down Expand Up @@ -469,6 +469,9 @@ msgstr ""
msgid "Loading the user configuration..."
msgstr ""

msgid "Available Home Pages"
msgstr "Páginas de inicio disponibles"

msgid "Create"
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);
}
1 change: 1 addition & 0 deletions src/webapp/contexts/app-context.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ async function getLaunchAppBaseUrl() {

export function useAppContext(): AppContextState {
const context = useContext(AppContext);
i18n.setDefaultNamespace("homepage-app");
if (context) {
return context;
} else {
Expand Down
2 changes: 1 addition & 1 deletion src/webapp/pages/home/HomePage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ export const HomePage: React.FC = React.memo(() => {
</ProgressContainer>
) : initLandings && pageType === "userLandings" ? (
<>
<h1>Available Home Pages</h1>
<h1>{i18n.t("Available Home Pages")}</h1>
<Cardboard rowSize={4}>
{initLandings?.map(landing => {
return (
Expand Down
Loading