@dhis2/analytics 21.2.1 → 21.2.5
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/CHANGELOG.md +28 -0
- package/build/cjs/components/TranslationDialog/TranslationModal/TranslationForm.js +20 -17
- package/build/cjs/locales/ar/translations.json +1 -0
- package/build/cjs/locales/ar_EG/translations.json +1 -0
- package/build/cjs/locales/ar_IQ/translations.json +1 -0
- package/build/cjs/locales/ckb/translations.json +1 -0
- package/build/cjs/locales/cs/translations.json +1 -0
- package/build/cjs/locales/da/translations.json +1 -0
- package/build/cjs/locales/es/translations.json +1 -0
- package/build/cjs/locales/fr/translations.json +1 -0
- package/build/cjs/locales/id/translations.json +1 -0
- package/build/cjs/locales/km/translations.json +1 -0
- package/build/cjs/locales/lo/translations.json +1 -0
- package/build/cjs/locales/my/translations.json +1 -0
- package/build/cjs/locales/nb/translations.json +54 -53
- package/build/cjs/locales/nl/translations.json +1 -0
- package/build/cjs/locales/prs/translations.json +1 -0
- package/build/cjs/locales/ps/translations.json +1 -0
- package/build/cjs/locales/pt/translations.json +1 -0
- package/build/cjs/locales/pt_BR/translations.json +1 -0
- package/build/cjs/locales/ru/translations.json +1 -0
- package/build/cjs/locales/sv/translations.json +1 -0
- package/build/cjs/locales/tet/translations.json +1 -0
- package/build/cjs/locales/tg/translations.json +1 -0
- package/build/cjs/locales/uk/translations.json +1 -0
- package/build/cjs/locales/ur/translations.json +1 -0
- package/build/cjs/locales/uz/translations.json +1 -0
- package/build/cjs/locales/uz_Latn/translations.json +1 -0
- package/build/cjs/locales/vi/translations.json +1 -0
- package/build/cjs/locales/zh/translations.json +8 -7
- package/build/cjs/locales/zh_CN/translations.json +1 -0
- package/build/es/components/TranslationDialog/TranslationModal/TranslationForm.js +20 -17
- package/build/es/locales/ar/translations.json +1 -0
- package/build/es/locales/ar_EG/translations.json +1 -0
- package/build/es/locales/ar_IQ/translations.json +1 -0
- package/build/es/locales/ckb/translations.json +1 -0
- package/build/es/locales/cs/translations.json +1 -0
- package/build/es/locales/da/translations.json +1 -0
- package/build/es/locales/es/translations.json +1 -0
- package/build/es/locales/fr/translations.json +1 -0
- package/build/es/locales/id/translations.json +1 -0
- package/build/es/locales/km/translations.json +1 -0
- package/build/es/locales/lo/translations.json +1 -0
- package/build/es/locales/my/translations.json +1 -0
- package/build/es/locales/nb/translations.json +54 -53
- package/build/es/locales/nl/translations.json +1 -0
- package/build/es/locales/prs/translations.json +1 -0
- package/build/es/locales/ps/translations.json +1 -0
- package/build/es/locales/pt/translations.json +1 -0
- package/build/es/locales/pt_BR/translations.json +1 -0
- package/build/es/locales/ru/translations.json +1 -0
- package/build/es/locales/sv/translations.json +1 -0
- package/build/es/locales/tet/translations.json +1 -0
- package/build/es/locales/tg/translations.json +1 -0
- package/build/es/locales/uk/translations.json +1 -0
- package/build/es/locales/ur/translations.json +1 -0
- package/build/es/locales/uz/translations.json +1 -0
- package/build/es/locales/uz_Latn/translations.json +1 -0
- package/build/es/locales/vi/translations.json +1 -0
- package/build/es/locales/zh/translations.json +8 -7
- package/build/es/locales/zh_CN/translations.json +1 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,31 @@
|
|
|
1
|
+
## [21.2.5](https://github.com/dhis2/analytics/compare/v21.2.4...v21.2.5) (2022-01-07)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* **translations:** sync translations from transifex (master) ([43ad8ce](https://github.com/dhis2/analytics/commit/43ad8cee13542f0fe634ebaca4c614b232069d6e))
|
|
7
|
+
|
|
8
|
+
## [21.2.4](https://github.com/dhis2/analytics/compare/v21.2.3...v21.2.4) (2022-01-06)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Bug Fixes
|
|
12
|
+
|
|
13
|
+
* **translations:** sync translations from transifex (master) ([271c764](https://github.com/dhis2/analytics/commit/271c76485718b71bd3d046be2cd8baa130dac01f))
|
|
14
|
+
|
|
15
|
+
## [21.2.3](https://github.com/dhis2/analytics/compare/v21.2.2...v21.2.3) (2022-01-05)
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
### Bug Fixes
|
|
19
|
+
|
|
20
|
+
* fetch translations for field labels from api ([#1119](https://github.com/dhis2/analytics/issues/1119)) ([e2fcacc](https://github.com/dhis2/analytics/commit/e2fcaccbd058a8e85a99e032f6341e7f15a83b94))
|
|
21
|
+
|
|
22
|
+
## [21.2.2](https://github.com/dhis2/analytics/compare/v21.2.1...v21.2.2) (2021-12-28)
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
### Bug Fixes
|
|
26
|
+
|
|
27
|
+
* **translations:** sync translations from transifex (master) ([2657706](https://github.com/dhis2/analytics/commit/2657706a6033413cc0d405933b6d6ed180bd509c))
|
|
28
|
+
|
|
1
29
|
## [21.2.1](https://github.com/dhis2/analytics/compare/v21.2.0...v21.2.1) (2021-12-24)
|
|
2
30
|
|
|
3
31
|
|
|
@@ -37,17 +37,13 @@ const TranslationForm = ({
|
|
|
37
37
|
}) => {
|
|
38
38
|
const [newTranslations, setNewTranslations] = (0, _react.useState)();
|
|
39
39
|
const [translationLocale, setTranslationLocale] = (0, _react.useState)();
|
|
40
|
+
const [fieldsTranslations, setFieldsTranslations] = (0, _react.useState)({});
|
|
40
41
|
const {
|
|
41
42
|
show: showError
|
|
42
43
|
} = (0, _appRuntime.useAlert)(error => error, {
|
|
43
44
|
critical: true
|
|
44
45
|
});
|
|
45
46
|
|
|
46
|
-
const formatFieldLabel = field => {
|
|
47
|
-
field.replace(/[a-z][A-Z]/g, match => [match.charAt(0), match.charAt(1)].join(' ')).toLowerCase();
|
|
48
|
-
return field.charAt(0).toUpperCase() + field.slice(1);
|
|
49
|
-
};
|
|
50
|
-
|
|
51
47
|
const camelCaseToUnderscores = field => field.replace(/[a-z][A-Z]/g, match => [match.charAt(0), match.charAt(1)].join('_')).toLowerCase();
|
|
52
48
|
|
|
53
49
|
const getTranslationIndexForField = field => newTranslations.findIndex(element => element.locale === translationLocale && element.property.toLowerCase() === camelCaseToUnderscores(field));
|
|
@@ -69,6 +65,14 @@ const TranslationForm = ({
|
|
|
69
65
|
setNewTranslations(translationIndex === -1 ? [...newTranslations, newTranslation] : newTranslations.map((translation, index) => index === translationIndex ? newTranslation : translation));
|
|
70
66
|
};
|
|
71
67
|
|
|
68
|
+
const [fetchFieldsTranslations] = (0, _appRuntime.useDataMutation)({
|
|
69
|
+
resource: 'i18n',
|
|
70
|
+
type: 'create',
|
|
71
|
+
data: fieldsToTranslate.map(camelCaseToUnderscores)
|
|
72
|
+
}, {
|
|
73
|
+
onComplete: res => setFieldsTranslations(res),
|
|
74
|
+
onError: error => showError(error)
|
|
75
|
+
});
|
|
72
76
|
const translationsMutationRef = (0, _react.useRef)({
|
|
73
77
|
resource: "".concat(resource, "/translations"),
|
|
74
78
|
type: 'update',
|
|
@@ -85,9 +89,7 @@ const TranslationForm = ({
|
|
|
85
89
|
onTranslationSaved();
|
|
86
90
|
onClose();
|
|
87
91
|
},
|
|
88
|
-
onError: error =>
|
|
89
|
-
showError(error);
|
|
90
|
-
}
|
|
92
|
+
onError: error => showError(error)
|
|
91
93
|
});
|
|
92
94
|
|
|
93
95
|
const onLocaleChange = locale => {
|
|
@@ -100,6 +102,11 @@ const TranslationForm = ({
|
|
|
100
102
|
});
|
|
101
103
|
|
|
102
104
|
(0, _react.useEffect)(() => setTranslationLocale(window.sessionStorage.getItem(SESSION_STORAGE_TRANSLATION_LOCALE_KEY)), []);
|
|
105
|
+
(0, _react.useEffect)(() => {
|
|
106
|
+
const fetchTranslations = () => fetchFieldsTranslations(fieldsToTranslate);
|
|
107
|
+
|
|
108
|
+
fetchTranslations();
|
|
109
|
+
}, [fieldsToTranslate]);
|
|
103
110
|
(0, _react.useEffect)(() => setNewTranslations(translations), [translations]);
|
|
104
111
|
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_ui.ModalContent, null, /*#__PURE__*/_react.default.createElement(_ui.DataTable, {
|
|
105
112
|
layout: "fixed"
|
|
@@ -114,21 +121,17 @@ const TranslationForm = ({
|
|
|
114
121
|
onChange: onLocaleChange
|
|
115
122
|
})))), /*#__PURE__*/_react.default.createElement(_ui.DataTableBody, null, fieldsToTranslate.map((field, index) => /*#__PURE__*/_react.default.createElement(_ui.DataTableRow, {
|
|
116
123
|
key: field
|
|
117
|
-
}, /*#__PURE__*/_react.default.createElement(_ui.DataTableCell, null, /*#__PURE__*/_react.default.createElement(
|
|
118
|
-
|
|
119
|
-
}, /*#__PURE__*/_react.default.createElement(_ui.InputField, {
|
|
120
|
-
label: formatFieldLabel(field),
|
|
124
|
+
}, /*#__PURE__*/_react.default.createElement(_ui.DataTableCell, null, /*#__PURE__*/_react.default.createElement(_ui.InputField, {
|
|
125
|
+
label: fieldsTranslations[field],
|
|
121
126
|
value: objectToTranslate[field],
|
|
122
127
|
readOnly: true
|
|
123
|
-
}))
|
|
124
|
-
|
|
125
|
-
}, /*#__PURE__*/_react.default.createElement(_ui.InputField, {
|
|
126
|
-
label: formatFieldLabel(field),
|
|
128
|
+
})), translationLocale && /*#__PURE__*/_react.default.createElement(_ui.DataTableCell, null, /*#__PURE__*/_react.default.createElement(_ui.InputField, {
|
|
129
|
+
label: fieldsTranslations[field],
|
|
127
130
|
value: getTranslationForField(field),
|
|
128
131
|
onChange: ({
|
|
129
132
|
value
|
|
130
133
|
}) => setTranslationForField(field, value)
|
|
131
|
-
}))
|
|
134
|
+
})), !translationLocale && index === 0 && /*#__PURE__*/_react.default.createElement(_ui.DataTableCell, {
|
|
132
135
|
rowSpan: String(fieldsToTranslate.length)
|
|
133
136
|
}, /*#__PURE__*/_react.default.createElement(_ui.CenteredContent, null, _d2I18n.default.t('Choose a locale to translate from the menu above')))))))), /*#__PURE__*/_react.default.createElement(_TranslationModalActions.TranslationModalActions, {
|
|
134
137
|
onClose: onClose,
|
|
@@ -1,43 +1,43 @@
|
|
|
1
1
|
{
|
|
2
|
-
"view only": "",
|
|
3
|
-
"view and edit": "",
|
|
4
|
-
"all users ({{accessLevel}})": "",
|
|
5
|
-
"{{userOrGroup}} ({{accessLevel}})": "",
|
|
6
|
-
"Shared with {{commaSeparatedListOfUsersAndGroups}}": "",
|
|
7
|
-
"Not shared with any users or groups": "",
|
|
8
|
-
"About this visualization": "",
|
|
2
|
+
"view only": "kun visning",
|
|
3
|
+
"view and edit": "vis og endre",
|
|
4
|
+
"all users ({{accessLevel}})": "alle brukere ({{accessLevel}})",
|
|
5
|
+
"{{userOrGroup}} ({{accessLevel}})": "{{userOrGroup}} ({{accessLevel}})",
|
|
6
|
+
"Shared with {{commaSeparatedListOfUsersAndGroups}}": "Delt med {{commaSeparatedListOfUsersAndGroups}}",
|
|
7
|
+
"Not shared with any users or groups": "Ikke delt med noen brukere eller grupper",
|
|
8
|
+
"About this visualization": "Om denne visualiseringen",
|
|
9
9
|
"No description": "Ingen beskrivelse",
|
|
10
|
-
"Last updated {{time}}": "",
|
|
11
|
-
"Created {{time}} by {{author}}": "",
|
|
12
|
-
"Viewed {{count}} times": "",
|
|
13
|
-
"Viewed {{count}} times_plural": "",
|
|
10
|
+
"Last updated {{time}}": "Sist oppdatert {{time}}",
|
|
11
|
+
"Created {{time}} by {{author}}": "Opprettet {{time}} av {{author}}",
|
|
12
|
+
"Viewed {{count}} times": "Vist 1 gang",
|
|
13
|
+
"Viewed {{count}} times_plural": "Vist {{count}} ganger",
|
|
14
14
|
"Notifications": "Varsler",
|
|
15
|
-
"You're subscribed and getting updates about new interpretations.": "",
|
|
16
|
-
"Unsubscribe": "",
|
|
17
|
-
"Subscribe to get updates about new interpretations.": "",
|
|
18
|
-
"Subscribe": "",
|
|
15
|
+
"You're subscribed and getting updates about new interpretations.": "Du abonnerer og får oppdateringer om nye tolkninger.",
|
|
16
|
+
"Unsubscribe": "Avslutt abonnementet",
|
|
17
|
+
"Subscribe to get updates about new interpretations.": "Abonner for å få oppdateringer om nye tolkninger.",
|
|
18
|
+
"Subscribe": "Abonner",
|
|
19
19
|
"Data Type": "Datatype",
|
|
20
20
|
"All types": "Alle typer",
|
|
21
|
-
"Totals only": "",
|
|
22
|
-
"Details only": "",
|
|
21
|
+
"Totals only": "Kun totaler",
|
|
22
|
+
"Details only": "Kun detaljer",
|
|
23
23
|
"Disaggregation": "Disaggregering",
|
|
24
24
|
"No data": "Ingen data",
|
|
25
25
|
"Loading": "Laster",
|
|
26
|
-
"Search by data item name": "",
|
|
26
|
+
"Search by data item name": "Søk etter datapunktnavn",
|
|
27
27
|
"No items selected": "Ingen elementer er valgt",
|
|
28
28
|
"Selected Items": "Valgte elementer",
|
|
29
|
-
"No indicators found": "",
|
|
30
|
-
"No data elements found": "",
|
|
31
|
-
"No data sets found": "",
|
|
32
|
-
"No event data items found": "",
|
|
33
|
-
"No program indicators found": "",
|
|
34
|
-
"No indicators found for \"{{- searchTerm}}\"": "",
|
|
35
|
-
"No data elements found for \"{{- searchTerm}}\"": "",
|
|
36
|
-
"No data sets found for \"{{- searchTerm}}\"": "",
|
|
37
|
-
"No event data items found for \"{{- searchTerm}}\"": "",
|
|
38
|
-
"No program indicators found for \"{{- searchTerm}}\"": "",
|
|
39
|
-
"Nothing found for \"{{- searchTerm}}\"": "",
|
|
40
|
-
"Metric type": "",
|
|
29
|
+
"No indicators found": "Ingen indikatorer funnet",
|
|
30
|
+
"No data elements found": "Ingen dataelementer funnet",
|
|
31
|
+
"No data sets found": "Ingen datasett funnet",
|
|
32
|
+
"No event data items found": "Ingen hendelsesdataelementer funnet",
|
|
33
|
+
"No program indicators found": "Ingen programindikatorer funnet",
|
|
34
|
+
"No indicators found for \"{{- searchTerm}}\"": "Ingen indikatorer funnet for \"{{- searchTerm}}\"",
|
|
35
|
+
"No data elements found for \"{{- searchTerm}}\"": "Ingen dataelementer funnet for \"{{- searchTerm}}\"",
|
|
36
|
+
"No data sets found for \"{{- searchTerm}}\"": "Ingen datasett funnet for \"{{- searchTerm}}\"",
|
|
37
|
+
"No event data items found for \"{{- searchTerm}}\"": "Ingen hendelsesdataelementer funnet for \"{{- searchTerm}}\"",
|
|
38
|
+
"No program indicators found for \"{{- searchTerm}}\"": "Ingen programindikatorer funnet for \"{{- searchTerm}}\"",
|
|
39
|
+
"Nothing found for \"{{- searchTerm}}\"": "Ingenting funnet for \"{{- searchTerm}}\"",
|
|
40
|
+
"Metric type": "Metrisk type",
|
|
41
41
|
"All metrics": "Alle beregninger",
|
|
42
42
|
"Move to {{axisName}}": "Flytt til {{axisName}}",
|
|
43
43
|
"Add to {{axisName}}": "Legg til {{axisName}}",
|
|
@@ -49,49 +49,49 @@
|
|
|
49
49
|
"Main dimensions": "Hoveddimensjoner",
|
|
50
50
|
"Your dimensions": "Dine dimensjoner",
|
|
51
51
|
"Dimension recommended with selected data": "Dimensjon anbefalt med valgte data",
|
|
52
|
-
"All items": "",
|
|
53
|
-
"Automatically include all items": "",
|
|
54
|
-
"Select all {{- dimensionTitle}} items. With this option, new items added in the future will be automatically included.": "",
|
|
55
|
-
"Manually select items...": "",
|
|
56
|
-
"Nothing found in {{- dimensionTitle}}": "",
|
|
52
|
+
"All items": "Alle elementer",
|
|
53
|
+
"Automatically include all items": "Inkluder automatisk alle elementer",
|
|
54
|
+
"Select all {{- dimensionTitle}} items. With this option, new items added in the future will be automatically included.": "Velg alle {{- dimensionTitle}} elementer. Med dette alternativet vil nye elementer som legges til i fremtiden automatisk inkluderes.",
|
|
55
|
+
"Manually select items...": "Velg elementer manuelt...",
|
|
56
|
+
"Nothing found in {{- dimensionTitle}}": "Ingenting funnet i {{- dimensionTitle}}",
|
|
57
57
|
"Search": "Søk",
|
|
58
|
-
"Nothing found for {{searchTerm}}": "",
|
|
59
|
-
"Delete {{fileType}}": "",
|
|
60
|
-
"This {{fileType}} and related interpretations will be deleted. Continue?": "",
|
|
58
|
+
"Nothing found for {{searchTerm}}": "Ingenting funnet for {{searchTerm}}",
|
|
59
|
+
"Delete {{fileType}}": "Slett {{fileType}}",
|
|
60
|
+
"This {{fileType}} and related interpretations will be deleted. Continue?": "Denne {{fileType}} og relaterte tolkninger vil bli slettet. Fortsette?",
|
|
61
61
|
"Cancel": "Avbryt",
|
|
62
62
|
"Delete": "Slett",
|
|
63
63
|
"File": "Fil",
|
|
64
64
|
"New": "Ny",
|
|
65
|
-
"Open…": "",
|
|
65
|
+
"Open…": "Åpne...",
|
|
66
66
|
"Save": "Lagre",
|
|
67
|
-
"Save…": "",
|
|
68
|
-
"Save as…": "",
|
|
69
|
-
"Rename…": "",
|
|
70
|
-
"Translate…": "",
|
|
71
|
-
"Share…": "",
|
|
72
|
-
"Get link…": "",
|
|
67
|
+
"Save…": "Lagre...",
|
|
68
|
+
"Save as…": "Lagre som...",
|
|
69
|
+
"Rename…": "Gi nytt navn...",
|
|
70
|
+
"Translate…": "Oversette...",
|
|
71
|
+
"Share…": "Dele...",
|
|
72
|
+
"Get link…": "Få lenke…",
|
|
73
73
|
"Open in this app": "Åpne i denne appen",
|
|
74
74
|
"Close": "Lukk",
|
|
75
|
-
"Rename {{fileType}}": "",
|
|
75
|
+
"Rename {{fileType}}": "Gi nytt navn til {{fileType}}",
|
|
76
76
|
"Name": "Navn",
|
|
77
77
|
"Description": "Beskrivelse",
|
|
78
78
|
"Rename": "Gi nytt navn",
|
|
79
|
-
"Save {{fileType}} as": "",
|
|
79
|
+
"Save {{fileType}} as": "Lagre {{fileType}} som",
|
|
80
80
|
"Created by": "Opprettet av",
|
|
81
81
|
"Anyone": "Hvem som helst",
|
|
82
|
-
"Only you": "",
|
|
82
|
+
"Only you": "Bare deg",
|
|
83
83
|
"Others": "Andre",
|
|
84
84
|
"Filter by name": "Filtrer etter navn",
|
|
85
85
|
"Created": "Opprettet",
|
|
86
86
|
"Last updated": "Sist oppdatert",
|
|
87
87
|
"Type": "Type",
|
|
88
88
|
"Clear filters": "Tøm filtre",
|
|
89
|
-
"{{firstItemIndex}}-{{lastItemIndex}} of {{totalNumberOfItems}}": "",
|
|
90
|
-
"All charts": "",
|
|
89
|
+
"{{firstItemIndex}}-{{lastItemIndex}} of {{totalNumberOfItems}}": "{{firstItemIndex}}-{{lastItemIndex}} av {{totalNumberOfItems}}",
|
|
90
|
+
"All charts": "Alle diagrammer",
|
|
91
91
|
"Open": "Åpne",
|
|
92
|
-
"Couldn't load items": "",
|
|
93
|
-
"There was a problem loading items. Try again or contact your system administrator.": "",
|
|
94
|
-
"No items found. Create a new to get started.": "",
|
|
92
|
+
"Couldn't load items": "Kunne ikke laste inn elementer",
|
|
93
|
+
"There was a problem loading items. Try again or contact your system administrator.": "Det oppsto et problem med å laste elementer. Prøv igjen eller kontakt systemadministratoren.",
|
|
94
|
+
"No items found. Create a new to get started.": "Ingen elementer funnet. Opprett en ny for å komme i gang.",
|
|
95
95
|
"No items found. Try adjusting your search or filter options to find what you're looking for.": "",
|
|
96
96
|
"Create new": "Opprett ny",
|
|
97
97
|
"Open a visualization": "",
|
|
@@ -228,6 +228,7 @@
|
|
|
228
228
|
"Choose a locale to translate from the menu above": "",
|
|
229
229
|
"Translate: {{objectName}}": "",
|
|
230
230
|
"Save translations": "",
|
|
231
|
+
"Could not load translations": "",
|
|
231
232
|
"Retry": "",
|
|
232
233
|
"Series": "Serie",
|
|
233
234
|
"Category": "Kategori",
|
|
@@ -218,13 +218,14 @@
|
|
|
218
218
|
"Six-months": "Six-months",
|
|
219
219
|
"Financial Years": "Financial Years",
|
|
220
220
|
"Years": "年",
|
|
221
|
-
"Translating to": "",
|
|
222
|
-
"Choose a locale": "",
|
|
223
|
-
"Base locale reference": "",
|
|
224
|
-
"Choose a locale to translate from the menu above": "",
|
|
225
|
-
"Translate: {{objectName}}": "",
|
|
226
|
-
"Save translations": "",
|
|
227
|
-
"
|
|
221
|
+
"Translating to": "翻译成",
|
|
222
|
+
"Choose a locale": "选择语言环境",
|
|
223
|
+
"Base locale reference": "基本语言环境参考",
|
|
224
|
+
"Choose a locale to translate from the menu above": "从上面的菜单中选择要翻译的语言环境",
|
|
225
|
+
"Translate: {{objectName}}": "翻译:{{objectName}}",
|
|
226
|
+
"Save translations": "保存翻译",
|
|
227
|
+
"Could not load translations": "",
|
|
228
|
+
"Retry": "重试",
|
|
228
229
|
"Series": "系列",
|
|
229
230
|
"Category": "分类",
|
|
230
231
|
"Filter": "过滤器",
|
|
@@ -16,17 +16,13 @@ export const TranslationForm = ({
|
|
|
16
16
|
}) => {
|
|
17
17
|
const [newTranslations, setNewTranslations] = useState();
|
|
18
18
|
const [translationLocale, setTranslationLocale] = useState();
|
|
19
|
+
const [fieldsTranslations, setFieldsTranslations] = useState({});
|
|
19
20
|
const {
|
|
20
21
|
show: showError
|
|
21
22
|
} = useAlert(error => error, {
|
|
22
23
|
critical: true
|
|
23
24
|
});
|
|
24
25
|
|
|
25
|
-
const formatFieldLabel = field => {
|
|
26
|
-
field.replace(/[a-z][A-Z]/g, match => [match.charAt(0), match.charAt(1)].join(' ')).toLowerCase();
|
|
27
|
-
return field.charAt(0).toUpperCase() + field.slice(1);
|
|
28
|
-
};
|
|
29
|
-
|
|
30
26
|
const camelCaseToUnderscores = field => field.replace(/[a-z][A-Z]/g, match => [match.charAt(0), match.charAt(1)].join('_')).toLowerCase();
|
|
31
27
|
|
|
32
28
|
const getTranslationIndexForField = field => newTranslations.findIndex(element => element.locale === translationLocale && element.property.toLowerCase() === camelCaseToUnderscores(field));
|
|
@@ -48,6 +44,14 @@ export const TranslationForm = ({
|
|
|
48
44
|
setNewTranslations(translationIndex === -1 ? [...newTranslations, newTranslation] : newTranslations.map((translation, index) => index === translationIndex ? newTranslation : translation));
|
|
49
45
|
};
|
|
50
46
|
|
|
47
|
+
const [fetchFieldsTranslations] = useDataMutation({
|
|
48
|
+
resource: 'i18n',
|
|
49
|
+
type: 'create',
|
|
50
|
+
data: fieldsToTranslate.map(camelCaseToUnderscores)
|
|
51
|
+
}, {
|
|
52
|
+
onComplete: res => setFieldsTranslations(res),
|
|
53
|
+
onError: error => showError(error)
|
|
54
|
+
});
|
|
51
55
|
const translationsMutationRef = useRef({
|
|
52
56
|
resource: "".concat(resource, "/translations"),
|
|
53
57
|
type: 'update',
|
|
@@ -64,9 +68,7 @@ export const TranslationForm = ({
|
|
|
64
68
|
onTranslationSaved();
|
|
65
69
|
onClose();
|
|
66
70
|
},
|
|
67
|
-
onError: error =>
|
|
68
|
-
showError(error);
|
|
69
|
-
}
|
|
71
|
+
onError: error => showError(error)
|
|
70
72
|
});
|
|
71
73
|
|
|
72
74
|
const onLocaleChange = locale => {
|
|
@@ -79,6 +81,11 @@ export const TranslationForm = ({
|
|
|
79
81
|
});
|
|
80
82
|
|
|
81
83
|
useEffect(() => setTranslationLocale(window.sessionStorage.getItem(SESSION_STORAGE_TRANSLATION_LOCALE_KEY)), []);
|
|
84
|
+
useEffect(() => {
|
|
85
|
+
const fetchTranslations = () => fetchFieldsTranslations(fieldsToTranslate);
|
|
86
|
+
|
|
87
|
+
fetchTranslations();
|
|
88
|
+
}, [fieldsToTranslate]);
|
|
82
89
|
useEffect(() => setNewTranslations(translations), [translations]);
|
|
83
90
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(ModalContent, null, /*#__PURE__*/React.createElement(DataTable, {
|
|
84
91
|
layout: "fixed"
|
|
@@ -93,21 +100,17 @@ export const TranslationForm = ({
|
|
|
93
100
|
onChange: onLocaleChange
|
|
94
101
|
})))), /*#__PURE__*/React.createElement(DataTableBody, null, fieldsToTranslate.map((field, index) => /*#__PURE__*/React.createElement(DataTableRow, {
|
|
95
102
|
key: field
|
|
96
|
-
}, /*#__PURE__*/React.createElement(DataTableCell, null, /*#__PURE__*/React.createElement(
|
|
97
|
-
|
|
98
|
-
}, /*#__PURE__*/React.createElement(InputField, {
|
|
99
|
-
label: formatFieldLabel(field),
|
|
103
|
+
}, /*#__PURE__*/React.createElement(DataTableCell, null, /*#__PURE__*/React.createElement(InputField, {
|
|
104
|
+
label: fieldsTranslations[field],
|
|
100
105
|
value: objectToTranslate[field],
|
|
101
106
|
readOnly: true
|
|
102
|
-
}))
|
|
103
|
-
|
|
104
|
-
}, /*#__PURE__*/React.createElement(InputField, {
|
|
105
|
-
label: formatFieldLabel(field),
|
|
107
|
+
})), translationLocale && /*#__PURE__*/React.createElement(DataTableCell, null, /*#__PURE__*/React.createElement(InputField, {
|
|
108
|
+
label: fieldsTranslations[field],
|
|
106
109
|
value: getTranslationForField(field),
|
|
107
110
|
onChange: ({
|
|
108
111
|
value
|
|
109
112
|
}) => setTranslationForField(field, value)
|
|
110
|
-
}))
|
|
113
|
+
})), !translationLocale && index === 0 && /*#__PURE__*/React.createElement(DataTableCell, {
|
|
111
114
|
rowSpan: String(fieldsToTranslate.length)
|
|
112
115
|
}, /*#__PURE__*/React.createElement(CenteredContent, null, i18n.t('Choose a locale to translate from the menu above')))))))), /*#__PURE__*/React.createElement(TranslationModalActions, {
|
|
113
116
|
onClose: onClose,
|
|
@@ -1,43 +1,43 @@
|
|
|
1
1
|
{
|
|
2
|
-
"view only": "",
|
|
3
|
-
"view and edit": "",
|
|
4
|
-
"all users ({{accessLevel}})": "",
|
|
5
|
-
"{{userOrGroup}} ({{accessLevel}})": "",
|
|
6
|
-
"Shared with {{commaSeparatedListOfUsersAndGroups}}": "",
|
|
7
|
-
"Not shared with any users or groups": "",
|
|
8
|
-
"About this visualization": "",
|
|
2
|
+
"view only": "kun visning",
|
|
3
|
+
"view and edit": "vis og endre",
|
|
4
|
+
"all users ({{accessLevel}})": "alle brukere ({{accessLevel}})",
|
|
5
|
+
"{{userOrGroup}} ({{accessLevel}})": "{{userOrGroup}} ({{accessLevel}})",
|
|
6
|
+
"Shared with {{commaSeparatedListOfUsersAndGroups}}": "Delt med {{commaSeparatedListOfUsersAndGroups}}",
|
|
7
|
+
"Not shared with any users or groups": "Ikke delt med noen brukere eller grupper",
|
|
8
|
+
"About this visualization": "Om denne visualiseringen",
|
|
9
9
|
"No description": "Ingen beskrivelse",
|
|
10
|
-
"Last updated {{time}}": "",
|
|
11
|
-
"Created {{time}} by {{author}}": "",
|
|
12
|
-
"Viewed {{count}} times": "",
|
|
13
|
-
"Viewed {{count}} times_plural": "",
|
|
10
|
+
"Last updated {{time}}": "Sist oppdatert {{time}}",
|
|
11
|
+
"Created {{time}} by {{author}}": "Opprettet {{time}} av {{author}}",
|
|
12
|
+
"Viewed {{count}} times": "Vist 1 gang",
|
|
13
|
+
"Viewed {{count}} times_plural": "Vist {{count}} ganger",
|
|
14
14
|
"Notifications": "Varsler",
|
|
15
|
-
"You're subscribed and getting updates about new interpretations.": "",
|
|
16
|
-
"Unsubscribe": "",
|
|
17
|
-
"Subscribe to get updates about new interpretations.": "",
|
|
18
|
-
"Subscribe": "",
|
|
15
|
+
"You're subscribed and getting updates about new interpretations.": "Du abonnerer og får oppdateringer om nye tolkninger.",
|
|
16
|
+
"Unsubscribe": "Avslutt abonnementet",
|
|
17
|
+
"Subscribe to get updates about new interpretations.": "Abonner for å få oppdateringer om nye tolkninger.",
|
|
18
|
+
"Subscribe": "Abonner",
|
|
19
19
|
"Data Type": "Datatype",
|
|
20
20
|
"All types": "Alle typer",
|
|
21
|
-
"Totals only": "",
|
|
22
|
-
"Details only": "",
|
|
21
|
+
"Totals only": "Kun totaler",
|
|
22
|
+
"Details only": "Kun detaljer",
|
|
23
23
|
"Disaggregation": "Disaggregering",
|
|
24
24
|
"No data": "Ingen data",
|
|
25
25
|
"Loading": "Laster",
|
|
26
|
-
"Search by data item name": "",
|
|
26
|
+
"Search by data item name": "Søk etter datapunktnavn",
|
|
27
27
|
"No items selected": "Ingen elementer er valgt",
|
|
28
28
|
"Selected Items": "Valgte elementer",
|
|
29
|
-
"No indicators found": "",
|
|
30
|
-
"No data elements found": "",
|
|
31
|
-
"No data sets found": "",
|
|
32
|
-
"No event data items found": "",
|
|
33
|
-
"No program indicators found": "",
|
|
34
|
-
"No indicators found for \"{{- searchTerm}}\"": "",
|
|
35
|
-
"No data elements found for \"{{- searchTerm}}\"": "",
|
|
36
|
-
"No data sets found for \"{{- searchTerm}}\"": "",
|
|
37
|
-
"No event data items found for \"{{- searchTerm}}\"": "",
|
|
38
|
-
"No program indicators found for \"{{- searchTerm}}\"": "",
|
|
39
|
-
"Nothing found for \"{{- searchTerm}}\"": "",
|
|
40
|
-
"Metric type": "",
|
|
29
|
+
"No indicators found": "Ingen indikatorer funnet",
|
|
30
|
+
"No data elements found": "Ingen dataelementer funnet",
|
|
31
|
+
"No data sets found": "Ingen datasett funnet",
|
|
32
|
+
"No event data items found": "Ingen hendelsesdataelementer funnet",
|
|
33
|
+
"No program indicators found": "Ingen programindikatorer funnet",
|
|
34
|
+
"No indicators found for \"{{- searchTerm}}\"": "Ingen indikatorer funnet for \"{{- searchTerm}}\"",
|
|
35
|
+
"No data elements found for \"{{- searchTerm}}\"": "Ingen dataelementer funnet for \"{{- searchTerm}}\"",
|
|
36
|
+
"No data sets found for \"{{- searchTerm}}\"": "Ingen datasett funnet for \"{{- searchTerm}}\"",
|
|
37
|
+
"No event data items found for \"{{- searchTerm}}\"": "Ingen hendelsesdataelementer funnet for \"{{- searchTerm}}\"",
|
|
38
|
+
"No program indicators found for \"{{- searchTerm}}\"": "Ingen programindikatorer funnet for \"{{- searchTerm}}\"",
|
|
39
|
+
"Nothing found for \"{{- searchTerm}}\"": "Ingenting funnet for \"{{- searchTerm}}\"",
|
|
40
|
+
"Metric type": "Metrisk type",
|
|
41
41
|
"All metrics": "Alle beregninger",
|
|
42
42
|
"Move to {{axisName}}": "Flytt til {{axisName}}",
|
|
43
43
|
"Add to {{axisName}}": "Legg til {{axisName}}",
|
|
@@ -49,49 +49,49 @@
|
|
|
49
49
|
"Main dimensions": "Hoveddimensjoner",
|
|
50
50
|
"Your dimensions": "Dine dimensjoner",
|
|
51
51
|
"Dimension recommended with selected data": "Dimensjon anbefalt med valgte data",
|
|
52
|
-
"All items": "",
|
|
53
|
-
"Automatically include all items": "",
|
|
54
|
-
"Select all {{- dimensionTitle}} items. With this option, new items added in the future will be automatically included.": "",
|
|
55
|
-
"Manually select items...": "",
|
|
56
|
-
"Nothing found in {{- dimensionTitle}}": "",
|
|
52
|
+
"All items": "Alle elementer",
|
|
53
|
+
"Automatically include all items": "Inkluder automatisk alle elementer",
|
|
54
|
+
"Select all {{- dimensionTitle}} items. With this option, new items added in the future will be automatically included.": "Velg alle {{- dimensionTitle}} elementer. Med dette alternativet vil nye elementer som legges til i fremtiden automatisk inkluderes.",
|
|
55
|
+
"Manually select items...": "Velg elementer manuelt...",
|
|
56
|
+
"Nothing found in {{- dimensionTitle}}": "Ingenting funnet i {{- dimensionTitle}}",
|
|
57
57
|
"Search": "Søk",
|
|
58
|
-
"Nothing found for {{searchTerm}}": "",
|
|
59
|
-
"Delete {{fileType}}": "",
|
|
60
|
-
"This {{fileType}} and related interpretations will be deleted. Continue?": "",
|
|
58
|
+
"Nothing found for {{searchTerm}}": "Ingenting funnet for {{searchTerm}}",
|
|
59
|
+
"Delete {{fileType}}": "Slett {{fileType}}",
|
|
60
|
+
"This {{fileType}} and related interpretations will be deleted. Continue?": "Denne {{fileType}} og relaterte tolkninger vil bli slettet. Fortsette?",
|
|
61
61
|
"Cancel": "Avbryt",
|
|
62
62
|
"Delete": "Slett",
|
|
63
63
|
"File": "Fil",
|
|
64
64
|
"New": "Ny",
|
|
65
|
-
"Open…": "",
|
|
65
|
+
"Open…": "Åpne...",
|
|
66
66
|
"Save": "Lagre",
|
|
67
|
-
"Save…": "",
|
|
68
|
-
"Save as…": "",
|
|
69
|
-
"Rename…": "",
|
|
70
|
-
"Translate…": "",
|
|
71
|
-
"Share…": "",
|
|
72
|
-
"Get link…": "",
|
|
67
|
+
"Save…": "Lagre...",
|
|
68
|
+
"Save as…": "Lagre som...",
|
|
69
|
+
"Rename…": "Gi nytt navn...",
|
|
70
|
+
"Translate…": "Oversette...",
|
|
71
|
+
"Share…": "Dele...",
|
|
72
|
+
"Get link…": "Få lenke…",
|
|
73
73
|
"Open in this app": "Åpne i denne appen",
|
|
74
74
|
"Close": "Lukk",
|
|
75
|
-
"Rename {{fileType}}": "",
|
|
75
|
+
"Rename {{fileType}}": "Gi nytt navn til {{fileType}}",
|
|
76
76
|
"Name": "Navn",
|
|
77
77
|
"Description": "Beskrivelse",
|
|
78
78
|
"Rename": "Gi nytt navn",
|
|
79
|
-
"Save {{fileType}} as": "",
|
|
79
|
+
"Save {{fileType}} as": "Lagre {{fileType}} som",
|
|
80
80
|
"Created by": "Opprettet av",
|
|
81
81
|
"Anyone": "Hvem som helst",
|
|
82
|
-
"Only you": "",
|
|
82
|
+
"Only you": "Bare deg",
|
|
83
83
|
"Others": "Andre",
|
|
84
84
|
"Filter by name": "Filtrer etter navn",
|
|
85
85
|
"Created": "Opprettet",
|
|
86
86
|
"Last updated": "Sist oppdatert",
|
|
87
87
|
"Type": "Type",
|
|
88
88
|
"Clear filters": "Tøm filtre",
|
|
89
|
-
"{{firstItemIndex}}-{{lastItemIndex}} of {{totalNumberOfItems}}": "",
|
|
90
|
-
"All charts": "",
|
|
89
|
+
"{{firstItemIndex}}-{{lastItemIndex}} of {{totalNumberOfItems}}": "{{firstItemIndex}}-{{lastItemIndex}} av {{totalNumberOfItems}}",
|
|
90
|
+
"All charts": "Alle diagrammer",
|
|
91
91
|
"Open": "Åpne",
|
|
92
|
-
"Couldn't load items": "",
|
|
93
|
-
"There was a problem loading items. Try again or contact your system administrator.": "",
|
|
94
|
-
"No items found. Create a new to get started.": "",
|
|
92
|
+
"Couldn't load items": "Kunne ikke laste inn elementer",
|
|
93
|
+
"There was a problem loading items. Try again or contact your system administrator.": "Det oppsto et problem med å laste elementer. Prøv igjen eller kontakt systemadministratoren.",
|
|
94
|
+
"No items found. Create a new to get started.": "Ingen elementer funnet. Opprett en ny for å komme i gang.",
|
|
95
95
|
"No items found. Try adjusting your search or filter options to find what you're looking for.": "",
|
|
96
96
|
"Create new": "Opprett ny",
|
|
97
97
|
"Open a visualization": "",
|
|
@@ -228,6 +228,7 @@
|
|
|
228
228
|
"Choose a locale to translate from the menu above": "",
|
|
229
229
|
"Translate: {{objectName}}": "",
|
|
230
230
|
"Save translations": "",
|
|
231
|
+
"Could not load translations": "",
|
|
231
232
|
"Retry": "",
|
|
232
233
|
"Series": "Serie",
|
|
233
234
|
"Category": "Kategori",
|
|
@@ -218,13 +218,14 @@
|
|
|
218
218
|
"Six-months": "Six-months",
|
|
219
219
|
"Financial Years": "Financial Years",
|
|
220
220
|
"Years": "年",
|
|
221
|
-
"Translating to": "",
|
|
222
|
-
"Choose a locale": "",
|
|
223
|
-
"Base locale reference": "",
|
|
224
|
-
"Choose a locale to translate from the menu above": "",
|
|
225
|
-
"Translate: {{objectName}}": "",
|
|
226
|
-
"Save translations": "",
|
|
227
|
-
"
|
|
221
|
+
"Translating to": "翻译成",
|
|
222
|
+
"Choose a locale": "选择语言环境",
|
|
223
|
+
"Base locale reference": "基本语言环境参考",
|
|
224
|
+
"Choose a locale to translate from the menu above": "从上面的菜单中选择要翻译的语言环境",
|
|
225
|
+
"Translate: {{objectName}}": "翻译:{{objectName}}",
|
|
226
|
+
"Save translations": "保存翻译",
|
|
227
|
+
"Could not load translations": "",
|
|
228
|
+
"Retry": "重试",
|
|
228
229
|
"Series": "系列",
|
|
229
230
|
"Category": "分类",
|
|
230
231
|
"Filter": "过滤器",
|