Handle new language (Arab + Ukrainian)

This commit is contained in:
Fransolet Thomas 2023-01-12 16:34:36 +01:00
parent 9fb7250678
commit 4dbbd2a335
2 changed files with 11 additions and 1 deletions

View File

@ -54,6 +54,16 @@ class MultiStringContainer extends StatelessWidget {
onTap: () {
List<TranslationDTO> newValues = <TranslationDTO>[];
if(initialValue.isNotEmpty) {
languages.forEach((value) {
if(initialValue.contains(value)) {
newValues.add(TranslationDTO.fromJson(jsonDecode(jsonEncode(initialValue.firstWhere((element) => element.language == value)))));
} else {
// New language
newValues.add(TranslationDTO(language: value));
}
});
// Make a copy
initialValue.forEach((value) {
newValues.add(TranslationDTO.fromJson(jsonDecode(jsonEncode(value))));

View File

@ -18,7 +18,7 @@ const kSuccess = Color(0xFF8bc34a);
const List<String> section_types = ["Map", "Slider", "Video", "Web", "Menu", "Quizz", "Article"];
const List<String> map_types = ["none", "normal", "satellite", "terrain", "hybrid"];
const List<String> languages = ["FR", "NL", "EN", "DE", "IT", "ES", "CN", "PL"];
const List<String> languages = ["FR", "NL", "EN", "DE", "IT", "ES", "CN", "PL", "AR", "UK"];
List<ResourceTypeModel> resource_types = [
ResourceTypeModel(label: "image", type: ResourceType.Image),
ResourceTypeModel(label: "image url", type: ResourceType.ImageUrl),