From 42a5d927986c0b8a6904835ff0a672021dddc750 Mon Sep 17 00:00:00 2001 From: naji <naji@cines.fr> Date: Wed, 9 Mar 2022 09:16:03 +0100 Subject: [PATCH] fix: traduction pour version vitamui --- .../file-tree-metadata.component.ts | 11 +++++++---- .../projects/pastis/src/assets/i18n/en.json | 4 +++- .../projects/pastis/src/assets/i18n/fr.json | 4 +++- 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/ui/ui-frontend/projects/pastis/src/app/profile/edit-profile/file-tree-metadata/file-tree-metadata.component.ts b/ui/ui-frontend/projects/pastis/src/app/profile/edit-profile/file-tree-metadata/file-tree-metadata.component.ts index ed6fdfbaf..c64ffc128 100644 --- a/ui/ui-frontend/projects/pastis/src/app/profile/edit-profile/file-tree-metadata/file-tree-metadata.component.ts +++ b/ui/ui-frontend/projects/pastis/src/app/profile/edit-profile/file-tree-metadata/file-tree-metadata.component.ts @@ -72,6 +72,7 @@ import {UserActionAddPuaControlComponent} from '../../../user-actions/add-pua-co const FILE_TREE_METADATA_TRANSLATE_PATH = 'PROFILE.EDIT_PROFILE.FILE_TREE_METADATA'; +const ADD_PUA_CONTROL_TRANSLATE_PATH = 'USER_ACTION.ADD_PUA_CONTROL'; function constantToTranslate() { this.notificationAjoutMetadonnee = this.translated('.NOTIFICATION_AJOUT_METADONNEE'); @@ -81,6 +82,8 @@ function constantToTranslate() { this.popupValider = this.translated('.POPUP_VALIDER'); this.popupAnnuler = this.translated('.POPUP_ANNULER'); this.popupControlOkLabel = this.translated('.POPUP_CONTROL_OK_BUTTON_LABEL'); + this.popupControlSubTitleDialog = this.translated('.POPUP_CONTROL_SUB_TITLE_DIALOG'); + this.popupControlTitleDialog = this.translated('.POPUP_CONTROL_TITLE_DIALOG'); } @Component({ @@ -566,16 +569,16 @@ export class FileTreeMetadataComponent { } setControlsVues(elements: string[]){ - if(elements.includes("Enumération")){ + if((this.isStandalone && elements.includes("Enumération")) || elements.includes(this.translated(ADD_PUA_CONTROL_TRANSLATE_PATH + '.ENUMERATIONS_LABEL'))){ this.enumerationControl = true; } - if(elements.includes("Expression régulière")){ + if((this.isStandalone && elements.includes("Expression régulière")) || elements.includes(this.translated(ADD_PUA_CONTROL_TRANSLATE_PATH + '.EXPRESSION_REGULIERE_LABEL'))){ this.expressionControl = true; } - if(elements.includes("Longueur Min/Max")){ + if((this.isStandalone && elements.includes("Longueur Min/Max")) || elements.includes(this.translated(ADD_PUA_CONTROL_TRANSLATE_PATH + '.LENGTH_MIN_MAX_LABEL'))){ this.lengthControl = true; } - if(elements.includes("Valeur Min/Max")){ + if((this.isStandalone && elements.includes("Valeur Min/Max")) || elements.includes(this.translated(ADD_PUA_CONTROL_TRANSLATE_PATH + '.VALUE_MIN_MAX_LABEL'))){ this.valueControl = true; } diff --git a/ui/ui-frontend/projects/pastis/src/assets/i18n/en.json b/ui/ui-frontend/projects/pastis/src/assets/i18n/en.json index a10de77cc..d80d2fc91 100644 --- a/ui/ui-frontend/projects/pastis/src/assets/i18n/en.json +++ b/ui/ui-frontend/projects/pastis/src/assets/i18n/en.json @@ -183,7 +183,9 @@ "VALEUR_FIXE": "Fixed value", "COMMENTAIRE": "Comment" }, - "POPUP_CONTROL_OK_BUTTON_LABEL": "ADD CONTROLS" + "POPUP_CONTROL_OK_BUTTON_LABEL": "ADD CONTROLS", + "POPUP_CONTROL_SUB_TITLE_DIALOG": "Add additional controls to", + "POPUP_CONTROL_TITLE_DIALOG": "Please select one or more controls" } }, "LIST_PROFILE": { diff --git a/ui/ui-frontend/projects/pastis/src/assets/i18n/fr.json b/ui/ui-frontend/projects/pastis/src/assets/i18n/fr.json index 490100c5a..916462a4e 100644 --- a/ui/ui-frontend/projects/pastis/src/assets/i18n/fr.json +++ b/ui/ui-frontend/projects/pastis/src/assets/i18n/fr.json @@ -183,7 +183,9 @@ "VALEUR_FIXE": "Valeur fixe", "COMMENTAIRE": "Commentaire" }, - "POPUP_CONTROL_OK_BUTTON_LABEL": "AJOUTER LES CONTROLES" + "POPUP_CONTROL_OK_BUTTON_LABEL": "AJOUTER LES CONTROLES", + "POPUP_CONTROL_SUB_TITLE_DIALOG": "Ajouter des contrôles supplémentaires à ", + "POPUP_CONTROL_TITLE_DIALOG": "Veuillez séléctionner un ou plusieurs contrôles" } }, "LIST_PROFILE": { -- GitLab