From 25b3c1546c49d8525b43e9d93f8817d6eca7a96b Mon Sep 17 00:00:00 2001 From: Thomas Fransolet Date: Tue, 27 Jul 2021 18:00:08 +0200 Subject: [PATCH] Fix translations bugs in slider --- .../Slider/new_update_image_slider.dart | 15 ++++++++++----- .../Section/section_detail_screen.dart | 2 +- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/lib/Screens/Configurations/Section/SubSection/Slider/new_update_image_slider.dart b/lib/Screens/Configurations/Section/SubSection/Slider/new_update_image_slider.dart index c714c9f..7695d30 100644 --- a/lib/Screens/Configurations/Section/SubSection/Slider/new_update_image_slider.dart +++ b/lib/Screens/Configurations/Section/SubSection/Slider/new_update_image_slider.dart @@ -19,11 +19,16 @@ Future showNewOrUpdateImageSlider(ImageDTO inputImageDTO, AppContext a ManagerAppContext managerAppContext = appContext.getContext(); managerAppContext.selectedConfiguration.languages.forEach((element) { - var translationDTO = new TranslationDTO(); - translationDTO.language = element; - translationDTO.value = ""; - imageDTO.title.add(translationDTO); - imageDTO.description.add(translationDTO); + var translationTitleDTO = new TranslationDTO(); + translationTitleDTO.language = element; + translationTitleDTO.value = ""; + + var translationDescriptionDTO = new TranslationDTO(); + translationDescriptionDTO.language = element; + translationDescriptionDTO.value = ""; + + imageDTO.title.add(translationTitleDTO); + imageDTO.description.add(translationDescriptionDTO); }); } diff --git a/lib/Screens/Configurations/Section/section_detail_screen.dart b/lib/Screens/Configurations/Section/section_detail_screen.dart index 4b8e4df..85f8a58 100644 --- a/lib/Screens/Configurations/Section/section_detail_screen.dart +++ b/lib/Screens/Configurations/Section/section_detail_screen.dart @@ -316,7 +316,6 @@ class _SectionDetailScreenState extends State { return MapConfig( initialValue: sectionDTO.data, onChanged: (String data) { - print(data); sectionDTO.data = data; save(false, sectionDTO, appContext); }, @@ -326,6 +325,7 @@ class _SectionDetailScreenState extends State { initialValue: sectionDTO.data, onChanged: (String data) { sectionDTO.data = data; + save(false, sectionDTO, appContext); }, ); case SectionType.video: