Handle new language (Arab + Ukrainian)
This commit is contained in:
parent
9fb7250678
commit
4dbbd2a335
@ -54,6 +54,16 @@ class MultiStringContainer extends StatelessWidget {
|
|||||||
onTap: () {
|
onTap: () {
|
||||||
List<TranslationDTO> newValues = <TranslationDTO>[];
|
List<TranslationDTO> newValues = <TranslationDTO>[];
|
||||||
if(initialValue.isNotEmpty) {
|
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
|
// Make a copy
|
||||||
initialValue.forEach((value) {
|
initialValue.forEach((value) {
|
||||||
newValues.add(TranslationDTO.fromJson(jsonDecode(jsonEncode(value))));
|
newValues.add(TranslationDTO.fromJson(jsonDecode(jsonEncode(value))));
|
||||||
|
|||||||
@ -18,7 +18,7 @@ const kSuccess = Color(0xFF8bc34a);
|
|||||||
|
|
||||||
const List<String> section_types = ["Map", "Slider", "Video", "Web", "Menu", "Quizz", "Article"];
|
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> 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 = [
|
List<ResourceTypeModel> resource_types = [
|
||||||
ResourceTypeModel(label: "image", type: ResourceType.Image),
|
ResourceTypeModel(label: "image", type: ResourceType.Image),
|
||||||
ResourceTypeModel(label: "image url", type: ResourceType.ImageUrl),
|
ResourceTypeModel(label: "image url", type: ResourceType.ImageUrl),
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user