@opengeoweb/taf 9.21.0 → 9.23.1

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/index.esm.js CHANGED
@@ -8,8 +8,10 @@ import { ReactSortable } from 'react-sortablejs';
8
8
  import Sortable from 'sortablejs';
9
9
  import { useAuthenticationContext } from '@opengeoweb/authentication';
10
10
  import { HIDDEN_INPUT_HELPER_IS_DRAFT, getDeepProperty, useDraftFormHelpers, ReactHookFormHiddenInput, ReactHookFormProvider } from '@opengeoweb/form-fields';
11
- import { dateUtils, useIsMounted, CustomIconButton, CustomTooltip, ToolContainerDraggable, Avatar, getInitials, ToggleMenu, useConfirmationDialog, usePreventBrowserClose, SwitchButton, ToolHeader, AlertBanner, getErrorMessage as getErrorMessage$1, getWarningMessage, LastUpdateTime, usePoller, ErrorBoundary } from '@opengeoweb/shared';
11
+ import { SHARED_NAMESPACE, dateUtils, useIsMounted, CustomIconButton, CustomTooltip, ToolContainerDraggable, Avatar, getInitials, ToggleMenu, useConfirmationDialog, usePreventBrowserClose, SwitchButton, ToolHeader, AlertBanner, getErrorMessage as getErrorMessage$1, getWarningMessage, LastUpdateTime, usePoller, ErrorBoundary } from '@opengeoweb/shared';
12
12
  import { snackbarActions } from '@opengeoweb/snackbar';
13
+ import 'i18next';
14
+ import { useTranslation } from 'react-i18next';
13
15
  import { isEqual } from 'lodash';
14
16
  import { DragHandle as DragHandle$1, ThumbsUp, Add, Delete, Close, Clock, Cancel, Success, Edit, Export, ListItem } from '@opengeoweb/theme';
15
17
  import ReactDOM from 'react-dom';
@@ -19,18 +21,318 @@ import LinearProgress from '@mui/material/LinearProgress';
19
21
  import Box$1 from '@mui/material/Box';
20
22
 
21
23
  var en = {
22
- taf: "Taf"
24
+ "issues-button-title": "View details",
25
+ "issues-pane-none": "Looks good",
26
+ "issues-pane-one": "There is an issue to address",
27
+ "issues-pane-multiple": "There are a few issues to address",
28
+ "status-new-amendment": "new amendment",
29
+ "status-new-correction": "new correction",
30
+ "status-draft-amendment": "draft amendment",
31
+ "status-draft-correction": "draft correction",
32
+ "status-published-amendment": "published amendment",
33
+ "status-published-correction": "published correction",
34
+ "status-new": "new",
35
+ "status-draft": "draft",
36
+ "status-published": "published",
37
+ "status-cancelled": "cancelled",
38
+ "status-expired": "expired",
39
+ "top-tabs-upcoming": "Upcoming",
40
+ "top-tabs-current": "Current",
41
+ "top-tabs-current-expired": "Current & Expired",
42
+ "confirm-dialog-title": "Whoops",
43
+ "confirm-dialog-description": "It's not possible to autosave this TAF due to the presence of issue(s). Are you sure you want to close this TAF? Any changes made will be lost.",
44
+ "confirm-dialog-confirm-label": "Exit without saving",
45
+ "error-auth": "This feature is protected by authentication.",
46
+ "error-auth-message": "Please log in to proceed.",
47
+ "error-list": "An error has occurred while retrieving the list",
48
+ "error-title-retry": "Try again",
49
+ "editor-on": "You are now the editor for TAF {{location}}",
50
+ "editor-off": "You are now no longer the editor for TAF {{location}}",
51
+ "taf-import-message": "TAF {{location}} {{locationLabel}} was imported successfully",
52
+ "taf-import-title": "Import TAC",
53
+ "tac-overview": "TAC Overview",
54
+ "button-cancel": "Cancel",
55
+ "button-correct": "Correct",
56
+ "button-amend": "Amend",
57
+ "button-clear": "Clear",
58
+ "button-save": "Save",
59
+ "button-publish": "Publish",
60
+ "error-cancel": "Cancelling this TAF failed, please try again",
61
+ "error-save": "An error has occurred while saving, please try again",
62
+ "options-insert-above": "Insert 1 row above",
63
+ "options-insert-below": "Insert 1 row below",
64
+ "options-delete": "Delete row",
65
+ "options-clear": "Clear row",
66
+ "confirm-clear-title": "Clear TAF",
67
+ "confirm-clear-content": "Are you sure you would like to clear this TAF? All content will be lost",
68
+ "confirm-publish-content": "Are you sure you want to publish this TAF?",
69
+ "confirm-correct-amend-content": "Do you want to publish it?",
70
+ "confirm-correct-amend-content-no-changes": "Are you sure you want to publish this TAF? You did not make any changes!",
71
+ "confirm-cancel-content": "Are you sure you want to cancel this TAF?",
72
+ "confirm-amend-title": "This TAF is an amendment",
73
+ "confirm-correct-title": "This TAF is a correction",
74
+ "confirm-cancel-title": "Cancel TAF",
75
+ "clear-message": "TAF has been cleared",
76
+ "TAC-missing-data": "Missing data: no TAC can be generated",
77
+ "TAC-not-available": "No TAC available",
78
+ "TAC-retrieving-data": "Retrieving TAC",
79
+ "TAC-failed": "Failed to retrieve TAC",
80
+ "snackbar-auto-save": "All changes have been saved automatically",
81
+ "snackbar-draft": "Saved as draft",
82
+ "snackbar-draft-amend": "Saved as draft amendment",
83
+ "snackbar-draft-correct": "Saved as draft correction",
84
+ "snackbar-publish": "TAF {{location}} {{formattedDate}} {{messageType}} was published successfully",
85
+ "snackbar-cancel": "TAF {{location}} {{formattedDate}} {{messageType}} was cancelled successfully",
86
+ "snackbar-correct": "TAF {{location}} {{formattedDate}} {{messageType}} was corrected successfully",
87
+ "snackbar-amend": "TAF {{location}} {{formattedDate}} {{messageType}} was amended successfully",
88
+ "snackbar-save": "TAF {{location}} {{formattedDate}} {{messageType}} was saved successfully",
89
+ "switch-title": "Switch to editor mode",
90
+ "switch-description": "This TAF is already in edit mode and important information could get lost in the switching process.",
91
+ "switch-confirm": "Edit mode",
92
+ "switch-description-viewer": "Are you sure you want to switch to viewer mode? Your unsaved changes will be lost.",
93
+ "switch-confirm-viewer": "Switch mode",
94
+ "confirm-delete-description": "Are you sure you want to delete this row?",
95
+ "confirm-yes": "Yes",
96
+ "confirm-clear-description": "Are you sure you want to clear this row?",
97
+ "issues-button-0": "0 issues",
98
+ "issues-button-1": "1 issue",
99
+ "issues-button-multiple": "{{amount}} issues"
23
100
  };
24
101
  var fi = {
25
- taf: "Taf"
102
+ "issues-button-title": "Näkymän yksityiskohdat",
103
+ "issues-pane-none": "Hyvältä näyttää",
104
+ "issues-pane-one": "On ilmennyt ongelma, joka tulee ratkaista",
105
+ "issues-pane-multiple": "Useita ratkaistavia ongelmia on ilmennyt",
106
+ "status-new-amendment": "uusi muutos",
107
+ "status-new-correction": "uusi korjaus",
108
+ "status-draft-amendment": "luonnos muutoksesta",
109
+ "status-draft-correction": "luonnos korjauksesta",
110
+ "status-published-amendment": "julkaistu muutos",
111
+ "status-published-correction": "julkaistu korjaus",
112
+ "status-new": "uusi",
113
+ "status-draft": "luonnos",
114
+ "status-published": "julkaistu",
115
+ "status-cancelled": "peruttu",
116
+ "status-expired": "vanhentunut",
117
+ "top-tabs-upcoming": "Tulossa oleva",
118
+ "top-tabs-current": "Nykyinen",
119
+ "top-tabs-current-expired": "Nykyinen ja Vanhentunut",
120
+ "confirm-dialog-title": "Hups",
121
+ "confirm-dialog-description": "Tämän TAF:n automaattitallennus ei ole mahdollista nykyisten virheiden ollessa läsnä. Oletko varma, että haluat sulkea tämän TAF:n? Kaikki tehdyt muutokset menetetään.",
122
+ "confirm-dialog-confirm-label": "Sulje tallentamatta",
123
+ "error-auth": "Tämän toiminnallisuuden käyttäminen vaatii sisäänkirjautumista.",
124
+ "error-auth-message": "Kirjaudu sisään jatkaaksesi",
125
+ "error-list": "Listaa haettaessa on tapahtunut virhe",
126
+ "error-title-retry": "Yritä uudelleen",
127
+ "editor-on": "Olet nyt TAF:n {{location}} editoija",
128
+ "editor-off": "Et ole enää TAF:n {{location}} editoija",
129
+ "taf-import-message": "TAF {{location}} {{locationLabel}} tuotu onnistuneesti",
130
+ "taf-import-title": "Tuo TAC",
131
+ "tac-overview": "TAC:n yleiskatsaus",
132
+ "button-cancel": "Peruuta",
133
+ "button-correct": "Korjaa",
134
+ "button-amend": "Muuta",
135
+ "button-clear": "Tyhjennä",
136
+ "button-save": "Tallenna",
137
+ "button-publish": "Julkaise",
138
+ "error-cancel": "Tämän TAF:n peruuttaminen epäonnistui. Yritä uudelleen",
139
+ "error-save": "Tallentaessa tapahtui virhe. Yritä uudelleen",
140
+ "options-insert-above": "Lisää 1 rivi päälle",
141
+ "options-insert-below": "Lisää 1 rivi alapuolelle",
142
+ "options-delete": "Poista rivi",
143
+ "options-clear": "Tyhjennä rivi",
144
+ "confirm-clear-title": "Tyhjennä TAF",
145
+ "confirm-clear-content": "Oletko varma, että haluat tyhjentää tämän TAF:n? Kaikki sisältö menetetään",
146
+ "confirm-publish-content": "Oletko varma, että haluat julkaista tämän TAF:n?",
147
+ "confirm-correct-amend-content": "Haluatko julkaista sen?",
148
+ "confirm-correct-amend-content-no-changes": "Oletko varma, että haluat julkaista tämän TAF:n? Et ole tehnyt yhtään muutosta.",
149
+ "confirm-cancel-content": "Oletko varma, että haluat perua tämän TAF:n",
150
+ "confirm-amend-title": "Tämä TAF on muutos",
151
+ "confirm-correct-title": "Tämä TAF on korjaus",
152
+ "confirm-cancel-title": "Peru TAF",
153
+ "clear-message": "Tämä TAF on tyhjennetty",
154
+ "TAC-missing-data": "Tietoja puuttuu, TAC:ia ei voida generoida",
155
+ "TAC-not-available": "TAC ei ole saatavilla",
156
+ "TAC-retrieving-data": "Haetaan TAC:ia",
157
+ "TAC-failed": "TAC:n haku epäonnistui",
158
+ "snackbar-auto-save": "Kaikki muutokset tallennettu automaattisesti",
159
+ "snackbar-draft": "Tallenna luonnoksena",
160
+ "snackbar-draft-amend": "Tallenna muutos luonnoksena",
161
+ "snackbar-draft-correct": "Tallenna korjaus luonnoksena",
162
+ "snackbar-publish": "TAF {{location}} {{formattedDate}} {{messageType}} julkaistiin onnistuneest",
163
+ "snackbar-cancel": "TAF {{location}} {{formattedDate}} {{messageType}} peruttiin onnistuneesti",
164
+ "snackbar-correct": "TAF {{location}} {{formattedDate}} {{messageType}} korjattiin onnistuneesti",
165
+ "snackbar-amend": "TAF {{location}} {{formattedDate}} {{messageType}} muutettiin onnistuneesti",
166
+ "snackbar-save": "TAF {{location}} {{formattedDate}} {{messageType}} tallennettiin onnistuneesti",
167
+ "switch-title": "Vaihta editointitilaan",
168
+ "switch-description": "Tämä TAF on jo editointitilassa. Tärkeää tietoa saatetaan menettää, jos editointitilaa vaihdetaan.",
169
+ "switch-confirm": "Editointitila",
170
+ "switch-description-viewer": "Oletko varma, että haluat vaihtaa katselutilaan? Tallentamattomat muutokset menetetään.",
171
+ "switch-confirm-viewer": "Vaihda tilaa",
172
+ "confirm-delete-description": "Oletko varma, että haluat poistaa tämän rivin?",
173
+ "confirm-yes": "Kyllä",
174
+ "confirm-clear-description": "Oletko varma, että haluat tyhjentää tämän rivin?",
175
+ "issues-button-0": "0 ongelmaa",
176
+ "issues-button-1": "1 ongelma",
177
+ "issues-button-multiple": "{{amount}} ongelmaa"
26
178
  };
27
179
  var no = {
28
- taf: "Taf"
180
+ "issues-button-title": "Vis detaljer",
181
+ "issues-pane-none": "Ser bra ut",
182
+ "issues-pane-one": "Det er et problem",
183
+ "issues-pane-multiple": "Det er et par problem",
184
+ "status-new-amendment": "ny amendment",
185
+ "status-new-correction": "ny korreksjon",
186
+ "status-draft-amendment": "utkast amendment",
187
+ "status-draft-correction": "utkast korreksjon",
188
+ "status-published-amendment": "publisert amendment",
189
+ "status-published-correction": "publisert korreksjon",
190
+ "status-new": "ny",
191
+ "status-draft": "utkast",
192
+ "status-published": "publisert",
193
+ "status-cancelled": "annulert",
194
+ "status-expired": "utgått",
195
+ "top-tabs-upcoming": "Kommende",
196
+ "top-tabs-current": "Gjeldende",
197
+ "top-tabs-current-expired": "Gjeldende & Utgått",
198
+ "confirm-dialog-title": "Oops",
199
+ "confirm-dialog-description": "Det er ikke mulig å autolagre denne TAFen fordi det oppsto et problem. Er du sikker på at du vil lukke TAFen? Alle endringer vil gå tapt.",
200
+ "confirm-dialog-confirm-label": "Avslutt uten å lagre",
201
+ "error-auth": "Denne delen er passordbeskyttet.",
202
+ "error-auth-message": "Vennligst logg inn.",
203
+ "error-list": "En feil har oppstått ved henting av liste",
204
+ "error-title-retry": "Prøv igjen",
205
+ "editor-on": "Du er no redaktøren for TAF {{location}}",
206
+ "editor-off": "Du er ikke lenger redaktøren for TAF {{location}}",
207
+ "taf-import-message": "TAF {{location}} {{locationLabel}} ble importert",
208
+ "taf-import-title": "Importer TAC",
209
+ "tac-overview": "TAC Oversikt",
210
+ "button-cancel": "Annuler",
211
+ "button-correct": "Korreksjon",
212
+ "button-amend": "Amend",
213
+ "button-clear": "Tøm",
214
+ "button-save": "Lagre",
215
+ "button-publish": "Publiser",
216
+ "error-cancel": "Annuluering av denne TAF feilet, prøv igjen",
217
+ "error-save": "Det oppstod ein feil ved lagring, prøv igjen",
218
+ "options-insert-above": "Legg til en rad over",
219
+ "options-insert-below": "Legg til en rad under",
220
+ "options-delete": "Fjern rad",
221
+ "options-clear": "Tøm rad",
222
+ "confirm-clear-title": "Tøm TAF",
223
+ "confirm-clear-content": "Er du sikker på at du vil tømme denne TAFen? Alt innhold vil bli tapt",
224
+ "confirm-publish-content": "Er du sikker på at du vil publisere denne TAFen?",
225
+ "confirm-correct-amend-content": "Vil du publisere den?",
226
+ "confirm-correct-amend-content-no-changes": "Er du sikker på at du vil publisere denne TAFen? Du har ikke gjort noen endringer!",
227
+ "confirm-cancel-content": "Er du sikker på at du vil annulere denne TAFen?",
228
+ "confirm-amend-title": "Denne TAFen er et amendment",
229
+ "confirm-correct-title": "Denne TAFen er en korreksjon",
230
+ "confirm-cancel-title": "Annuler TAF",
231
+ "clear-message": "TAF har blitt tømt",
232
+ "TAC-missing-data": "Manglende data: Ingen TAC kan bli generert",
233
+ "TAC-not-available": "Ingen TAC tilgjengelig",
234
+ "TAC-retrieving-data": "Henter TAC",
235
+ "TAC-failed": "Henting av TAC feilet",
236
+ "snackbar-auto-save": "Alle endringer har blitt automatisk lagret",
237
+ "snackbar-draft": "Lagret som utkast",
238
+ "snackbar-draft-amend": "Lagret som utkast amendment",
239
+ "snackbar-draft-correct": "Lagret som utkast korreksjon",
240
+ "snackbar-publish": "TAF {{location}} {{formattedDate}} {{messageType}} ble publisert",
241
+ "snackbar-cancel": "TAF {{location}} {{formattedDate}} {{messageType}} ble kansellert",
242
+ "snackbar-correct": "TAF {{location}} {{formattedDate}} {{messageType}} ble korrigert",
243
+ "snackbar-amend": "TAF {{location}} {{formattedDate}} {{messageType}} ble amendet",
244
+ "snackbar-save": "TAF {{location}} {{formattedDate}} {{messageType}} ble lagret",
245
+ "switch-title": "Skift til redigeringsmodus",
246
+ "switch-description": "Denne TAFen er alt i redigeringsmodus og viktig informasjon vil gå tapt dersom en endrer modus.",
247
+ "switch-confirm": "Redigeringsmodus",
248
+ "switch-description-viewer": "Er du sikkert på at du vil endre til visningsmodus? Dine ulagrede endringer vil gå tapt.",
249
+ "switch-confirm-viewer": "Skift modus",
250
+ "confirm-delete-description": "Er du sikker på at du slette denne raden?",
251
+ "confirm-yes": "Ja",
252
+ "confirm-clear-description": "Er du sikker på at du tømme denne raden?",
253
+ "issues-button-0": "Ingen problem",
254
+ "issues-button-1": "1 problem",
255
+ "issues-button-multiple": "{{amount}} problem"
29
256
  };
30
257
  var nl = {
31
- taf: "Taf"
32
- };
33
- var taf = {
258
+ "issues-button-title": "Bekijk details",
259
+ "issues-pane-none": "Helemaal goed",
260
+ "issues-pane-one": "Er is een probleem",
261
+ "issues-pane-multiple": "Er zijn enkele problemen",
262
+ "status-new-amendment": "nieuwe amendment",
263
+ "status-new-correction": "nieuwe correctie",
264
+ "status-draft-amendment": "concept amendment",
265
+ "status-draft-correction": "concept correctie",
266
+ "status-published-amendment": "gepubliceerde amendment",
267
+ "status-published-correction": "gepubliceerde correctie",
268
+ "status-new": "nieuw",
269
+ "status-draft": "concept",
270
+ "status-published": "gepubliceerd",
271
+ "status-cancelled": "gecancelled",
272
+ "status-expired": "verlopen",
273
+ "top-tabs-upcoming": "Aankomend",
274
+ "top-tabs-current": "Huidig",
275
+ "top-tabs-current-expired": "Huidig & Verlopen",
276
+ "confirm-dialog-title": "Oeps",
277
+ "confirm-dialog-description": "Het is niet mogelijk om deze TAF automatisch op te slaan vanwege de aanwezigheid van een of meerdere issues. Weet je zeker dat je deze TAF wilt sluiten? Niet-opgeslagen wijzigingen gaan verloren.",
278
+ "confirm-dialog-confirm-label": "Sluiten zonder opslaan",
279
+ "error-auth": "Deze functie wordt beschermd door authenticatie.",
280
+ "error-auth-message": "Log in om door te gaan.",
281
+ "error-list": "Er is een fout opgetreden bij het laden van de lijst",
282
+ "error-title-retry": "Probeer opnieuw",
283
+ "editor-on": "Je bent nu de editor van TAF {{location}}",
284
+ "editor-off": "Je bent nu niet langer de editor van TAF {{location}}",
285
+ "taf-import-message": "TAF {{location}} {{locationLabel}} is succesvol geïmporteerd",
286
+ "taf-import-title": "Importeer TAC",
287
+ "tac-overview": "TAC Overzicht",
288
+ "button-cancel": "Annuleren",
289
+ "button-correct": "Correct",
290
+ "button-amend": "Amend",
291
+ "button-clear": "Leegmaken",
292
+ "button-save": "Opslaan",
293
+ "button-publish": "Publiceren",
294
+ "error-cancel": "Het annuleren van deze TAF is mislukt, probeer het opnieuw",
295
+ "error-save": "Er is een probleem opgetreden tijdens het opslaan, probeer het opnieuw",
296
+ "options-insert-above": "Rij boven invoegen",
297
+ "options-insert-below": "Rij onder invoegen",
298
+ "options-delete": "Rij verwijderen",
299
+ "options-clear": "Rij leegmaken",
300
+ "confirm-clear-title": "TAF leegmaken",
301
+ "confirm-clear-content": "Weet je zeker dat je deze TAF leeg wilt maken? Alle inhoud gaat verloren",
302
+ "confirm-publish-content": "Weet je zeker dat je deze TAF wilt publiceren?",
303
+ "confirm-correct-amend-content": "Wil je deze TAF publiceren?",
304
+ "confirm-correct-amend-content-no-changes": "Weet je zeker dat je deze TAF wilt publiceren? Je hebt geen wijzigingen gedaan!",
305
+ "confirm-cancel-content": "Weet je zeker dat je deze TAF wilt annuleren?",
306
+ "confirm-amend-title": "Deze TAF is een amendment",
307
+ "confirm-correct-title": "Deze TAF is een correctie",
308
+ "confirm-cancel-title": "TAF annuleren",
309
+ "clear-message": "TAF is leeggemaakt",
310
+ "TAC-missing-data": "Ontbrekende data: er kan geen TAC worden gegenereerd",
311
+ "TAC-not-available": "Geen TAC beschikbaar",
312
+ "TAC-retrieving-data": "TAC aan het ophalen",
313
+ "TAC-failed": "TAC ophalen is mislukt",
314
+ "snackbar-auto-save": "Alle wijzigingen zijn automatisch opgeslagen",
315
+ "snackbar-draft": "Concept opgeslagen",
316
+ "snackbar-draft-amend": "Concept amendment opgeslagen",
317
+ "snackbar-draft-correct": "Concept correctie opgeslagen",
318
+ "snackbar-publish": "TAF {{location}} {{formattedDate}} {{messageType}} is succesvol gepubliceerd",
319
+ "snackbar-cancel": "TAF {{location}} {{formattedDate}} {{messageType}} is succesvol geannuleerd",
320
+ "snackbar-correct": "TAF {{location}} {{formattedDate}} {{messageType}} is succesvol gecorrigeerd",
321
+ "snackbar-amend": "TAF {{location}} {{formattedDate}} {{messageType}} is succesvol geamendeerd",
322
+ "snackbar-save": "TAF {{location}} {{formattedDate}} {{messageType}} is succesvol opgeslagen",
323
+ "switch-title": "Wissel naar bewerken",
324
+ "switch-description": "Deze TAF wordt al bewerkt door een andere gebruiker en belangrijke informatie kan verloren gaan.",
325
+ "switch-confirm": "Bewerken",
326
+ "switch-description-viewer": "Weet je zeker dat je wilt wisselen naar weergavemodus? Niet-opgeslagen wijzigingen gaan verloren.",
327
+ "switch-confirm-viewer": "Wisselen",
328
+ "confirm-delete-description": "Weet je zeker dat je deze rij wilt verwijderen?",
329
+ "confirm-yes": "Ja",
330
+ "confirm-clear-description": "Weet je zeker dat je deze rij leeg wilt maken?",
331
+ "issues-button-0": "0 problemen",
332
+ "issues-button-1": "1 probleem",
333
+ "issues-button-multiple": "{{amount}} problemen"
334
+ };
335
+ var tafTranslations = {
34
336
  en: en,
35
337
  fi: fi,
36
338
  no: no,
@@ -3467,6 +3769,10 @@ $$5({ target: 'String', proto: true, forced: !correctIsRegExpLogic('includes') }
3467
3769
  }
3468
3770
  });
3469
3771
 
3772
+ const TAF_NAMESPACE = 'taf';
3773
+ const ns = [TAF_NAMESPACE, SHARED_NAMESPACE];
3774
+ const useTafTranslation = () => useTranslation(ns);
3775
+
3470
3776
  const tafActionToDraftAction = tafAction => {
3471
3777
  switch (tafAction) {
3472
3778
  case 'AMEND':
@@ -3497,10 +3803,6 @@ const buttonsStyle = {
3497
3803
  xs: '56px',
3498
3804
  sm: '64px'
3499
3805
  },
3500
- width: {
3501
- xs: '56px',
3502
- sm: '64px'
3503
- },
3504
3806
  marginLeft: {
3505
3807
  xs: 0.5,
3506
3808
  sm: 1
@@ -3513,25 +3815,28 @@ const ViewModeButtons = ({
3513
3815
  canBe,
3514
3816
  onTafViewModeButtonPress
3515
3817
  }) => {
3818
+ const {
3819
+ t
3820
+ } = useTafTranslation();
3516
3821
  return !canBe.includes('CANCELLED') && !canBe.includes('CORRECTED') && !canBe.includes('AMENDED') ? null : jsxs(Fragment, {
3517
3822
  children: [canBe.includes('CANCELLED') && jsx(Button, Object.assign({
3518
3823
  "data-testid": "canceltaf",
3519
3824
  variant: "tertiary",
3520
3825
  onClick: () => onTafViewModeButtonPress('CANCEL')
3521
3826
  }, {
3522
- children: "Cancel"
3827
+ children: t('button-cancel')
3523
3828
  })), canBe.includes('CORRECTED') && jsx(Button, Object.assign({
3524
3829
  "data-testid": "correcttaf",
3525
3830
  variant: "tertiary",
3526
3831
  onClick: () => onTafViewModeButtonPress('CORRECT')
3527
3832
  }, {
3528
- children: "Correct"
3833
+ children: t('button-correct')
3529
3834
  })), canBe.includes('AMENDED') && jsx(Button, Object.assign({
3530
3835
  "data-testid": "amendtaf",
3531
3836
  variant: "tertiary",
3532
3837
  onClick: () => onTafViewModeButtonPress('AMEND')
3533
3838
  }, {
3534
- children: "Amend"
3839
+ children: t('button-amend')
3535
3840
  }))]
3536
3841
  });
3537
3842
  };
@@ -3542,6 +3847,9 @@ const TafFormButtons = ({
3542
3847
  onTafEditModeButtonPress,
3543
3848
  onTafViewModeButtonPress
3544
3849
  }) => {
3850
+ const {
3851
+ t
3852
+ } = useTafTranslation();
3545
3853
  return jsxs(Grid, Object.assign({
3546
3854
  container: true,
3547
3855
  justifyContent: "flex-end",
@@ -3568,7 +3876,7 @@ const TafFormButtons = ({
3568
3876
  onTafEditModeButtonPress('CLEAR');
3569
3877
  }
3570
3878
  }, {
3571
- children: "Clear"
3879
+ children: t('button-clear')
3572
3880
  })), jsx(Button, Object.assign({
3573
3881
  "data-testid": "savedrafttaf",
3574
3882
  variant: "tertiary",
@@ -3583,7 +3891,7 @@ const TafFormButtons = ({
3583
3891
  onTafEditModeButtonPress(tafActionToDraftAction(tafAction));
3584
3892
  }
3585
3893
  }, {
3586
- children: "Save"
3894
+ children: t('button-save')
3587
3895
  })), jsx(Button, Object.assign({
3588
3896
  "data-testid": "publishtaf",
3589
3897
  variant: "tertiary",
@@ -3598,7 +3906,7 @@ const TafFormButtons = ({
3598
3906
  onTafEditModeButtonPress(tafActionToPublishAction(tafAction));
3599
3907
  }
3600
3908
  }, {
3601
- children: "Publish"
3909
+ children: t('button-publish')
3602
3910
  }))]
3603
3911
  })
3604
3912
  })), jsx(Grid, {
@@ -5948,15 +6256,14 @@ const getFieldNames = (isChangeGroup, index) => {
5948
6256
  cloud4: `${namePrefix}.cloud.cloud4`
5949
6257
  });
5950
6258
  };
5951
- const TAC_MISSING_DATA = 'Missing data: no TAC can be generated';
5952
- const TAC_NOT_AVAILABLE = 'No TAC available';
5953
- const TAC_RETRIEVING_DATA = 'Retrieving TAC';
5954
- const TAC_FAILED = 'Failed to retrieve TAC';
5955
- const tacHasError = tac => {
5956
- return tac === TAC_MISSING_DATA || tac === TAC_NOT_AVAILABLE || tac === TAC_RETRIEVING_DATA || tac === TAC_FAILED;
6259
+ const tacHasError = (tac, t) => {
6260
+ return tac === t('TAC-missing-data') || tac === t('TAC-not-available') || tac === t('TAC-retrieving-data') || tac === t('TAC-failed');
5957
6261
  };
5958
6262
  const useTACGenerator = (taf, requestTAC, getJSON = false) => {
5959
- const [TAC, setTAC] = React__default.useState(!taf || taf.status === 'NEW' ? TAC_NOT_AVAILABLE : TAC_RETRIEVING_DATA);
6263
+ const {
6264
+ t
6265
+ } = useTafTranslation();
6266
+ const [TAC, setTAC] = React__default.useState(!taf || taf.status === 'NEW' ? t('TAC-not-available') : t('TAC-retrieving-data'));
5960
6267
  const {
5961
6268
  isMounted
5962
6269
  } = useIsMounted();
@@ -5973,20 +6280,22 @@ const useTACGenerator = (taf, requestTAC, getJSON = false) => {
5973
6280
  controller.current.abort();
5974
6281
  }
5975
6282
  controller.current = new AbortController();
5976
- setTAC(TAC_RETRIEVING_DATA);
6283
+ setTAC(t('TAC-retrieving-data'));
5977
6284
  requestTAC(tafToPost, getJSON, controller.current.signal).then(result => {
5978
6285
  if (isMounted.current) {
5979
6286
  setTAC(result.data);
5980
6287
  }
5981
6288
  }).catch(error => {
5982
6289
  if (isMounted && error.message !== 'canceled') {
5983
- setTAC(TAC_FAILED);
6290
+ setTAC(t('TAC-failed'));
5984
6291
  }
5985
6292
  });
5986
6293
  } else {
5987
- setTAC(TAC_MISSING_DATA);
6294
+ setTAC(t('TAC-missing-data'));
5988
6295
  }
5989
- }, [isMounted, requestTAC, getJSON]);
6296
+ },
6297
+ // eslint-disable-next-line react-hooks/exhaustive-deps
6298
+ [isMounted, requestTAC, getJSON]);
5990
6299
  React__default.useEffect(() => {
5991
6300
  if (taf && taf.status !== 'NEW') {
5992
6301
  retrieveTAC(taf);
@@ -6026,23 +6335,23 @@ const useDragOrder = (trigger, move) => {
6026
6335
  };
6027
6336
  };
6028
6337
  // dialog utils
6029
- const getConfirmationDialogTitle = action => {
6338
+ const getConfirmationDialogTitle = (action, t) => {
6030
6339
  if (action === 'CLEAR') {
6031
- return 'Clear TAF';
6340
+ return t('confirm-clear-title');
6032
6341
  }
6033
6342
  if (action === 'PUBLISH') {
6034
- return 'Publish';
6343
+ return t('button-publish');
6035
6344
  }
6036
6345
  if (action === 'AMEND') {
6037
- return 'This TAF is an amendment';
6346
+ return t('confirm-amend-title');
6038
6347
  }
6039
6348
  if (action === 'CORRECT') {
6040
- return 'This TAF is a correction';
6349
+ return t('confirm-correct-title');
6041
6350
  }
6042
6351
  if (action === 'CANCEL') {
6043
- return 'Cancel TAF';
6352
+ return t('confirm-cancel-title');
6044
6353
  }
6045
- return 'Cancel TAF';
6354
+ return t('confirm-cancel-title');
6046
6355
  };
6047
6356
  // Check if the amended/corrected TAF has been changed. Only compare the fields users are able to fill in
6048
6357
  // (i.e. exclude baseforecast valid time as that gets updated when doing an amendment automatically outside of the users influence)
@@ -6062,30 +6371,31 @@ const isTafAmendedCorrectedChanged = (originalTaf, currentTaf) => {
6062
6371
  const currentNoValid = __rest(currentBaseF, ["valid"]);
6063
6372
  return !isEqual(originalNoValid, currentNoValid) || !isEqual(originalChG, currentChG);
6064
6373
  };
6065
- const getConfirmationDialogContent = (action, isFormDirty) => {
6374
+ const getConfirmationDialogContent = (action, isFormDirty, t) => {
6066
6375
  switch (action) {
6067
6376
  case 'CLEAR':
6068
- return 'Are you sure you would like to clear this TAF? All content will be lost';
6377
+ return t('confirm-clear-content');
6069
6378
  case 'PUBLISH':
6070
- return 'Are you sure you want to publish this TAF?';
6379
+ return t('confirm-publish-content');
6071
6380
  case 'AMEND':
6072
6381
  case 'CORRECT':
6073
- return isFormDirty() ? 'Do you want to publish it?' : 'Are you sure you want to publish the TAF? You did not make any changes!';
6382
+ return isFormDirty() ? t('confirm-correct-amend-content') : t('confirm-correct-amend-content-no-changes');
6383
+ case 'CANCEL':
6074
6384
  default:
6075
- return 'Are you sure you want to cancel this TAF?';
6385
+ return t('confirm-cancel-content');
6076
6386
  }
6077
6387
  };
6078
- const getConfirmationDialogButtonLabel = action => {
6388
+ const getConfirmationDialogButtonLabel = (action, t) => {
6079
6389
  switch (action) {
6080
6390
  case 'CLEAR':
6081
6391
  {
6082
- return 'Clear';
6392
+ return t('button-clear');
6083
6393
  }
6084
6394
  case 'CANCEL':
6085
- return 'Cancel';
6395
+ return t('button-cancel');
6086
6396
  default:
6087
6397
  {
6088
- return 'Publish';
6398
+ return t('button-publish');
6089
6399
  }
6090
6400
  }
6091
6401
  };
@@ -6107,26 +6417,26 @@ const emptyChangegroup = {
6107
6417
  change: '',
6108
6418
  probability: ''
6109
6419
  };
6110
- const getTafStatusLabel = (status, action, isFormDisabled) => {
6420
+ const getTafStatusLabel = (t, status, action, isFormDisabled) => {
6111
6421
  // See if we need to base status label on action if form is not disabled and action passed
6112
6422
  const baseOnAction = isFormDisabled !== undefined && !isFormDisabled && action;
6113
6423
  if (baseOnAction && action === 'AMEND' && (status === 'PUBLISHED' || status === 'AMENDED' || status === 'CORRECTED')) {
6114
- return 'new amendment';
6424
+ return t('status-new-amendment');
6115
6425
  }
6116
6426
  if (baseOnAction && action === 'CORRECT' && (status === 'PUBLISHED' || status === 'AMENDED' || status === 'CORRECTED')) {
6117
- return 'new correction';
6427
+ return t('status-new-correction');
6118
6428
  }
6119
6429
  switch (status) {
6120
6430
  case 'DRAFT_AMENDED':
6121
- return 'draft amendment';
6431
+ return t('status-draft-amendment');
6122
6432
  case 'DRAFT_CORRECTED':
6123
- return 'draft correction';
6433
+ return t('status-draft-correction');
6124
6434
  case 'AMENDED':
6125
- return 'published amendment';
6435
+ return t('status-published-amendment');
6126
6436
  case 'CORRECTED':
6127
- return 'published correction';
6437
+ return t('status-published-correction');
6128
6438
  default:
6129
- return status.toLocaleLowerCase();
6439
+ return t(`status-${status.toLocaleLowerCase()}`);
6130
6440
  }
6131
6441
  };
6132
6442
  const getMessageType = (taf, tafAction) => {
@@ -6302,14 +6612,16 @@ const getCustomError = (error, isChangeGroup, rowIndex) => {
6302
6612
  rowIndex
6303
6613
  });
6304
6614
  };
6305
- const getIssuesLabel = sumOfErrors => {
6615
+ const getIssuesLabel = (sumOfErrors, t) => {
6306
6616
  switch (sumOfErrors) {
6307
6617
  case 0:
6308
- return '0 issues';
6618
+ return t('issues-button-0');
6309
6619
  case 1:
6310
- return '1 issue';
6620
+ return t('issues-button-1');
6311
6621
  default:
6312
- return `${sumOfErrors} issues`;
6622
+ return t('issues-button-multiple', {
6623
+ amount: sumOfErrors
6624
+ });
6313
6625
  }
6314
6626
  };
6315
6627
  const getErrorValues = (fieldErrors, isChangeGroup = false, rowIndex = -1) => {
@@ -6355,6 +6667,9 @@ const IssuesButton = ({
6355
6667
  isIssuesPaneOpen: _isIssuesPaneOpen = false,
6356
6668
  setIsIssuesPaneOpen: _setIsIssuesPaneOpen = () => null
6357
6669
  }) => {
6670
+ const {
6671
+ t
6672
+ } = useTafTranslation();
6358
6673
  const errorList = filterDuplicateErrors(getErrors(_errors));
6359
6674
  const totalErrors = errorList.length;
6360
6675
  const errorStatus = totalErrors > 0 ? 'error' : 'success';
@@ -6377,16 +6692,16 @@ const IssuesButton = ({
6377
6692
  toggleIssuesPane(newPosition);
6378
6693
  };
6379
6694
  return jsx(CustomTooltip, Object.assign({
6380
- title: "View details"
6695
+ title: t('issues-button-title')
6381
6696
  }, {
6382
6697
  children: jsx(Chip, {
6383
6698
  "data-testid": "issuesButton",
6384
6699
  className: `status-${errorStatus}`,
6385
6700
  size: "small",
6386
- label: getIssuesLabel(totalErrors),
6701
+ label: getIssuesLabel(totalErrors, t),
6387
6702
  onClick: onClickButton,
6388
6703
  sx: {
6389
- width: '74px',
6704
+ minWidth: '74px',
6390
6705
  color: '#ffffff',
6391
6706
  backgroundColor: buttonColor,
6392
6707
  '&:hover': {
@@ -6401,14 +6716,14 @@ const IssuesButton = ({
6401
6716
  }));
6402
6717
  };
6403
6718
 
6404
- const getPaneTitle = sumOfErrors => {
6719
+ const getPaneTitle = (sumOfErrors, t) => {
6405
6720
  switch (sumOfErrors) {
6406
6721
  case 0:
6407
- return 'Looks good';
6722
+ return t('issues-pane-none');
6408
6723
  case 1:
6409
- return 'There is an issue to address';
6724
+ return t('issues-pane-one');
6410
6725
  default:
6411
- return 'There are a few issues to address';
6726
+ return t('issues-pane-multiple');
6412
6727
  }
6413
6728
  };
6414
6729
  const humanizeErrorMessage = (errorTitle, fieldNumberedValue) => {
@@ -6455,6 +6770,9 @@ const IssuesPane = ({
6455
6770
  },
6456
6771
  onUserHasDragged: _onUserHasDragged = () => {}
6457
6772
  }) => {
6773
+ const {
6774
+ t
6775
+ } = useTafTranslation();
6458
6776
  const rootElement = document.getElementById(MODAL_DIALOG_ELEMENT) || document.body;
6459
6777
  return /*#__PURE__*/ReactDOM.createPortal(jsx(ToolContainerDraggable, Object.assign({
6460
6778
  startSize: {
@@ -6464,7 +6782,7 @@ const IssuesPane = ({
6464
6782
  startPosition: _startPosition,
6465
6783
  minWidth: 300,
6466
6784
  onClose: handleClose,
6467
- title: getPaneTitle(_errorList.length),
6785
+ title: getPaneTitle(_errorList.length, t),
6468
6786
  isOpen: isOpen,
6469
6787
  "data-testid": "moveable-issues-pane",
6470
6788
  bounds: "parent",
@@ -6852,23 +7170,26 @@ const TafFormOptionsButton = ({
6852
7170
  clearRow,
6853
7171
  index
6854
7172
  }) => {
7173
+ const {
7174
+ t
7175
+ } = useTafTranslation();
6855
7176
  const insertAbove = {
6856
- text: 'Insert 1 row above',
7177
+ text: t('options-insert-above'),
6857
7178
  icon: jsx(Add, {}),
6858
7179
  action: addChangeGroupAbove
6859
7180
  };
6860
7181
  const insertBelow = {
6861
- text: 'Insert 1 row below',
7182
+ text: t('options-insert-below'),
6862
7183
  icon: jsx(Add, {}),
6863
7184
  action: addChangeGroupBelow
6864
7185
  };
6865
7186
  const deleteRow = {
6866
- text: 'Delete row',
7187
+ text: t('options-delete'),
6867
7188
  icon: jsx(Delete, {}),
6868
7189
  action: removeChangeGroup
6869
7190
  };
6870
7191
  const clear = {
6871
- text: 'Clear row',
7192
+ text: t('options-clear'),
6872
7193
  icon: jsx(Close, {}),
6873
7194
  action: clearRow
6874
7195
  };
@@ -7296,9 +7617,6 @@ const TafFormRow = /*#__PURE__*/React__default.forwardRef((_a, ref) => {
7296
7617
 
7297
7618
  // prevents default functionality
7298
7619
  const noop = () => {};
7299
- const getSnackbarMessage$2 = (isChecked, location) => {
7300
- return `You are now ${isChecked ? '' : 'no longer '}the editor for TAF ${location}`;
7301
- };
7302
7620
  const TafForm = /*#__PURE__*/React__default.memo(({
7303
7621
  tafFromBackend,
7304
7622
  onFormAction: _onFormAction = () => null,
@@ -7310,6 +7628,9 @@ const TafForm = /*#__PURE__*/React__default.memo(({
7310
7628
  fetchNewTafList: _fetchNewTafList = () => null,
7311
7629
  previousTaf: _previousTaf = null
7312
7630
  }) => {
7631
+ const {
7632
+ t
7633
+ } = useTafTranslation();
7313
7634
  const formRef = React__default.useRef(null);
7314
7635
  const {
7315
7636
  taf: originalTaf,
@@ -7369,11 +7690,11 @@ const TafForm = /*#__PURE__*/React__default.memo(({
7369
7690
  console.log('submit:', convertTafValuesToObject(data));
7370
7691
  };
7371
7692
  const showConfirmDialog = action => confirmDialog({
7372
- title: getConfirmationDialogTitle(action),
7693
+ title: getConfirmationDialogTitle(action, t),
7373
7694
  description: getConfirmationDialogContent(action, () => isTafAmendedCorrectedChanged(
7374
7695
  // If already saved as draft amd/cor then send over the previous taf
7375
- originalTaf.status === 'DRAFT_AMENDED' || originalTaf.status === 'DRAFT_CORRECTED' ? _previousTaf : originalTaf, convertTafValuesToObject(getValues()))),
7376
- confirmLabel: getConfirmationDialogButtonLabel(action)
7696
+ originalTaf.status === 'DRAFT_AMENDED' || originalTaf.status === 'DRAFT_CORRECTED' ? _previousTaf : originalTaf, convertTafValuesToObject(getValues())), t),
7697
+ confirmLabel: getConfirmationDialogButtonLabel(action, t)
7377
7698
  });
7378
7699
  const resetFormValues = (formData, keepDirty = false) => {
7379
7700
  Object.keys(formData).forEach(key => {
@@ -7421,16 +7742,20 @@ const TafForm = /*#__PURE__*/React__default.memo(({
7421
7742
  }
7422
7743
  if (checked && isLatestEditor(latestEditor, auth === null || auth === void 0 ? void 0 : auth.username)) {
7423
7744
  yield confirmDialog({
7424
- title: 'Switch to editor mode',
7425
- description: 'This TAF is already in edit mode and important information could get lost in the switching process.',
7426
- confirmLabel: 'Edit mode'
7745
+ title: t('switch-title'),
7746
+ description: t('switch-description'),
7747
+ confirmLabel: t('switch-confirm')
7427
7748
  });
7428
7749
  }
7429
7750
  const didSucceed = yield _onSwitchEditor(Object.assign(Object.assign({}, tafFromBackend), {
7430
7751
  editor: username
7431
7752
  }));
7432
7753
  if (didSucceed) {
7433
- showSnackbar(getSnackbarMessage$2(checked, originalTaf.location));
7754
+ showSnackbar(checked ? t('editor-on', {
7755
+ location: originalTaf.location
7756
+ }) : t('editor-off', {
7757
+ location: originalTaf.location
7758
+ }));
7434
7759
  }
7435
7760
  return didSucceed;
7436
7761
  });
@@ -7440,9 +7765,9 @@ const TafForm = /*#__PURE__*/React__default.memo(({
7440
7765
  } = event.target;
7441
7766
  if (!checked && isFormDirty) {
7442
7767
  confirmDialog({
7443
- title: 'Whoops',
7444
- description: 'Are you sure you want to switch to viewer mode? Your unsaved changes will be lost.',
7445
- confirmLabel: 'Switch mode'
7768
+ title: t('confirm-dialog-title'),
7769
+ description: t('switch-description-viewer'),
7770
+ confirmLabel: t('switch-confirm-viewer')
7446
7771
  }).then(() => __awaiter(void 0, void 0, void 0, function* () {
7447
7772
  const didSucceed = yield setIsEditor(checked);
7448
7773
  if (didSucceed) {
@@ -7468,7 +7793,7 @@ const TafForm = /*#__PURE__*/React__default.memo(({
7468
7793
  showConfirmDialog(action).then(() => {
7469
7794
  const emptiedForm = clearTafFormData(getValues());
7470
7795
  resetFormValues(emptiedForm, true);
7471
- showSnackbar('TAF has been cleared');
7796
+ showSnackbar(t('clear-message'));
7472
7797
  });
7473
7798
  break;
7474
7799
  case 'AMEND':
@@ -7523,9 +7848,9 @@ const TafForm = /*#__PURE__*/React__default.memo(({
7523
7848
  };
7524
7849
  const onRemoverow = index => {
7525
7850
  confirmDialog({
7526
- title: 'Delete row',
7527
- description: 'Are you sure you want to delete this row?',
7528
- confirmLabel: 'Yes'
7851
+ title: t('options-delete'),
7852
+ description: t('confirm-delete-description'),
7853
+ confirmLabel: t('confirm-yes')
7529
7854
  }).then(() => {
7530
7855
  remove(index);
7531
7856
  trigger(); // trigger all fields validation
@@ -7553,9 +7878,9 @@ const TafForm = /*#__PURE__*/React__default.memo(({
7553
7878
  };
7554
7879
  const onClearRow = (rowIndex = -1, isChangeGroup = false) => {
7555
7880
  confirmDialog({
7556
- title: 'Clear row',
7557
- description: 'Are you sure you want to clear this row?',
7558
- confirmLabel: 'Yes'
7881
+ title: t('options-clear'),
7882
+ description: t('confirm-clear-description'),
7883
+ confirmLabel: t('confirm-yes')
7559
7884
  }).then(() => {
7560
7885
  if (isChangeGroup) {
7561
7886
  remove(rowIndex);
@@ -8127,12 +8452,15 @@ const StatusIcon = ({
8127
8452
  status,
8128
8453
  timeSlot
8129
8454
  }) => {
8455
+ const {
8456
+ t
8457
+ } = useTafTranslation();
8130
8458
  switch (status) {
8131
8459
  case 'DRAFT':
8132
8460
  case 'DRAFT_AMENDED':
8133
8461
  case 'DRAFT_CORRECTED':
8134
8462
  return jsx(IconWithTooltip, Object.assign({
8135
- title: getTafStatusLabel(status)
8463
+ title: getTafStatusLabel(t, status)
8136
8464
  }, {
8137
8465
  children: jsx(Edit, {
8138
8466
  "data-testid": "status-draft",
@@ -8145,7 +8473,7 @@ const StatusIcon = ({
8145
8473
  case 'CORRECTED':
8146
8474
  case 'AMENDED':
8147
8475
  return jsx(IconWithTooltip, Object.assign({
8148
- title: getTafStatusLabel(status)
8476
+ title: getTafStatusLabel(t, status)
8149
8477
  }, {
8150
8478
  children: timeSlot === 'ACTIVE' ? jsx(Success, {
8151
8479
  "data-testid": "status-active",
@@ -8161,7 +8489,7 @@ const StatusIcon = ({
8161
8489
  }));
8162
8490
  case 'CANCELLED':
8163
8491
  return jsx(IconWithTooltip, Object.assign({
8164
- title: getTafStatusLabel(status)
8492
+ title: getTafStatusLabel(t, status)
8165
8493
  }, {
8166
8494
  children: jsx(Cancel, {
8167
8495
  "data-testid": "status-cancelled",
@@ -8172,7 +8500,7 @@ const StatusIcon = ({
8172
8500
  }));
8173
8501
  case 'EXPIRED':
8174
8502
  return jsx(IconWithTooltip, Object.assign({
8175
- title: getTafStatusLabel(status)
8503
+ title: getTafStatusLabel(t, status)
8176
8504
  }, {
8177
8505
  children: jsx(Clock, {
8178
8506
  "data-testid": "status-expired",
@@ -8188,17 +8516,19 @@ const StatusIcon = ({
8188
8516
  }
8189
8517
  };
8190
8518
 
8191
- const TOOLTIP_TITLE = 'Import TAC';
8192
8519
  const ExportButton = ({
8193
8520
  onClick,
8194
8521
  isHidden
8195
8522
  }) => {
8523
+ const {
8524
+ t
8525
+ } = useTafTranslation();
8196
8526
  return isHidden ? null : jsx(CustomIconButton, Object.assign({
8197
8527
  onClick: onClick,
8198
8528
  "data-testid": "export-tac-button",
8199
8529
  variant: "tool",
8200
8530
  tooltipProps: {
8201
- title: TOOLTIP_TITLE,
8531
+ title: t('taf-import-title'),
8202
8532
  placement: 'left'
8203
8533
  }
8204
8534
  }, {
@@ -8244,14 +8574,14 @@ const AdverseWeatherTACMessage = ({
8244
8574
  }));
8245
8575
  };
8246
8576
 
8247
- const getSnackbarMessage$1 = (location, locationLabel) => {
8248
- return `TAF ${location} ${locationLabel} was imported successfully`;
8249
- };
8250
8577
  const TacContainer = ({
8251
8578
  taf,
8252
8579
  isActive: _isActive = false,
8253
8580
  isFormDisabled: _isFormDisabled = false
8254
8581
  }) => {
8582
+ const {
8583
+ t
8584
+ } = useTafTranslation();
8255
8585
  const {
8256
8586
  api
8257
8587
  } = useApiContext();
@@ -8301,7 +8631,10 @@ const TacContainer = ({
8301
8631
  setTimeout(() => {
8302
8632
  trigger(); // trigger all fields validation
8303
8633
  }, 0);
8304
- showSnackbar(getSnackbarMessage$1(location, locationLabel));
8634
+ showSnackbar(t('taf-import-message', {
8635
+ location,
8636
+ locationLabel
8637
+ }));
8305
8638
  };
8306
8639
  React__default.useEffect(() => {
8307
8640
  if (_isActive) {
@@ -8377,7 +8710,7 @@ const TacContainer = ({
8377
8710
  }))]
8378
8711
  })), jsx(ExportButton, {
8379
8712
  onClick: handleExport,
8380
- isHidden: _isFormDisabled || tacHasError(TAC)
8713
+ isHidden: _isFormDisabled || tacHasError(TAC, t)
8381
8714
  })]
8382
8715
  })), jsx(Box, Object.assign({
8383
8716
  sx: {
@@ -8413,13 +8746,16 @@ const TacOverview = ({
8413
8746
  activeTaf: _activeTaf = null,
8414
8747
  isFormDisabled: _isFormDisabled = false
8415
8748
  }) => {
8749
+ const {
8750
+ t
8751
+ } = useTafTranslation();
8416
8752
  const [activeTab, setActiveTab] = React__default.useState(0);
8417
8753
  const scrollRef = React__default.useRef(null);
8418
8754
  const tabs = [{
8419
- title: 'Upcoming',
8755
+ title: t('top-tabs-upcoming'),
8420
8756
  tafList: _upcomingTafs
8421
8757
  }, {
8422
- title: 'Current & Expired',
8758
+ title: t('top-tabs-current-expired'),
8423
8759
  tafList: sortTafsOnLocation([..._currentTafs, ..._expiredTafs])
8424
8760
  }];
8425
8761
  const activeLocation = (_activeTaf === null || _activeTaf === void 0 ? void 0 : _activeTaf.taf.location) || null;
@@ -8469,7 +8805,7 @@ const TacOverview = ({
8469
8805
  }
8470
8806
  }, {
8471
8807
  children: [!_hideTitle && jsx(TafHeader, {
8472
- title: "TAC Overview"
8808
+ title: t('tac-overview')
8473
8809
  }), jsx(Tabs, Object.assign({
8474
8810
  value: activeTab,
8475
8811
  onChange: onChangeTab,
@@ -8519,6 +8855,9 @@ const TacOverviewMobile = ({
8519
8855
  activeTaf,
8520
8856
  defaultOpen: _defaultOpen = false
8521
8857
  }) => {
8858
+ const {
8859
+ t
8860
+ } = useTafTranslation();
8522
8861
  const [isOpen, toggleOpen] = React.useState(_defaultOpen);
8523
8862
  const onClose = () => toggleOpen(false);
8524
8863
  return jsxs(Fragment, {
@@ -8551,7 +8890,7 @@ const TacOverviewMobile = ({
8551
8890
  "data-testid": "tac-overview-mobile"
8552
8891
  }, {
8553
8892
  children: [jsx(ToolHeader, {
8554
- title: "TAC Overview",
8893
+ title: t('tac-overview'),
8555
8894
  size: "small",
8556
8895
  isDraggable: false,
8557
8896
  onClose: onClose
@@ -8577,6 +8916,9 @@ const TopTabs = ({
8577
8916
  }
8578
8917
  }
8579
8918
  }) => {
8919
+ const {
8920
+ t
8921
+ } = useTafTranslation();
8580
8922
  const {
8581
8923
  formState: {
8582
8924
  isDirty
@@ -8591,10 +8933,10 @@ const TopTabs = ({
8591
8933
  nextBaseTime
8592
8934
  } = getBaseTime(_tafFromBackend.taf.baseTime, _tafFromBackend.taf.location);
8593
8935
  const tabs = [{
8594
- title: `Upcoming ${formatBaseTime(nextBaseTime)}`,
8936
+ title: `${t('top-tabs-upcoming')} ${formatBaseTime(nextBaseTime)}`,
8595
8937
  timeSlot: 'UPCOMING'
8596
8938
  }, {
8597
- title: `Current ${formatBaseTime(currentBaseTime)}`,
8939
+ title: `${t('top-tabs-current')} ${formatBaseTime(currentBaseTime)}`,
8598
8940
  timeSlot: 'ACTIVE'
8599
8941
  }];
8600
8942
  const onChangeTab = (_event, newValue) => {
@@ -8728,7 +9070,7 @@ const fromActionToStatus = tafAction => {
8728
9070
  }
8729
9071
  };
8730
9072
  const isWarning = error => (error === null || error === void 0 ? void 0 : error.type) === 'WARNING';
8731
- const parseErrorMessage = (error, params) => {
9073
+ const parseErrorMessage = (error, params, t) => {
8732
9074
  const message = getErrorMessage$1(error);
8733
9075
  const warningMessage = getWarningMessage(error);
8734
9076
  if (warningMessage) {
@@ -8739,15 +9081,18 @@ const parseErrorMessage = (error, params) => {
8739
9081
  }
8740
9082
  return params.changeStatusTo === 'CANCELLED' ? {
8741
9083
  type: 'CANCELLED',
8742
- title: 'Cancelling this TAF failed, please try again',
9084
+ title: t('error-cancel'),
8743
9085
  message
8744
9086
  } : {
8745
9087
  type: 'SERVER',
8746
- title: 'An error has occurred while saving, please try again',
9088
+ title: t('error-save'),
8747
9089
  message
8748
9090
  };
8749
9091
  };
8750
- const usePostTafRequest = (request, errorParser = parseErrorMessage) => {
9092
+ const usePostTafRequest = request => {
9093
+ const {
9094
+ t
9095
+ } = useTafTranslation();
8751
9096
  const {
8752
9097
  isMounted
8753
9098
  } = useIsMounted();
@@ -8767,10 +9112,11 @@ const usePostTafRequest = (request, errorParser = parseErrorMessage) => {
8767
9112
  if (!isMounted.current) {
8768
9113
  return;
8769
9114
  }
8770
- const newErrorr = errorParser ? errorParser(error, params) : error;
9115
+ const newError = parseErrorMessage(error, params, t);
8771
9116
  setLoading(false);
8772
- setError(newErrorr);
8773
- throw newErrorr;
9117
+ setError(newError);
9118
+ // eslint-disable-next-line @typescript-eslint/no-throw-literal
9119
+ throw newError;
8774
9120
  }
8775
9121
  });
8776
9122
  return {
@@ -8796,6 +9142,9 @@ const TafPanel = ({
8796
9142
  previousTaf: _previousTaf = null,
8797
9143
  tafAction
8798
9144
  }) => {
9145
+ const {
9146
+ t
9147
+ } = useTafTranslation();
8799
9148
  const severity = isWarning(error) ? 'warning' : 'error';
8800
9149
  const onTafAction = (action, taf) => __awaiter(void 0, void 0, void 0, function* () {
8801
9150
  try {
@@ -8827,7 +9176,7 @@ const TafPanel = ({
8827
9176
  "data-testid": `taf-panel${activeTafIndex === index ? '-active' : ''}`
8828
9177
  }, {
8829
9178
  children: [jsx(TafHeader, {
8830
- title: getTafStatusLabel(tafFromBackend.taf.status, tafAction, _isFormDisabled),
9179
+ title: getTafStatusLabel(t, tafFromBackend.taf.status, tafAction, _isFormDisabled),
8831
9180
  sx: {
8832
9181
  marginBottom: '4px'
8833
9182
  }
@@ -8880,44 +9229,44 @@ const IssuesPaneWrapper = props => {
8880
9229
  }, props));
8881
9230
  };
8882
9231
 
8883
- const CONFIRM_DIALOG_OPTIONS = {
8884
- title: 'Whoops',
8885
- description: "It's not possible to autosave this TAF due to the presence of issue(s). Are you sure you want to close this TAF? Any changes made will be lost.",
8886
- confirmLabel: 'Exit without saving'
8887
- };
8888
- const getTafMessagePrefix = ({
9232
+ const getTafMessageContent = ({
8889
9233
  location,
8890
9234
  validDateStart,
8891
9235
  messageType
8892
- }, newStatus) => {
9236
+ }) => {
8893
9237
  const formattedDate = formatBaseTime(dateUtils.utc(validDateStart));
8894
- return `TAF ${location} ${formattedDate} ${messageType} was ${newStatus} successfully`;
9238
+ return {
9239
+ location,
9240
+ formattedDate,
9241
+ messageType
9242
+ };
8895
9243
  };
8896
- const getSnackbarMessage = (tafFromFrontEnd, isAutoSaved = false) => {
9244
+ const getSnackbarMessage = (tafFromFrontEnd, isAutoSaved, t) => {
8897
9245
  const {
8898
9246
  changeStatusTo,
8899
9247
  taf
8900
9248
  } = tafFromFrontEnd;
8901
9249
  if (isAutoSaved) {
8902
- return 'All changes have been saved automatically';
9250
+ return t('snackbar-auto-save');
8903
9251
  }
9252
+ const content = getTafMessageContent(taf);
8904
9253
  switch (changeStatusTo) {
8905
9254
  case 'DRAFT':
8906
- return 'Saved as draft';
9255
+ return t('snackbar-draft');
8907
9256
  case 'DRAFT_AMENDED':
8908
- return 'Saved as draft amendment';
9257
+ return t('snackbar-draft-amend');
8909
9258
  case 'DRAFT_CORRECTED':
8910
- return 'Saved as draft correction';
9259
+ return t('snackbar-draft-correct');
8911
9260
  case 'PUBLISHED':
8912
- return getTafMessagePrefix(taf, 'published');
9261
+ return t('snackbar-publish', content);
8913
9262
  case 'CANCELLED':
8914
- return getTafMessagePrefix(taf, 'cancelled');
9263
+ return t('snackbar-cancel', content);
8915
9264
  case 'CORRECTED':
8916
- return getTafMessagePrefix(taf, 'corrected');
9265
+ return t('snackbar-correct', content);
8917
9266
  case 'AMENDED':
8918
- return getTafMessagePrefix(taf, 'amended');
9267
+ return t('snackbar-amend', content);
8919
9268
  default:
8920
- return getTafMessagePrefix(taf, 'saved');
9269
+ return t('snackbar-save', content);
8921
9270
  }
8922
9271
  };
8923
9272
  const TafLayout = ({
@@ -8925,6 +9274,9 @@ const TafLayout = ({
8925
9274
  onUpdateTaf: _onUpdateTaf = () => null,
8926
9275
  lastUpdateTime
8927
9276
  }) => {
9277
+ const {
9278
+ t
9279
+ } = useTafTranslation();
8928
9280
  const {
8929
9281
  api
8930
9282
  } = useApiContext();
@@ -8970,7 +9322,7 @@ const TafLayout = ({
8970
9322
  try {
8971
9323
  setError(null);
8972
9324
  yield postTafRequest(data);
8973
- showSnackbar(getSnackbarMessage(data, isAutoSaved));
9325
+ showSnackbar(getSnackbarMessage(data, isAutoSaved, t));
8974
9326
  // callback
8975
9327
  _onUpdateTaf();
8976
9328
  } catch (error) {
@@ -8991,6 +9343,11 @@ const TafLayout = ({
8991
9343
  return false;
8992
9344
  }
8993
9345
  });
9346
+ const CONFIRM_DIALOG_OPTIONS = {
9347
+ title: t('confirm-dialog-title'),
9348
+ description: t('confirm-dialog-description'),
9349
+ confirmLabel: t('confirm-dialog-confirm-label')
9350
+ };
8994
9351
  function onChangeTab(action, value, isFormDirty) {
8995
9352
  return __awaiter(this, void 0, void 0, function* () {
8996
9353
  if (isFormDirty) {
@@ -9239,6 +9596,9 @@ const TafWrapper = _a => {
9239
9596
 
9240
9597
  const getCurrentDate = () => dateUtils.dateToString(dateUtils.utc(), dateUtils.DATE_FORMAT_HOURS);
9241
9598
  const TafModule = () => {
9599
+ const {
9600
+ t
9601
+ } = useTafTranslation();
9242
9602
  const {
9243
9603
  api
9244
9604
  } = useApiContext();
@@ -9249,8 +9609,8 @@ const TafModule = () => {
9249
9609
  const {
9250
9610
  isLoggedIn
9251
9611
  } = useAuthenticationContext();
9252
- const ERROR_AUTH = 'This feature is protected by authentication.';
9253
- const ERROR_AUTH_MESSAGE = 'Please log in to proceed.';
9612
+ const ERROR_AUTH = t('error-auth');
9613
+ const ERROR_AUTH_MESSAGE = t('error-auth-message');
9254
9614
  const fetchNewTafList = () => __awaiter(void 0, void 0, void 0, function* () {
9255
9615
  setIsLoading(true);
9256
9616
  setErrorMessage(null);
@@ -9262,7 +9622,7 @@ const TafModule = () => {
9262
9622
  return result.data;
9263
9623
  } catch (error) {
9264
9624
  setErrorMessage({
9265
- title: 'An error has occurred while retrieving the list',
9625
+ title: t('error-list'),
9266
9626
  info: error.message
9267
9627
  });
9268
9628
  setIsLoading(false);
@@ -9305,7 +9665,7 @@ const TafModule = () => {
9305
9665
  info: errorMessage.info,
9306
9666
  "data-testid": "error-message",
9307
9667
  actionButtonProps: errorMessage.title !== ERROR_AUTH ? {
9308
- title: 'Try again',
9668
+ title: t('error-title-retry'),
9309
9669
  onClick: fetchNewTafList
9310
9670
  } : undefined
9311
9671
  }) : null, jsx(TafLayout, {
@@ -10452,4 +10812,4 @@ ConnectedModuleWrapper = null) => {
10452
10812
  }
10453
10813
  };
10454
10814
 
10455
- export { TafApiWrapper, TafForm, Wrapper as TafModule, componentsLookUp, createApi$1 as createApi, createApi as createFakeApi, tafScreenPreset, taf as tafTranslations };
10815
+ export { TAF_NAMESPACE, TafApiWrapper, TafForm, Wrapper as TafModule, componentsLookUp, createApi$1 as createApi, createApi as createFakeApi, tafScreenPreset, tafTranslations };