Skip to content

Commit 9e0f9d3

Browse files
deeonwulieperedo
andauthored
use default app namespace (#326)
* chore: set default namespace in app context * chore: update translation files * feat: remove setDefaultNamespace in download template use case * remove unused i18n import --------- Co-authored-by: Eduardo Peredo Rivero <jrperedo@gmail.com>
1 parent f03bf64 commit 9e0f9d3

File tree

7 files changed

+24
-8
lines changed

7 files changed

+24
-8
lines changed

i18n/en.pot

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ msgstr ""
55
"Content-Type: text/plain; charset=utf-8\n"
66
"Content-Transfer-Encoding: 8bit\n"
77
"Plural-Forms: nplurals=2; plural=(n != 1)\n"
8-
"POT-Creation-Date: 2024-01-19T18:27:08.201Z\n"
9-
"PO-Revision-Date: 2024-01-19T18:27:08.201Z\n"
8+
"POT-Creation-Date: 2024-06-25T17:49:07.727Z\n"
9+
"PO-Revision-Date: 2024-06-25T17:49:07.727Z\n"
1010

1111
msgid "Data values - Create/update"
1212
msgstr ""
@@ -853,6 +853,9 @@ msgstr ""
853853
msgid "Access to Themes"
854854
msgstr ""
855855

856+
msgid "Error while updating sharing settings"
857+
msgstr ""
858+
856859
msgid "Error deleting data values"
857860
msgstr ""
858861

i18n/es.po

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
msgid ""
22
msgstr ""
33
"Project-Id-Version: Bulk Load\n"
4-
"POT-Creation-Date: 2024-01-19T18:27:08.201Z\n"
4+
"POT-Creation-Date: 2024-06-25T17:49:07.727Z\n"
55
"Language: es\n"
66
"MIME-Version: 1.0\n"
77
"Content-Type: text/plain; charset=UTF-8\n"
@@ -886,6 +886,9 @@ msgstr "Crear tema"
886886
msgid "Access to Themes"
887887
msgstr "Acceso a plantillas"
888888

889+
msgid "Error while updating sharing settings"
890+
msgstr ""
891+
889892
msgid "Error deleting data values"
890893
msgstr "Se ha producido un error borrando valores de datos"
891894

i18n/fr.po

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
msgid ""
22
msgstr ""
33
"Project-Id-Version: Bulk Load App\n"
4-
"POT-Creation-Date: 2024-01-19T18:27:08.201Z\n"
4+
"POT-Creation-Date: 2024-06-25T17:49:07.727Z\n"
55
"Language: fr\n"
66
"MIME-Version: 1.0\n"
77
"Content-Type: text/plain; charset=UTF-8\n"
@@ -908,6 +908,9 @@ msgstr "Créer un thème"
908908
msgid "Access to Themes"
909909
msgstr "Accès à la génération de modèles"
910910

911+
msgid "Error while updating sharing settings"
912+
msgstr ""
913+
911914
msgid "Error deleting data values"
912915
msgstr "Erreur lors de la suppression des valeurs de données"
913916

i18n/pt.po

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
msgid ""
22
msgstr ""
33
"Project-Id-Version: Bulk Load\n"
4-
"POT-Creation-Date: 2024-01-19T18:27:08.201Z\n"
4+
"POT-Creation-Date: 2024-06-25T17:49:07.727Z\n"
55
"Language: pt\n"
66
"MIME-Version: 1.0\n"
77
"Content-Type: text/plain; charset=UTF-8\n"
@@ -941,6 +941,9 @@ msgstr "Criar tema"
941941
msgid "Access to Themes"
942942
msgstr "Acesso à geração de planilhas"
943943

944+
msgid "Error while updating sharing settings"
945+
msgstr ""
946+
944947
msgid "Error deleting data values"
945948
msgstr "Erro ao excluir valores de dados"
946949

i18n/ru.po

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
msgid ""
22
msgstr ""
33
"Project-Id-Version: Bulk Load\n"
4-
"POT-Creation-Date: 2024-01-19T18:27:08.201Z\n"
4+
"POT-Creation-Date: 2024-06-25T17:49:07.727Z\n"
55
"Language: ru\n"
66
"MIME-Version: 1.0\n"
77
"Content-Type: text/plain; charset=UTF-8\n"
@@ -945,6 +945,9 @@ msgstr "Создать тему"
945945
msgid "Access to Themes"
946946
msgstr "Доступ к генерации шаблонов"
947947

948+
msgid "Error while updating sharing settings"
949+
msgstr ""
950+
948951
msgid "Error deleting data values"
949952
msgstr "Ошибка при удалении значений данных"
950953

src/domain/usecases/DownloadTemplateUseCase.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import _ from "lodash";
44
import { Moment } from "moment";
55
import { UseCase } from "../../CompositionRoot";
66
import { getRelationshipMetadata, RelationshipOrgUnitFilter } from "../../data/Dhis2RelationshipTypes";
7-
import i18n from "../../locales";
87
import { D2Api } from "../../types/d2-api";
98
import { getExtensionFile, XLSX_EXTENSION } from "../../utils/files";
109
import { promiseMap } from "../../utils/promises";
@@ -79,7 +78,7 @@ export class DownloadTemplateUseCase implements UseCase {
7978
showLanguage,
8079
orgUnitShortName,
8180
} = options;
82-
i18n.setDefaultNamespace("bulk-load");
81+
8382
const useShortNameInOrgUnit = orgUnitShortName || false;
8483
const templateId =
8584
templateType === "custom" && customTemplateId ? customTemplateId : getGeneratedTemplateId(type);

src/webapp/contexts/app-context.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import React, { useContext } from "react";
22
import { CompositionRoot } from "../../CompositionRoot";
33
import { D2Api } from "../../types/d2-api";
4+
import i18n from "../../locales";
45

56
export interface AppContextI {
67
api: D2Api;
@@ -12,6 +13,7 @@ export const AppContext = React.createContext<AppContextI | null>(null);
1213

1314
export function useAppContext() {
1415
const context = useContext(AppContext);
16+
i18n.setDefaultNamespace("bulk-load");
1517
if (context) {
1618
return context;
1719
} else {

0 commit comments

Comments
 (0)