- {Object.keys(LANGUAGE_NAMES).map((e: string) => (
+
+ {availableLocales.map((e: string) => (
))}
diff --git a/src/Locale/config.ts b/src/Locale/config.ts
deleted file mode 100644
index cc41f589581..00000000000
--- a/src/Locale/config.ts
+++ /dev/null
@@ -1,7 +0,0 @@
-export const LANGUAGE_NAMES: { [key: string]: any } = {
- en: "English",
- ta: "தமிழ்",
- ml: "മലയാളം",
- mr: "मराठी",
- kn: "ಕನ್ನಡ",
-};
diff --git a/src/Locale/en/index.js b/src/Locale/en/index.ts
similarity index 100%
rename from src/Locale/en/index.js
rename to src/Locale/en/index.ts
diff --git a/src/Locale/hi/HCX.json b/src/Locale/hi/HCX.json
new file mode 100644
index 00000000000..9e26dfeeb6e
--- /dev/null
+++ b/src/Locale/hi/HCX.json
@@ -0,0 +1 @@
+{}
\ No newline at end of file
diff --git a/src/Locale/hi/Patient.json b/src/Locale/hi/Patient.json
new file mode 100644
index 00000000000..9e26dfeeb6e
--- /dev/null
+++ b/src/Locale/hi/Patient.json
@@ -0,0 +1 @@
+{}
\ No newline at end of file
diff --git a/src/Locale/hi/index.ts b/src/Locale/hi/index.ts
new file mode 100644
index 00000000000..808520605ed
--- /dev/null
+++ b/src/Locale/hi/index.ts
@@ -0,0 +1,45 @@
+import Asset from "./Asset.json";
+import Auth from "./Auth.json";
+import Bed from "./Bed.json";
+import Common from "./Common.json";
+import Consultation from "./Consultation.json";
+import CoverImageEdit from "./CoverImageEdit.json";
+import Diagnosis from "./Diagnosis.json";
+import Entities from "./Entities.json";
+import ErrorPages from "./ErrorPages.json";
+import ExternalResult from "./ExternalResult.json";
+import Facility from "./Facility.json";
+import FileUpload from "./FileUpload.json";
+import HCX from "./HCX.json";
+import Hub from "./Hub.json";
+import LogUpdate from "./LogUpdate.json";
+import Medicine from "./Medicine.json";
+import Notifications from "./Notifications.json";
+import Patient from "./Patient.json";
+import Resource from "./Resource.json";
+import Shifting from "./Shifting.json";
+import Users from "./Users.json";
+
+export default {
+ ...Auth,
+ ...Asset,
+ ...Common,
+ ...Consultation,
+ ...CoverImageEdit,
+ ...Entities,
+ ...ErrorPages,
+ ...ExternalResult,
+ ...Facility,
+ ...Hub,
+ ...Medicine,
+ ...Diagnosis,
+ ...Notifications,
+ ...Patient,
+ ...Resource,
+ ...Shifting,
+ ...Bed,
+ ...Users,
+ ...LogUpdate,
+ ...FileUpload,
+ ...HCX,
+};
diff --git a/src/Locale/kn/index.js b/src/Locale/kn/index.ts
similarity index 89%
rename from src/Locale/kn/index.js
rename to src/Locale/kn/index.ts
index 5c2b9219ced..ffaa7cab1c8 100644
--- a/src/Locale/kn/index.js
+++ b/src/Locale/kn/index.ts
@@ -11,8 +11,10 @@ import ExternalResult from "./ExternalResult.json";
import Facility from "./Facility.json";
import FileUpload from "./FileUpload.json";
import Hub from "./Hub.json";
+import LogUpdate from "./LogUpdate.json";
import Medicine from "./Medicine.json";
import Notifications from "./Notifications.json";
+import Resource from "./Resource.json";
import Shifting from "./Shifting.json";
import Users from "./Users.json";
@@ -30,8 +32,10 @@ export default {
...Medicine,
...Diagnosis,
...Notifications,
+ ...Resource,
...Shifting,
...Bed,
...Users,
+ ...LogUpdate,
...FileUpload,
};
diff --git a/src/Locale/ml/index.ts b/src/Locale/ml/index.ts
new file mode 100644
index 00000000000..ffaa7cab1c8
--- /dev/null
+++ b/src/Locale/ml/index.ts
@@ -0,0 +1,41 @@
+import Asset from "./Asset.json";
+import Auth from "./Auth.json";
+import Bed from "./Bed.json";
+import Common from "./Common.json";
+import Consultation from "./Consultation.json";
+import CoverImageEdit from "./CoverImageEdit.json";
+import Diagnosis from "./Diagnosis.json";
+import Entities from "./Entities.json";
+import ErrorPages from "./ErrorPages.json";
+import ExternalResult from "./ExternalResult.json";
+import Facility from "./Facility.json";
+import FileUpload from "./FileUpload.json";
+import Hub from "./Hub.json";
+import LogUpdate from "./LogUpdate.json";
+import Medicine from "./Medicine.json";
+import Notifications from "./Notifications.json";
+import Resource from "./Resource.json";
+import Shifting from "./Shifting.json";
+import Users from "./Users.json";
+
+export default {
+ ...Auth,
+ ...Asset,
+ ...Common,
+ ...Consultation,
+ ...CoverImageEdit,
+ ...Entities,
+ ...ErrorPages,
+ ...ExternalResult,
+ ...Facility,
+ ...Hub,
+ ...Medicine,
+ ...Diagnosis,
+ ...Notifications,
+ ...Resource,
+ ...Shifting,
+ ...Bed,
+ ...Users,
+ ...LogUpdate,
+ ...FileUpload,
+};
diff --git a/src/Locale/mr/index.js b/src/Locale/mr/index.js
deleted file mode 100644
index cbf1d10c3b9..00000000000
--- a/src/Locale/mr/index.js
+++ /dev/null
@@ -1,11 +0,0 @@
-import Auth from "./Auth.json";
-import Common from "./Common.json";
-import Entities from "./Entities.json";
-import Facility from "./Facility.json";
-
-export default {
- ...Auth,
- ...Common,
- ...Entities,
- ...Facility,
-};
diff --git a/src/Locale/ml/index.js b/src/Locale/mr/index.ts
similarity index 100%
rename from src/Locale/ml/index.js
rename to src/Locale/mr/index.ts
diff --git a/src/Locale/ta/index.js b/src/Locale/ta/index.js
deleted file mode 100644
index cbf1d10c3b9..00000000000
--- a/src/Locale/ta/index.js
+++ /dev/null
@@ -1,11 +0,0 @@
-import Auth from "./Auth.json";
-import Common from "./Common.json";
-import Entities from "./Entities.json";
-import Facility from "./Facility.json";
-
-export default {
- ...Auth,
- ...Common,
- ...Entities,
- ...Facility,
-};
diff --git a/src/Locale/ta/index.ts b/src/Locale/ta/index.ts
new file mode 100644
index 00000000000..ffaa7cab1c8
--- /dev/null
+++ b/src/Locale/ta/index.ts
@@ -0,0 +1,41 @@
+import Asset from "./Asset.json";
+import Auth from "./Auth.json";
+import Bed from "./Bed.json";
+import Common from "./Common.json";
+import Consultation from "./Consultation.json";
+import CoverImageEdit from "./CoverImageEdit.json";
+import Diagnosis from "./Diagnosis.json";
+import Entities from "./Entities.json";
+import ErrorPages from "./ErrorPages.json";
+import ExternalResult from "./ExternalResult.json";
+import Facility from "./Facility.json";
+import FileUpload from "./FileUpload.json";
+import Hub from "./Hub.json";
+import LogUpdate from "./LogUpdate.json";
+import Medicine from "./Medicine.json";
+import Notifications from "./Notifications.json";
+import Resource from "./Resource.json";
+import Shifting from "./Shifting.json";
+import Users from "./Users.json";
+
+export default {
+ ...Auth,
+ ...Asset,
+ ...Common,
+ ...Consultation,
+ ...CoverImageEdit,
+ ...Entities,
+ ...ErrorPages,
+ ...ExternalResult,
+ ...Facility,
+ ...Hub,
+ ...Medicine,
+ ...Diagnosis,
+ ...Notifications,
+ ...Resource,
+ ...Shifting,
+ ...Bed,
+ ...Users,
+ ...LogUpdate,
+ ...FileUpload,
+};
diff --git a/src/Locale/update_locale.js b/src/Locale/update_locale.js
index b6c0b17c5e3..61f5e32cf84 100644
--- a/src/Locale/update_locale.js
+++ b/src/Locale/update_locale.js
@@ -21,7 +21,7 @@ if (lng === DEFAULT_LOCALE) {
process.exit(1);
}
-const defaultEntryFile = readFile(`./${DEFAULT_LOCALE}/index.js`);
+const defaultEntryFile = readFile(`./${DEFAULT_LOCALE}/index.ts`);
const defaultAllJsonFiles = getAllJSONFiles(DEFAULT_LOCALE);
if (existsSync(lng)) {
@@ -36,8 +36,8 @@ if (existsSync(lng)) {
console.log(`Create: ${file}`);
}
- writeFile(`./${lng}/index.js`, defaultEntryFile);
- console.log("Create: index.js");
+ writeFile(`./${lng}/index.ts`, defaultEntryFile);
+ console.log("Create: index.ts");
}
function compareBothFiles(defaultFile, newFile) {
diff --git a/src/i18n.ts b/src/i18n.ts
index 289e0fc325f..c2bfe58d541 100644
--- a/src/i18n.ts
+++ b/src/i18n.ts
@@ -6,6 +6,16 @@ import ta from "./Locale/ta";
import ml from "./Locale/ml";
import mr from "./Locale/mr";
import kn from "./Locale/kn";
+import hi from "./Locale/hi";
+
+export const LANGUAGES: { [key: string]: any } = {
+ en: "English",
+ ta: "தமிழ்",
+ ml: "മലയാളം",
+ mr: "मराठी",
+ kn: "ಕನ್ನಡ",
+ hi: "हिन्दी",
+};
const resources = {
en: { translation: en },
@@ -13,6 +23,7 @@ const resources = {
ml: { translation: ml },
mr: { translation: mr },
kn: { translation: kn },
+ hi: { translation: hi },
};
i18n
diff --git a/src/vite-env.d.ts b/src/vite-env.d.ts
index 7a50ebe49db..a14b5cd2122 100644
--- a/src/vite-env.d.ts
+++ b/src/vite-env.d.ts
@@ -31,6 +31,7 @@ interface ImportMetaEnv {
readonly REACT_STILL_WATCHING_PROMPT_DURATION?: string;
readonly REACT_JWT_TOKEN_REFRESH_INTERVAL?: string;
readonly REACT_MIN_ENCOUNTER_DATE?: string;
+ readonly REACT_ALLOWED_LOCALES?: string;
// Plugins related envs...
readonly REACT_PLAUSIBLE_SERVER_URL?: string;