@openmrs/esm-translations 6.3.1-pre.2965 → 6.3.1-pre.2997

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/.swcrc ADDED
@@ -0,0 +1,16 @@
1
+ {
2
+ "$schema": "https://swc.rs/schema.json",
3
+ "exclude": [".*\\.test\\..*", "setup-tests\\..*"],
4
+ "module": {
5
+ "type": "es6",
6
+ "resolveFully": true
7
+ },
8
+ "jsc": {
9
+ "parser": {
10
+ "syntax": "typescript",
11
+ "tsx": false
12
+ },
13
+ "target": "es2020",
14
+ "baseUrl": "src"
15
+ }
16
+ }
@@ -1,7 +1,3 @@
1
- asset openmrs-esm-core-translations.js 4.57 KiB [emitted] [minimized] (name: main) 1 related asset
2
- runtime modules 670 bytes 3 modules
3
- orphan modules 4.56 KiB [orphan] 1 module
4
- built modules 8.4 KiB [built]
5
- ./src/index.ts + 1 modules 8.36 KiB [built] [code generated]
6
- external "i18next" 42 bytes [built] [code generated]
7
- webpack 5.88.0 compiled successfully in 9100 ms
1
+ [0] Successfully compiled: 3 files with swc (373.12ms)
2
+ [0] swc --strip-leading-paths src -d dist exited with code 0
3
+ [1] tsc --project tsconfig.build.json exited with code 0
@@ -0,0 +1,47 @@
1
+ /** @module @category Translation */
2
+ import { coreTranslations } from './translations';
3
+ import _i18n, { i18n, type TOptions } from 'i18next';
4
+ declare const i18n: typeof _i18n;
5
+ declare global {
6
+ interface Window {
7
+ i18next: i18n;
8
+ }
9
+ }
10
+ /**
11
+ * This function is for getting a translation from a specific module. Use this only if the
12
+ * translation is neither in the app making the call, nor in the core translations.
13
+ * This function is useful, for example, in libraries that are used by multiple apps, since libraries can't
14
+ * define their own translations.
15
+ *
16
+ * Translations within the current app should be accessed with the i18next API, using
17
+ * `useTranslation` and `t` as usual. Core translations should be accessed with the
18
+ * [[getCoreTranslation]] function.
19
+ *
20
+ * IMPORTANT: This function creates a hidden dependency on the module. Worse yet, it creates
21
+ * a dependency specifically on that module's translation keys, which are often regarded as
22
+ * "implementation details" and therefore may be volatile. Also note that this function DOES NOT
23
+ * load the module's translations if they have not already been loaded via `useTranslation`.
24
+ * **This function should therefore be avoided when possible.**
25
+ *
26
+ * @param moduleName The module to get the translation from, e.g. '@openmrs/esm-login-app'
27
+ * @param key The i18next translation key
28
+ * @param fallback Fallback text for if the lookup fails
29
+ * @param options Options object passed to the i18next `t` function. See https://www.i18next.com/translation-function/essentials#overview-options
30
+ * for more information. `ns` and `defaultValue` are already set and may not be used.
31
+ * @returns The translated text as a string
32
+ */
33
+ export declare function translateFrom(moduleName: string, key: string, fallback?: string, options?: Omit<TOptions, 'ns' | 'defaultValue'>): string;
34
+ export type CoreTranslationKey = keyof typeof coreTranslations;
35
+ /**
36
+ * Use this function to obtain a translation from the core translations. This is a way to avoid having
37
+ * to define common translations in your app, and to ensure that translations are consistent across
38
+ * different apps. This function is also used to obtain translations in the framework and app shell.
39
+ *
40
+ * The complete set of core translations is available on the `CoreTranslationKey` type. Providing an
41
+ * invalid key to this function will result in a type error.
42
+ *
43
+ * @param options Object passed to the i18next `t` function. See https://www.i18next.com/translation-function/essentials#overview-options
44
+ * for more information. `ns` and `defaultValue` are already set and may not be used.
45
+ */
46
+ export declare function getCoreTranslation(key: CoreTranslationKey, defaultText?: string, options?: Omit<TOptions, 'ns' | 'defaultValue'>): string;
47
+ export {};
package/dist/index.js ADDED
@@ -0,0 +1,54 @@
1
+ /** @module @category Translation */ import { coreTranslations } from "./translations.js";
2
+ import _i18n from "i18next";
3
+ const i18n = _i18n.default || _i18n;
4
+ i18n.on('initialized', function() {
5
+ window.i18next.loadNamespaces([
6
+ 'core'
7
+ ]);
8
+ });
9
+ /**
10
+ * This function is for getting a translation from a specific module. Use this only if the
11
+ * translation is neither in the app making the call, nor in the core translations.
12
+ * This function is useful, for example, in libraries that are used by multiple apps, since libraries can't
13
+ * define their own translations.
14
+ *
15
+ * Translations within the current app should be accessed with the i18next API, using
16
+ * `useTranslation` and `t` as usual. Core translations should be accessed with the
17
+ * [[getCoreTranslation]] function.
18
+ *
19
+ * IMPORTANT: This function creates a hidden dependency on the module. Worse yet, it creates
20
+ * a dependency specifically on that module's translation keys, which are often regarded as
21
+ * "implementation details" and therefore may be volatile. Also note that this function DOES NOT
22
+ * load the module's translations if they have not already been loaded via `useTranslation`.
23
+ * **This function should therefore be avoided when possible.**
24
+ *
25
+ * @param moduleName The module to get the translation from, e.g. '@openmrs/esm-login-app'
26
+ * @param key The i18next translation key
27
+ * @param fallback Fallback text for if the lookup fails
28
+ * @param options Options object passed to the i18next `t` function. See https://www.i18next.com/translation-function/essentials#overview-options
29
+ * for more information. `ns` and `defaultValue` are already set and may not be used.
30
+ * @returns The translated text as a string
31
+ */ export function translateFrom(moduleName, key, fallback, options) {
32
+ return i18n.t(key, {
33
+ ns: moduleName,
34
+ defaultValue: fallback,
35
+ ...options
36
+ });
37
+ }
38
+ /**
39
+ * Use this function to obtain a translation from the core translations. This is a way to avoid having
40
+ * to define common translations in your app, and to ensure that translations are consistent across
41
+ * different apps. This function is also used to obtain translations in the framework and app shell.
42
+ *
43
+ * The complete set of core translations is available on the `CoreTranslationKey` type. Providing an
44
+ * invalid key to this function will result in a type error.
45
+ *
46
+ * @param options Object passed to the i18next `t` function. See https://www.i18next.com/translation-function/essentials#overview-options
47
+ * for more information. `ns` and `defaultValue` are already set and may not be used.
48
+ */ export function getCoreTranslation(key, defaultText, options) {
49
+ if (!coreTranslations[key]) {
50
+ console.error(`O3 Core Translations does not provide key '${key}'. The key itself is being rendered as text.`);
51
+ return key;
52
+ }
53
+ return translateFrom('core', key, defaultText ?? coreTranslations[key], options);
54
+ }
@@ -0,0 +1 @@
1
+ export { type CoreTranslationKey, getCoreTranslation, translateFrom } from './index';
package/dist/public.js ADDED
@@ -0,0 +1 @@
1
+ export { getCoreTranslation, translateFrom } from "./index.js";
@@ -0,0 +1,65 @@
1
+ /** Please keep these alphabetized */
2
+ export declare const coreTranslations: {
3
+ actions: string;
4
+ address: string;
5
+ age: string;
6
+ cancel: string;
7
+ change: string;
8
+ Clinic: string;
9
+ close: string;
10
+ confirm: string;
11
+ contactAdministratorIfIssuePersists: string;
12
+ contactDetails: string;
13
+ delete: string;
14
+ edit: string;
15
+ error: string;
16
+ errorCopy: string;
17
+ female: string;
18
+ loading: string;
19
+ male: string;
20
+ other: string;
21
+ patientIdentifierSticker: string;
22
+ patientLists: string;
23
+ print: string;
24
+ printError: string;
25
+ printErrorExplainer: string;
26
+ printIdentifierSticker: string;
27
+ printing: string;
28
+ relationships: string;
29
+ resetOverrides: string;
30
+ save: string;
31
+ scriptLoadingFailed: string;
32
+ scriptLoadingError: string;
33
+ seeMoreLists: string;
34
+ sex: string;
35
+ showLess: string;
36
+ showMore: string;
37
+ toggleDevTools: string;
38
+ unknown: string;
39
+ closeAllOpenedWorkspaces: string;
40
+ closingAllWorkspacesPromptBody: string;
41
+ closingAllWorkspacesPromptTitle: string;
42
+ discard: string;
43
+ hide: string;
44
+ maximize: string;
45
+ minimize: string;
46
+ openAnyway: string;
47
+ unsavedChangesInOpenedWorkspace: string;
48
+ unsavedChangesInWorkspace: string;
49
+ unsavedChangesTitleText: string;
50
+ workspaceHeader: string;
51
+ address1: string;
52
+ address2: string;
53
+ address3: string;
54
+ address4: string;
55
+ address5: string;
56
+ address6: string;
57
+ city: string;
58
+ cityVillage: string;
59
+ country: string;
60
+ countyDistrict: string;
61
+ district: string;
62
+ postalCode: string;
63
+ state: string;
64
+ stateProvince: string;
65
+ };
@@ -0,0 +1,71 @@
1
+ /** Please keep these alphabetized */ const addressFields = {
2
+ address1: 'Address line 1',
3
+ address2: 'Address line 2',
4
+ address3: 'Address line 3',
5
+ address4: 'Address line 4',
6
+ address5: 'Address line 5',
7
+ address6: 'Address line 6',
8
+ city: 'City',
9
+ cityVillage: 'City',
10
+ country: 'Country',
11
+ countyDistrict: 'District',
12
+ district: 'District',
13
+ postalCode: 'Postal code',
14
+ state: 'State',
15
+ stateProvince: 'State'
16
+ };
17
+ const workspaceTranslations = {
18
+ closeAllOpenedWorkspaces: 'Discard changes in {{count}} workspaces',
19
+ closingAllWorkspacesPromptBody: 'There may be unsaved changes in the following workspaces. Do you want to discard changes in the following workspaces? {{workspaceNames}}',
20
+ closingAllWorkspacesPromptTitle: 'You have unsaved changes',
21
+ discard: 'Discard',
22
+ hide: 'Hide',
23
+ maximize: 'Maximize',
24
+ minimize: 'Minimize',
25
+ openAnyway: 'Open anyway',
26
+ unsavedChangesInOpenedWorkspace: `You may have unsaved changes in the opened workspace. Do you want to discard these changes?`,
27
+ unsavedChangesInWorkspace: 'There may be unsaved changes in "{{workspaceName}}". Please save them before opening another workspace.',
28
+ unsavedChangesTitleText: 'Unsaved changes',
29
+ workspaceHeader: 'Workspace header'
30
+ };
31
+ export const coreTranslations = {
32
+ ...addressFields,
33
+ ...workspaceTranslations,
34
+ actions: 'Actions',
35
+ address: 'Address',
36
+ age: 'Age',
37
+ cancel: 'Cancel',
38
+ change: 'Change',
39
+ // Default value for the implementationName config property
40
+ Clinic: 'Clinic',
41
+ close: 'Close',
42
+ confirm: 'Confirm',
43
+ contactAdministratorIfIssuePersists: 'Contact your system administrator if the problem persists.',
44
+ contactDetails: 'Contact details',
45
+ delete: 'Delete',
46
+ edit: 'Edit',
47
+ error: 'Error',
48
+ errorCopy: 'Sorry, there was a problem displaying this information. You can try to reload this page, or contact the site administrator and quote the error code above.',
49
+ female: 'Female',
50
+ loading: 'Loading',
51
+ male: 'Male',
52
+ other: 'Other',
53
+ patientIdentifierSticker: 'Patient identifier sticker',
54
+ patientLists: 'Patient lists',
55
+ print: 'Print',
56
+ printError: 'Print error',
57
+ printErrorExplainer: 'An error occurred in {{errorLocation}}',
58
+ printIdentifierSticker: 'Print identifier sticker',
59
+ printing: 'Printing',
60
+ relationships: 'Relationships',
61
+ resetOverrides: 'Reset overrides',
62
+ save: 'Save',
63
+ scriptLoadingFailed: 'Error: Script failed to load',
64
+ scriptLoadingError: 'Failed to load overridden script from {{url}}. Please check that the bundled script is available at the expected URL. Click the button below to reset all import map overrides.',
65
+ seeMoreLists: 'See {{count}} more lists',
66
+ sex: 'Sex',
67
+ showLess: 'Show less',
68
+ showMore: 'Show more',
69
+ toggleDevTools: 'Toggle dev tools',
70
+ unknown: 'Unknown'
71
+ };
package/mock-jest.ts ADDED
@@ -0,0 +1,25 @@
1
+ import { coreTranslations } from './src/translations';
2
+
3
+ export const getCoreTranslation = jest.fn(
4
+ (key: string, defaultText?: string, options?: Record<string | number | symbol, unknown>) =>
5
+ interpolate(coreTranslations[key] ?? defaultText, options),
6
+ );
7
+
8
+ export const translateFrom = jest.fn(
9
+ (moduleName: string, key: string, fallback?: string, options?: Record<string | number | symbol, unknown>) => {
10
+ if (moduleName === 'core') {
11
+ return interpolate(coreTranslations[key] ?? fallback, options);
12
+ } else {
13
+ return interpolate(key ?? fallback, options);
14
+ }
15
+ },
16
+ );
17
+
18
+ function interpolate(stringValue: string, options?: Record<string | number | symbol, unknown>) {
19
+ if (options) {
20
+ Object.keys(options).forEach((key) => {
21
+ stringValue = stringValue.replace(`{{${key}}}`, '' + options[key]);
22
+ });
23
+ }
24
+ return stringValue;
25
+ }
package/mock.ts CHANGED
@@ -1,20 +1,25 @@
1
+ import { vi } from 'vitest';
1
2
  import { coreTranslations } from './src/translations';
2
3
 
3
- export const getCoreTranslation = jest.fn((key: string, defaultText?: string, options?: object) =>
4
- interpolate(coreTranslations[key] ?? defaultText, options),
4
+ export const getCoreTranslation = vi.fn(
5
+ (key: string, defaultText?: string, options?: Record<string | number | symbol, unknown>) =>
6
+ interpolate(coreTranslations[key] ?? defaultText, options),
7
+ );
8
+
9
+ export const translateFrom = vi.fn(
10
+ (moduleName: string, key: string, fallback?: string, options?: Record<string | number | symbol, unknown>) => {
11
+ if (moduleName === 'core') {
12
+ return interpolate(coreTranslations[key] ?? fallback, options);
13
+ } else {
14
+ return interpolate(key ?? fallback, options);
15
+ }
16
+ },
5
17
  );
6
- export const translateFrom = jest.fn((moduleName: string, key: string, fallback?: string, options?: object) => {
7
- if (moduleName === 'core') {
8
- return interpolate(coreTranslations[key] ?? fallback, options);
9
- } else {
10
- return interpolate(key ?? fallback, options);
11
- }
12
- });
13
18
 
14
- function interpolate(stringValue, options) {
19
+ function interpolate(stringValue: string, options?: Record<string | number | symbol, unknown>) {
15
20
  if (options) {
16
21
  Object.keys(options).forEach((key) => {
17
- stringValue = stringValue.replace(`{{${key}}}`, options[key]);
22
+ stringValue = stringValue.replace(`{{${key}}}`, '' + options[key]);
18
23
  });
19
24
  }
20
25
  return stringValue;
package/package.json CHANGED
@@ -1,17 +1,33 @@
1
1
  {
2
2
  "name": "@openmrs/esm-translations",
3
- "version": "6.3.1-pre.2965",
3
+ "version": "6.3.1-pre.2997",
4
4
  "license": "MPL-2.0",
5
5
  "description": "O3 Framework module for translation support",
6
- "browser": "dist/openmrs-esm-translations.js",
7
- "main": "src/index.ts",
6
+ "type": "module",
7
+ "module": "dist/index.js",
8
+ "types": "dist/index.d.ts",
9
+ "exports": {
10
+ ".": {
11
+ "types": "./src/index.ts",
12
+ "default": "./dist/index.js"
13
+ },
14
+ "./src/public": {
15
+ "types": "./src/public.ts",
16
+ "default": "./dist/public.js"
17
+ },
18
+ "./mock": {
19
+ "import": "./mock.ts",
20
+ "require": "./mock-jest.ts"
21
+ },
22
+ "./package.json": {
23
+ "default": "./package.json"
24
+ }
25
+ },
8
26
  "source": true,
9
27
  "scripts": {
10
- "test": "jest --passWithNoTests --color",
11
- "build": "webpack --mode=production",
12
- "build:development": "webpack --mode development",
13
- "analyze": "webpack --mode=production --env analyze=true",
14
- "typescript": "tsc",
28
+ "build": "rimraf dist && concurrently \"swc --strip-leading-paths src -d dist\" \"tsc --project tsconfig.build.json\"",
29
+ "build:development": "rimraf dist && concurrently \"swc --strip-leading-paths src -d dist\" \"tsc --project tsconfig.build.json\"",
30
+ "typescript": "tsc --project tsconfig.build.json",
15
31
  "lint": "eslint src --ext ts,tsx",
16
32
  "extract-translations": "i18next src/translations.ts --config='i18next-parser.config.mjs'"
17
33
  },
@@ -37,14 +53,18 @@
37
53
  "publishConfig": {
38
54
  "access": "public"
39
55
  },
40
- "devDependencies": {
41
- "i18next-parser": "^8.13.0"
42
- },
43
56
  "dependencies": {
44
57
  "i18next": "21.10.0"
45
58
  },
46
59
  "peerDependencies": {
47
60
  "i18next": "21.x"
48
61
  },
62
+ "devDependencies": {
63
+ "@swc/cli": "^0.7.7",
64
+ "@swc/core": "^1.11.29",
65
+ "concurrently": "^9.1.2",
66
+ "i18next-parser": "^8.13.0",
67
+ "rimraf": "^6.0.1"
68
+ },
49
69
  "stableVersion": "6.3.0"
50
70
  }
@@ -0,0 +1,63 @@
1
+ {
2
+ "actions": "Actions",
3
+ "address": "Address",
4
+ "address1": "Address line 1",
5
+ "address2": "Address line 2",
6
+ "address3": "Address line 3",
7
+ "address4": "Address line 4",
8
+ "address5": "Address line 5",
9
+ "address6": "Address line 6",
10
+ "age": "Age",
11
+ "cancel": "Cancel",
12
+ "change": "Change",
13
+ "city": "City",
14
+ "cityVillage": "City",
15
+ "Clinic": "Clinic",
16
+ "close": "Close",
17
+ "closeAllOpenedWorkspaces": "Discard changes in {{count}} workspaces",
18
+ "closingAllWorkspacesPromptBody": "There are unsaved changes in the following workspaces. Do you want to discard changes in the following workspaces? {{workspaceNames}}",
19
+ "closingAllWorkspacesPromptTitle": "You have unsaved changes",
20
+ "confirm": "Confirm",
21
+ "contactAdministratorIfIssuePersists": "Contact your system administrator if the problem persists.",
22
+ "contactDetails": "Contact Details",
23
+ "country": "Country",
24
+ "countyDistrict": "District",
25
+ "delete": "Delete",
26
+ "discard": "Discard",
27
+ "district": "District",
28
+ "edit": "Edit",
29
+ "error": "Error",
30
+ "errorCopy": "Sorry, there was a problem displaying this information. You can try to reload this page, or contact the site administrator and quote the error code above.",
31
+ "female": "Female",
32
+ "hide": "Hide",
33
+ "loading": "Loading",
34
+ "male": "Male",
35
+ "maximize": "Maximize",
36
+ "minimize": "Minimize",
37
+ "openAnyway": "Open Anyway",
38
+ "other": "Other",
39
+ "patientIdentifierSticker": "Patient identifier sticker",
40
+ "patientLists": "Patient Lists",
41
+ "postalCode": "Postal code",
42
+ "print": "Print",
43
+ "printError": "Print error",
44
+ "printErrorExplainer": "An error occurred in {{errorLocation}}",
45
+ "printIdentifierSticker": "Print identifier sticker",
46
+ "printing": "Printing",
47
+ "relationships": "Relationships",
48
+ "resetOverrides": "Reset overrides",
49
+ "save": "Save",
50
+ "scriptLoadingError": "Failed to load overridden script from {{url}}. Please check that the bundled script is available at the expected URL. Click the button below to reset all import map overrides.",
51
+ "scriptLoadingFailed": "Error: Script failed to load",
52
+ "seeMoreLists": "See {{count}} more lists",
53
+ "sex": "Sex",
54
+ "showLess": "Show less",
55
+ "showMore": "Show more",
56
+ "state": "State",
57
+ "stateProvince": "State",
58
+ "toggleDevTools": "Toggle dev tools",
59
+ "unknown": "Unknown",
60
+ "unsavedChangesInWorkspace": "There may be unsaved changes in \"{{workspaceName}}\". Please save them before opening another workspace.",
61
+ "unsavedChangesTitleText": "Unsaved changes",
62
+ "workspaceHeader": "Workspace header"
63
+ }
@@ -22,10 +22,10 @@
22
22
  "contactDetails": "Coordonnées",
23
23
  "country": "Pays",
24
24
  "countyDistrict": "District",
25
- "delete": "Delete",
25
+ "delete": "Supprimer",
26
26
  "discard": "Annuler",
27
27
  "district": "District",
28
- "edit": "Edit",
28
+ "edit": "Modifier",
29
29
  "error": "Erreur",
30
30
  "errorCopy": "Désolé, il y a eu un problème lors de l'affichage de cette information. Vous pouvez essayer de rafraîchir cette page ou contacter l'administrateur du site en mentionnant le code d'erreur ci-dessus.",
31
31
  "female": "Femme",
@@ -12,7 +12,7 @@
12
12
  "change": "Change",
13
13
  "city": "City",
14
14
  "cityVillage": "City",
15
- "Clinic": "Clinic",
15
+ "Clinic": "מרפאה",
16
16
  "close": "Close",
17
17
  "closeAllOpenedWorkspaces": "Discard changes in {{count}} workspaces",
18
18
  "closingAllWorkspacesPromptBody": "There are unsaved changes in the following workspaces. Do you want to discard changes in the following workspaces? {{workspaceNames}}",
@@ -22,10 +22,10 @@
22
22
  "contactDetails": "Contact Details",
23
23
  "country": "Country",
24
24
  "countyDistrict": "District",
25
- "delete": "Delete",
25
+ "delete": "מחיקה",
26
26
  "discard": "Discard",
27
27
  "district": "מחוז",
28
- "edit": "Edit",
28
+ "edit": "עריכה",
29
29
  "error": "Error",
30
30
  "errorCopy": "Sorry, there was a problem displaying this information. You can try to reload this page, or contact the site administrator and quote the error code above.",
31
31
  "female": "Female",
@@ -55,7 +55,7 @@
55
55
  "showMore": "להציג יותר",
56
56
  "state": "State",
57
57
  "stateProvince": "State",
58
- "toggleDevTools": "Toggle dev tools",
58
+ "toggleDevTools": "החלפת מצב פיתוח",
59
59
  "unknown": "Unknown",
60
60
  "unsavedChangesInWorkspace": "There may be unsaved changes in \"{{workspaceName}}\". Please save them before opening another workspace.",
61
61
  "unsavedChangesTitleText": "Unsaved changes",
@@ -1,63 +1,63 @@
1
1
  {
2
- "actions": "Actions",
3
- "address": "Address",
4
- "address1": "Address line 1",
5
- "address2": "Address line 2",
6
- "address3": "Address line 3",
7
- "address4": "Address line 4",
8
- "address5": "Address line 5",
9
- "address6": "Address line 6",
10
- "age": "Age",
11
- "cancel": "Cancel",
12
- "change": "Change",
13
- "city": "City",
14
- "cityVillage": "City",
15
- "Clinic": "Clinic",
16
- "close": "Close",
17
- "closeAllOpenedWorkspaces": "Discard changes in {{count}} workspaces",
18
- "closingAllWorkspacesPromptBody": "There are unsaved changes in the following workspaces. Do you want to discard changes in the following workspaces? {{workspaceNames}}",
19
- "closingAllWorkspacesPromptTitle": "You have unsaved changes",
20
- "confirm": "Confirm",
21
- "contactAdministratorIfIssuePersists": "Contact your system administrator if the problem persists.",
22
- "contactDetails": "Contact Details",
23
- "country": "Country",
24
- "countyDistrict": "District",
25
- "delete": "Delete",
26
- "discard": "Discard",
27
- "district": "District",
28
- "edit": "Edit",
29
- "error": "Error",
30
- "errorCopy": "Sorry, there was a problem displaying this information. You can try to reload this page, or contact the site administrator and quote the error code above.",
31
- "female": "Female",
32
- "hide": "Hide",
33
- "loading": "Loading",
34
- "male": "Male",
35
- "maximize": "Maximize",
36
- "minimize": "Minimize",
37
- "openAnyway": "Open Anyway",
38
- "other": "Other",
39
- "patientIdentifierSticker": "Patient identifier sticker",
40
- "patientLists": "Patient Lists",
41
- "postalCode": "Postal code",
42
- "print": "Print",
43
- "printError": "Print error",
44
- "printErrorExplainer": "An error occurred in {{errorLocation}}",
45
- "printIdentifierSticker": "Print identifier sticker",
46
- "printing": "Printing",
47
- "relationships": "Relationships",
48
- "resetOverrides": "Reset overrides",
49
- "save": "Save",
50
- "scriptLoadingError": "Failed to load overridden script from {{url}}. Please check that the bundled script is available at the expected URL. Click the button below to reset all import map overrides.",
51
- "scriptLoadingFailed": "Error: Script failed to load",
52
- "seeMoreLists": "See {{count}} more lists",
53
- "sex": "Sex",
54
- "showLess": "Show less",
55
- "showMore": "Show more",
56
- "state": "State",
57
- "stateProvince": "State",
58
- "toggleDevTools": "Toggle dev tools",
59
- "unknown": "Unknown",
60
- "unsavedChangesInWorkspace": "There may be unsaved changes in \"{{workspaceName}}\". Please save them before opening another workspace.",
61
- "unsavedChangesTitleText": "Unsaved changes",
62
- "workspaceHeader": "Workspace header"
2
+ "actions": "tindakan",
3
+ "address": "alamat",
4
+ "address1": "alamat 1",
5
+ "address2": "alamat 2",
6
+ "address3": "alamat 3",
7
+ "address4": "alamat 4",
8
+ "address5": "alamat 5",
9
+ "address6": "alamat 6",
10
+ "age": "usia",
11
+ "cancel": "batal",
12
+ "change": "ubah",
13
+ "city": "kota",
14
+ "cityVillage": "kelurahan/desa",
15
+ "Clinic": "klinik",
16
+ "close": "tutup",
17
+ "closeAllOpenedWorkspaces": "Hilangkan {{count}} perubahan di area kerja",
18
+ "closingAllWorkspacesPromptBody": "Ada perubahan yang belum disimpan pada area kerja {{workspaceNames}}. Apakah anda yakin menghapus semua perubahan?",
19
+ "closingAllWorkspacesPromptTitle": "konfirmasi penutupan",
20
+ "confirm": "konfirmasi",
21
+ "contactAdministratorIfIssuePersists": "hubungi administrator jika masalah berlanjut",
22
+ "contactDetails": "detail kontak",
23
+ "country": "negara",
24
+ "countyDistrict": "kabupaten",
25
+ "delete": "hapus",
26
+ "discard": "batalkan",
27
+ "district": "kecamatan",
28
+ "edit": "edit",
29
+ "error": "kesalahan",
30
+ "errorCopy": "salinan kesalahan",
31
+ "female": "perempuan",
32
+ "hide": "sembunyikan",
33
+ "loading": "memuat",
34
+ "male": "laki-laki",
35
+ "maximize": "maksimalkan",
36
+ "minimize": "minimalkan",
37
+ "openAnyway": "buka tetap",
38
+ "other": "lainnya",
39
+ "patientIdentifierSticker": "stiker identifikasi pasien",
40
+ "patientLists": "daftar pasien",
41
+ "postalCode": "kode pos",
42
+ "print": "cetak",
43
+ "printError": "kesalahan mencetak",
44
+ "printErrorExplainer": "Terjadi kesalahan di {{errorLocation}}",
45
+ "printIdentifierSticker": "cetak stiker identifikasi",
46
+ "printing": "mencetak",
47
+ "relationships": "relasi",
48
+ "resetOverrides": "atur ulang penimpaan",
49
+ "save": "simpan",
50
+ "scriptLoadingError": "Gagal memuat skrip yang diganti dari {{url}}. Harap periksa apakah skrip yang dibundel tersedia di URL yang diharapkan. Klik tombol di bawah ini untuk menyetel ulang semua penggantian peta impor.",
51
+ "scriptLoadingFailed": "gagal memuat skrip",
52
+ "seeMoreLists": "Lihat {{count}} daftar lebih banyak",
53
+ "sex": "jenis kelamin",
54
+ "showLess": "tampilkan lebih sedikit",
55
+ "showMore": "tampilkan lebih banyak",
56
+ "state": "provinsi",
57
+ "stateProvince": "provinsi",
58
+ "toggleDevTools": "toggle dev tools",
59
+ "unknown": "tidak diketahui",
60
+ "unsavedChangesInWorkspace": "Mungkin ada perubahan yang belum disimpan di \"{{workspaceName}}\". Harap simpan perubahan tersebut sebelum membuka ruang kerja lain.",
61
+ "unsavedChangesTitleText": "perubahan belum disimpan",
62
+ "workspaceHeader": "header ruang kerja"
63
63
  }
@@ -0,0 +1,63 @@
1
+ {
2
+ "actions": "ქმედებები",
3
+ "address": "მისამართი",
4
+ "address1": "მისამართის ხაზი 1",
5
+ "address2": "მისამართის ხაზი 2",
6
+ "address3": "მისამართის ხაზი 3",
7
+ "address4": "მისამართის ხაზი 4",
8
+ "address5": "მისამართის ხაზი 5",
9
+ "address6": "მისამართის ხაზი 6",
10
+ "age": "ასაკი",
11
+ "cancel": "გაუქმება",
12
+ "change": "შეცვლა",
13
+ "city": "ქალაქი",
14
+ "cityVillage": "ქალაქი",
15
+ "Clinic": "კლინიკა",
16
+ "close": "დახურვა",
17
+ "closeAllOpenedWorkspaces": "ცვლილებების გაუქმება {{count}} სამუშაო სივრცეში",
18
+ "closingAllWorkspacesPromptBody": "There are unsaved changes in the following workspaces. Do you want to discard changes in the following workspaces? {{workspaceNames}}",
19
+ "closingAllWorkspacesPromptTitle": "გაქვთ შეუნახავი ცვლილებები",
20
+ "confirm": "დადასტურება",
21
+ "contactAdministratorIfIssuePersists": "Contact your system administrator if the problem persists.",
22
+ "contactDetails": "კონტაქტის დეტალები",
23
+ "country": "ქვეყანა",
24
+ "countyDistrict": "რაიონი",
25
+ "delete": "წაშლა",
26
+ "discard": "მოცილება",
27
+ "district": "რაიონი",
28
+ "edit": "ჩასწორება",
29
+ "error": "შეცდომა",
30
+ "errorCopy": "Sorry, there was a problem displaying this information. You can try to reload this page, or contact the site administrator and quote the error code above.",
31
+ "female": "მდედრი",
32
+ "hide": "დამალვა",
33
+ "loading": "მიმდინარეობს ჩატვირთვა",
34
+ "male": "მამრი",
35
+ "maximize": "გაშლა",
36
+ "minimize": "ჩაკეცვა",
37
+ "openAnyway": "მაინც გახსნა",
38
+ "other": "სხვა",
39
+ "patientIdentifierSticker": "პაკეტის იდენტიფიკატორი ეტიკეტი",
40
+ "patientLists": "პაციენტის სიები",
41
+ "postalCode": "საფოსტო კოდი",
42
+ "print": "დაბეჭდვა",
43
+ "printError": "ბეჭდვის შეცდომა",
44
+ "printErrorExplainer": "აღმოჩენილია შეცდომა {{errorLocation}}-ში",
45
+ "printIdentifierSticker": "იდენტიფიკატორი ეტიკეტის დაბეჭდვა",
46
+ "printing": "დაბეჭდვა",
47
+ "relationships": "ურთიერთობები",
48
+ "resetOverrides": "გადაფარვების ჩამოყრა",
49
+ "save": "შენახვა",
50
+ "scriptLoadingError": "Failed to load overridden script from {{url}}. Please check that the bundled script is available at the expected URL. Click the button below to reset all import map overrides.",
51
+ "scriptLoadingFailed": "შეცდომა: სკრიპტის ჩატვირთვის შეცდომა",
52
+ "seeMoreLists": "კიდევ {{count}} სიის ნახვა",
53
+ "sex": "სქესი",
54
+ "showLess": "ნაკლების ჩვენება",
55
+ "showMore": "მეტის ჩვენება",
56
+ "state": "მდგომარეობა",
57
+ "stateProvince": "შტატი",
58
+ "toggleDevTools": "პროგრამისტის ხელსაწყოების გადართვა",
59
+ "unknown": "უცნობი",
60
+ "unsavedChangesInWorkspace": "There may be unsaved changes in \"{{workspaceName}}\". Please save them before opening another workspace.",
61
+ "unsavedChangesTitleText": "შეუნახავი ცვლილებები",
62
+ "workspaceHeader": "სამუშაო სივრცის თავსართი"
63
+ }
@@ -22,10 +22,10 @@
22
22
  "contactDetails": "Detalhes de contato",
23
23
  "country": "País",
24
24
  "countyDistrict": "Distrito",
25
- "delete": "Delete",
25
+ "delete": "Deletar",
26
26
  "discard": "Descarte",
27
27
  "district": "Distrito",
28
- "edit": "Edit",
28
+ "edit": "Editar",
29
29
  "error": "Erro",
30
30
  "errorCopy": "Desculpe, houve um problema ao exibir essas informações. Você pode tentar recarregar esta página ou entrar em contato com o administrador do site e informar o código de erro acima.",
31
31
  "female": "Feminino",
@@ -0,0 +1,9 @@
1
+ {
2
+ "$schema": "https://json.schemastore.org/tsconfig.json",
3
+ "compilerOptions": {
4
+ "declarationDir": "dist",
5
+ "emitDeclarationOnly": true
6
+ },
7
+ "extends": "./tsconfig.json",
8
+ "exclude": ["**/*.test.*", "**/setup-tests.*"]
9
+ }
package/tsconfig.json CHANGED
@@ -1,23 +1,5 @@
1
1
  {
2
- "compilerOptions": {
3
- "esModuleInterop": true,
4
- "module": "esnext",
5
- "target": "es2015",
6
- "allowSyntheticDefaultImports": true,
7
- "jsx": "react",
8
- "moduleResolution": "node",
9
- "skipLibCheck": true,
10
- "lib": [
11
- "dom",
12
- "es5",
13
- "scripthost",
14
- "es2015",
15
- "es2015.promise",
16
- "es2016.array.include",
17
- "es2018",
18
- "es2020"
19
- ],
20
- "noEmit": true
21
- },
22
- "include": ["src/**/*", "mock.ts"]
2
+ "$schema": "https://json.schemastore.org/tsconfig.json",
3
+ "extends": "../tsconfig.json",
4
+ "include": ["src/**/*.ts*"]
23
5
  }
@@ -1,2 +0,0 @@
1
- System.register(["i18next"],(function(e,r){var t={};return{setters:[function(e){t.default=e.default}],execute:function(){e((()=>{"use strict";var e={64:e=>{e.exports=t}},r={};function n(t){var o=r[t];if(void 0!==o)return o.exports;var i=r[t]={exports:{}};return e[t](i,i.exports,n),i.exports}n.d=(e,r)=>{for(var t in r)n.o(r,t)&&!n.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:r[t]})},n.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var o={};return(()=>{function e(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}n.r(o),n.d(o,{getCoreTranslation:()=>d,translateFrom:()=>l});var r,t,i=(r=function(r){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},o=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(o=o.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),o.forEach((function(t){e(r,t,n[t])}))}return r}({},{address1:"Address line 1",address2:"Address line 2",address3:"Address line 3",address4:"Address line 4",address5:"Address line 5",address6:"Address line 6",city:"City",cityVillage:"City",country:"Country",countyDistrict:"District",district:"District",postalCode:"Postal code",state:"State",stateProvince:"State"},{closeAllOpenedWorkspaces:"Discard changes in {{count}} workspaces",closingAllWorkspacesPromptBody:"There may be unsaved changes in the following workspaces. Do you want to discard changes in the following workspaces? {{workspaceNames}}",closingAllWorkspacesPromptTitle:"You have unsaved changes",discard:"Discard",hide:"Hide",maximize:"Maximize",minimize:"Minimize",openAnyway:"Open anyway",unsavedChangesInOpenedWorkspace:"You may have unsaved changes in the opened workspace. Do you want to discard these changes?",unsavedChangesInWorkspace:'There may be unsaved changes in "{{workspaceName}}". Please save them before opening another workspace.',unsavedChangesTitleText:"Unsaved changes",workspaceHeader:"Workspace header"}),t=null!=(t={actions:"Actions",address:"Address",age:"Age",cancel:"Cancel",change:"Change",Clinic:"Clinic",close:"Close",confirm:"Confirm",contactAdministratorIfIssuePersists:"Contact your system administrator if the problem persists.",contactDetails:"Contact details",delete:"Delete",edit:"Edit",error:"Error",errorCopy:"Sorry, there was a problem displaying this information. You can try to reload this page, or contact the site administrator and quote the error code above.",female:"Female",loading:"Loading",male:"Male",other:"Other",patientIdentifierSticker:"Patient identifier sticker",patientLists:"Patient lists",print:"Print",printError:"Print error",printErrorExplainer:"An error occurred in {{errorLocation}}",printIdentifierSticker:"Print identifier sticker",printing:"Printing",relationships:"Relationships",resetOverrides:"Reset overrides",save:"Save",scriptLoadingFailed:"Error: Script failed to load",scriptLoadingError:"Failed to load overridden script from {{url}}. Please check that the bundled script is available at the expected URL. Click the button below to reset all import map overrides.",seeMoreLists:"See {{count}} more lists",sex:"Sex",showLess:"Show less",showMore:"Show more",toggleDevTools:"Toggle dev tools",unknown:"Unknown"})?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):function(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t}(Object(t)).forEach((function(e){Object.defineProperty(r,e,Object.getOwnPropertyDescriptor(t,e))})),r),s=n(64);function a(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}var c=s.default.default||s.default;function l(e,r,t,n){return c.t(r,function(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{},n=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(t).filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})))),n.forEach((function(r){a(e,r,t[r])}))}return e}({ns:e,defaultValue:t},n))}function d(e,r,t){return i[e]?l("core",e,null!=r?r:i[e],t):(console.error("O3 Core Translations does not provide key '".concat(e,"'. The key itself is being rendered as text.")),e)}c.on("initialized",(function(){window.i18next.loadNamespaces(["core"])}))})(),o})())}}}));
2
- //# sourceMappingURL=openmrs-esm-core-translations.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"openmrs-esm-core-translations.js","mappings":"4JAAAA,EAAOC,QAAUC,C,GCCbC,EAA2B,CAAC,EAGhC,SAASC,EAAoBC,GAE5B,IAAIC,EAAeH,EAAyBE,GAC5C,QAAqBE,IAAjBD,EACH,OAAOA,EAAaL,QAGrB,IAAID,EAASG,EAAyBE,GAAY,CAGjDJ,QAAS,CAAC,GAOX,OAHAO,EAAoBH,GAAUL,EAAQA,EAAOC,QAASG,GAG/CJ,EAAOC,OACf,CCrBAG,EAAoBK,EAAI,CAACR,EAASS,KACjC,IAAI,IAAIC,KAAOD,EACXN,EAAoBQ,EAAEF,EAAYC,KAASP,EAAoBQ,EAAEX,EAASU,IAC5EE,OAAOC,eAAeb,EAASU,EAAK,CAAEI,YAAY,EAAMC,IAAKN,EAAWC,IAE1E,ECNDP,EAAoBQ,EAAI,CAACK,EAAKC,IAAUL,OAAOM,UAAUC,eAAeC,KAAKJ,EAAKC,GCClFd,EAAoBkB,EAAKrB,IACH,oBAAXsB,QAA0BA,OAAOC,aAC1CX,OAAOC,eAAeb,EAASsB,OAAOC,YAAa,CAAEC,MAAO,WAE7DZ,OAAOC,eAAeb,EAAS,aAAc,CAAEwB,OAAO,GAAO,E,qBCL3B,kB,mKAEnC,I,IAkCaC,G,wUAAmB,IAlCV,CACpBC,SAAU,iBACVC,SAAU,iBACVC,SAAU,iBACVC,SAAU,iBACVC,SAAU,iBACVC,SAAU,iBACVC,KAAM,OACNC,YAAa,OACbC,QAAS,UACTC,eAAgB,WAChBC,SAAU,WACVC,WAAY,cACZC,MAAO,QACPC,cAAe,SAGa,CAC5BC,yBAA0B,0CAC1BC,+BACE,2IACFC,gCAAiC,2BACjCC,QAAS,UACTC,KAAM,OACNC,SAAU,WACVC,SAAU,WACVC,WAAY,cACZC,gCAAkC,8FAClCC,0BACE,0GACFC,wBAAyB,kBACzBC,gBAAiB,qB,WAKdC,CACHC,QAAS,UACTC,QAAS,UACTC,IAAK,MACLC,OAAQ,SACRC,OAAQ,SAERC,OAAQ,SACRC,MAAO,QACPC,QAAS,UACTC,oCAAqC,6DACrCC,eAAgB,kBAChBC,OAAQ,SACRC,KAAM,OACNC,MAAO,QACPC,UACE,6JACFC,OAAQ,SACRC,QAAS,UACTC,KAAM,OACNC,MAAO,QACPC,yBAA0B,6BAC1BC,aAAc,gBACdC,MAAO,QACPC,WAAY,cACZC,oBAAqB,yCACrBC,uBAAwB,2BACxBC,SAAU,WACVC,cAAe,gBACfC,eAAgB,kBAChBC,KAAM,OACNC,oBAAqB,+BACrBC,mBACE,kLACFC,aAAc,2BACdC,IAAK,MACLC,SAAU,YACVC,SAAU,YACVC,eAAgB,mBAChBC,QAAS,Y,yVC7EuB,kB,sGAIlC,IAAMC,EAAqB,mBAA2DC,EAAAA,QAmC/E,SAASC,EACdC,EACAlF,EACAmF,EACAC,GAEA,OAAOL,EAAKM,EAAErF,E,sUAAK,EACjBsF,GAAIJ,EACJK,aAAcJ,GACXC,GAEP,CAeO,SAASI,EACdxF,EACAyF,EACAL,GAEA,OAAKrE,EAAiBf,GAIfiF,EAAc,OAAQjF,EAAKyF,QAAAA,EAAe1E,EAAiBf,GAAMoF,IAHtEM,QAAQnC,MAAM,8CAAkD,OAAJvD,EAAI,iDACzDA,EAGX,CA/DA+E,EAAKY,GAAG,eAAe,WACrBC,OAAOC,QAAQC,eAAe,CAAC,QACjC,G","sources":["webpack://@openmrs/esm-translations/external system \"i18next\"","webpack://@openmrs/esm-translations/webpack/bootstrap","webpack://@openmrs/esm-translations/webpack/runtime/define property getters","webpack://@openmrs/esm-translations/webpack/runtime/hasOwnProperty shorthand","webpack://@openmrs/esm-translations/webpack/runtime/make namespace object","webpack://@openmrs/esm-translations/./src/translations.ts","webpack://@openmrs/esm-translations/./src/index.ts"],"sourcesContent":["module.exports = __WEBPACK_EXTERNAL_MODULE__64__;","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","/** Please keep these alphabetized */\n\nconst addressFields = {\n address1: 'Address line 1',\n address2: 'Address line 2',\n address3: 'Address line 3',\n address4: 'Address line 4',\n address5: 'Address line 5',\n address6: 'Address line 6',\n city: 'City',\n cityVillage: 'City',\n country: 'Country',\n countyDistrict: 'District',\n district: 'District',\n postalCode: 'Postal code',\n state: 'State',\n stateProvince: 'State',\n};\n\nconst workspaceTranslations = {\n closeAllOpenedWorkspaces: 'Discard changes in {{count}} workspaces',\n closingAllWorkspacesPromptBody:\n 'There may be unsaved changes in the following workspaces. Do you want to discard changes in the following workspaces? {{workspaceNames}}',\n closingAllWorkspacesPromptTitle: 'You have unsaved changes',\n discard: 'Discard',\n hide: 'Hide',\n maximize: 'Maximize',\n minimize: 'Minimize',\n openAnyway: 'Open anyway',\n unsavedChangesInOpenedWorkspace: `You may have unsaved changes in the opened workspace. Do you want to discard these changes?`,\n unsavedChangesInWorkspace:\n 'There may be unsaved changes in \"{{workspaceName}}\". Please save them before opening another workspace.',\n unsavedChangesTitleText: 'Unsaved changes',\n workspaceHeader: 'Workspace header',\n};\n\nexport const coreTranslations = {\n ...addressFields,\n ...workspaceTranslations,\n actions: 'Actions',\n address: 'Address',\n age: 'Age',\n cancel: 'Cancel',\n change: 'Change',\n // Default value for the implementationName config property\n Clinic: 'Clinic',\n close: 'Close',\n confirm: 'Confirm',\n contactAdministratorIfIssuePersists: 'Contact your system administrator if the problem persists.',\n contactDetails: 'Contact details',\n delete: 'Delete',\n edit: 'Edit',\n error: 'Error',\n errorCopy:\n 'Sorry, there was a problem displaying this information. You can try to reload this page, or contact the site administrator and quote the error code above.',\n female: 'Female',\n loading: 'Loading',\n male: 'Male',\n other: 'Other',\n patientIdentifierSticker: 'Patient identifier sticker',\n patientLists: 'Patient lists',\n print: 'Print',\n printError: 'Print error',\n printErrorExplainer: 'An error occurred in {{errorLocation}}',\n printIdentifierSticker: 'Print identifier sticker',\n printing: 'Printing',\n relationships: 'Relationships',\n resetOverrides: 'Reset overrides',\n save: 'Save',\n scriptLoadingFailed: 'Error: Script failed to load',\n scriptLoadingError:\n 'Failed to load overridden script from {{url}}. Please check that the bundled script is available at the expected URL. Click the button below to reset all import map overrides.',\n seeMoreLists: 'See {{count}} more lists',\n sex: 'Sex',\n showLess: 'Show less',\n showMore: 'Show more',\n toggleDevTools: 'Toggle dev tools',\n unknown: 'Unknown',\n};\n","/** @module @category Translation */\nimport { coreTranslations } from './translations';\nimport _i18n, { i18n, type TOptions } from 'i18next';\n\nconst i18n: typeof _i18n = (_i18n as unknown as { default: typeof _i18n }).default || _i18n;\n\ndeclare global {\n interface Window {\n i18next: i18n;\n }\n}\n\ni18n.on('initialized', function () {\n window.i18next.loadNamespaces(['core']);\n});\n\n/**\n * This function is for getting a translation from a specific module. Use this only if the\n * translation is neither in the app making the call, nor in the core translations.\n * This function is useful, for example, in libraries that are used by multiple apps, since libraries can't\n * define their own translations.\n *\n * Translations within the current app should be accessed with the i18next API, using\n * `useTranslation` and `t` as usual. Core translations should be accessed with the\n * [[getCoreTranslation]] function.\n *\n * IMPORTANT: This function creates a hidden dependency on the module. Worse yet, it creates\n * a dependency specifically on that module's translation keys, which are often regarded as\n * \"implementation details\" and therefore may be volatile. Also note that this function DOES NOT\n * load the module's translations if they have not already been loaded via `useTranslation`.\n * **This function should therefore be avoided when possible.**\n *\n * @param moduleName The module to get the translation from, e.g. '@openmrs/esm-login-app'\n * @param key The i18next translation key\n * @param fallback Fallback text for if the lookup fails\n * @param options Options object passed to the i18next `t` function. See https://www.i18next.com/translation-function/essentials#overview-options\n * for more information. `ns` and `defaultValue` are already set and may not be used.\n * @returns The translated text as a string\n */\nexport function translateFrom(\n moduleName: string,\n key: string,\n fallback?: string,\n options?: Omit<TOptions, 'ns' | 'defaultValue'>,\n) {\n return i18n.t(key, {\n ns: moduleName,\n defaultValue: fallback,\n ...options,\n });\n}\n\nexport type CoreTranslationKey = keyof typeof coreTranslations;\n\n/**\n * Use this function to obtain a translation from the core translations. This is a way to avoid having\n * to define common translations in your app, and to ensure that translations are consistent across\n * different apps. This function is also used to obtain translations in the framework and app shell.\n *\n * The complete set of core translations is available on the `CoreTranslationKey` type. Providing an\n * invalid key to this function will result in a type error.\n *\n * @param options Object passed to the i18next `t` function. See https://www.i18next.com/translation-function/essentials#overview-options\n * for more information. `ns` and `defaultValue` are already set and may not be used.\n */\nexport function getCoreTranslation(\n key: CoreTranslationKey,\n defaultText?: string,\n options?: Omit<TOptions, 'ns' | 'defaultValue'>,\n): string {\n if (!coreTranslations[key]) {\n console.error(`O3 Core Translations does not provide key '${key}'. The key itself is being rendered as text.`);\n return key;\n }\n return translateFrom('core', key, defaultText ?? coreTranslations[key], options);\n}\n"],"names":["module","exports","__WEBPACK_EXTERNAL_MODULE__64__","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","undefined","__webpack_modules__","d","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","r","Symbol","toStringTag","value","coreTranslations","address1","address2","address3","address4","address5","address6","city","cityVillage","country","countyDistrict","district","postalCode","state","stateProvince","closeAllOpenedWorkspaces","closingAllWorkspacesPromptBody","closingAllWorkspacesPromptTitle","discard","hide","maximize","minimize","openAnyway","unsavedChangesInOpenedWorkspace","unsavedChangesInWorkspace","unsavedChangesTitleText","workspaceHeader","workspaceTranslations","actions","address","age","cancel","change","Clinic","close","confirm","contactAdministratorIfIssuePersists","contactDetails","delete","edit","error","errorCopy","female","loading","male","other","patientIdentifierSticker","patientLists","print","printError","printErrorExplainer","printIdentifierSticker","printing","relationships","resetOverrides","save","scriptLoadingFailed","scriptLoadingError","seeMoreLists","sex","showLess","showMore","toggleDevTools","unknown","i18n","_i18n","translateFrom","moduleName","fallback","options","t","ns","defaultValue","getCoreTranslation","defaultText","console","on","window","i18next","loadNamespaces"],"sourceRoot":""}
package/webpack.config.js DELETED
@@ -1,42 +0,0 @@
1
- const ForkTsCheckerWebpackPlugin = require('fork-ts-checker-webpack-plugin');
2
- const { resolve } = require('path');
3
- const { CleanWebpackPlugin } = require('clean-webpack-plugin');
4
- const { BundleAnalyzerPlugin } = require('webpack-bundle-analyzer');
5
-
6
- const { peerDependencies } = require('./package.json');
7
-
8
- module.exports = (env) => ({
9
- entry: [resolve(__dirname, 'src/index.ts')],
10
- output: {
11
- filename: 'openmrs-esm-core-translations.js',
12
- path: resolve(__dirname, 'dist'),
13
- library: { type: 'system' },
14
- },
15
- devtool: 'source-map',
16
- module: {
17
- rules: [
18
- {
19
- test: /\.m?(js|ts|tsx)$/,
20
- exclude: /node_modules/,
21
- use: 'swc-loader',
22
- },
23
- ],
24
- },
25
- externals: Object.keys(peerDependencies || {}),
26
- resolve: {
27
- extensions: ['.ts', '.js', '.tsx', '.jsx'],
28
- },
29
- plugins: [
30
- new CleanWebpackPlugin(),
31
- new ForkTsCheckerWebpackPlugin(),
32
- new BundleAnalyzerPlugin({
33
- analyzerMode: env && env.analyze ? 'static' : 'disabled',
34
- }),
35
- ],
36
- devServer: {
37
- disableHostCheck: true,
38
- headers: {
39
- 'Access-Control-Allow-Origin': '*',
40
- },
41
- },
42
- });