From 636c64297b14e49876c8a7efd4b3035918a169af Mon Sep 17 00:00:00 2001 From: Fransolet Thomas Date: Wed, 14 Sep 2022 16:33:08 +0200 Subject: [PATCH] Add more language handle --- .flutter-plugins-dependencies | 2 +- .packages | 3 +- assets/images/cn.svg | 11 + assets/images/de.svg | 5 + assets/images/en.svg | 7 + assets/images/es.svg | 547 ++++++++++++++++++++++++++ assets/images/fr.svg | 7 + assets/images/it.svg | 7 + assets/images/nl.svg | 5 + assets/images/pl.svg | 6 + lib/Components/LanguageSelection.dart | 6 +- lib/constants.dart | 2 +- lib/translations.dart | 24 ++ pubspec.lock | 9 +- pubspec.yaml | 2 +- 15 files changed, 637 insertions(+), 6 deletions(-) create mode 100644 assets/images/cn.svg create mode 100644 assets/images/de.svg create mode 100644 assets/images/en.svg create mode 100644 assets/images/es.svg create mode 100644 assets/images/fr.svg create mode 100644 assets/images/it.svg create mode 100644 assets/images/nl.svg create mode 100644 assets/images/pl.svg diff --git a/.flutter-plugins-dependencies b/.flutter-plugins-dependencies index 7b1a26a..4490ea8 100644 --- a/.flutter-plugins-dependencies +++ b/.flutter-plugins-dependencies @@ -1 +1 @@ -{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"qr_code_scanner","path":"C:\\\\Users\\\\thoma\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dartlang.org\\\\qr_code_scanner-1.0.1\\\\","native_build":true,"dependencies":[]},{"name":"sqflite","path":"C:\\\\Users\\\\thoma\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dartlang.org\\\\sqflite-2.0.3+1\\\\","native_build":true,"dependencies":[]}],"android":[{"name":"qr_code_scanner","path":"C:\\\\Users\\\\thoma\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dartlang.org\\\\qr_code_scanner-1.0.1\\\\","native_build":true,"dependencies":[]},{"name":"sqflite","path":"C:\\\\Users\\\\thoma\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dartlang.org\\\\sqflite-2.0.3+1\\\\","native_build":true,"dependencies":[]}],"macos":[{"name":"sqflite","path":"C:\\\\Users\\\\thoma\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dartlang.org\\\\sqflite-2.0.3+1\\\\","native_build":true,"dependencies":[]}],"linux":[],"windows":[],"web":[]},"dependencyGraph":[{"name":"qr_code_scanner","dependencies":[]},{"name":"sqflite","dependencies":[]}],"date_created":"2022-09-10 23:41:31.829523","version":"3.0.3"} \ No newline at end of file +{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"qr_code_scanner","path":"C:\\\\Users\\\\thoma\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dartlang.org\\\\qr_code_scanner-1.0.1\\\\","native_build":true,"dependencies":[]},{"name":"sqflite","path":"C:\\\\Users\\\\thoma\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dartlang.org\\\\sqflite-2.0.3+1\\\\","native_build":true,"dependencies":[]}],"android":[{"name":"qr_code_scanner","path":"C:\\\\Users\\\\thoma\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dartlang.org\\\\qr_code_scanner-1.0.1\\\\","native_build":true,"dependencies":[]},{"name":"sqflite","path":"C:\\\\Users\\\\thoma\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dartlang.org\\\\sqflite-2.0.3+1\\\\","native_build":true,"dependencies":[]}],"macos":[{"name":"sqflite","path":"C:\\\\Users\\\\thoma\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dartlang.org\\\\sqflite-2.0.3+1\\\\","native_build":true,"dependencies":[]}],"linux":[],"windows":[],"web":[]},"dependencyGraph":[{"name":"qr_code_scanner","dependencies":[]},{"name":"sqflite","dependencies":[]}],"date_created":"2022-09-14 16:20:24.401499","version":"3.0.3"} \ No newline at end of file diff --git a/.packages b/.packages index 4c53d44..11e7747 100644 --- a/.packages +++ b/.packages @@ -3,7 +3,7 @@ # # For more info see: https://dart.dev/go/dot-packages-deprecation # -# Generated by pub on 2022-09-10 22:13:09.133757. +# Generated by pub on 2022-09-14 16:14:29.899635. _fe_analyzer_shared:file:///C:/Users/thoma/AppData/Local/Pub/Cache/hosted/pub.dartlang.org/_fe_analyzer_shared-47.0.0/lib/ analyzer:file:///C:/Users/thoma/AppData/Local/Pub/Cache/hosted/pub.dartlang.org/analyzer-4.7.0/lib/ args:file:///C:/Users/thoma/AppData/Local/Pub/Cache/hosted/pub.dartlang.org/args-2.3.1/lib/ @@ -36,6 +36,7 @@ flutter:file:///C:/Users/thoma/Documents/flutter/packages/flutter/lib/ flutter_lints:file:///C:/Users/thoma/AppData/Local/Pub/Cache/hosted/pub.dartlang.org/flutter_lints-1.0.4/lib/ flutter_localizations:file:///C:/Users/thoma/Documents/flutter/packages/flutter_localizations/lib/ flutter_svg:file:///C:/Users/thoma/AppData/Local/Pub/Cache/hosted/pub.dartlang.org/flutter_svg-1.1.5/lib/ +flutter_svg_provider:file:///C:/Users/thoma/AppData/Local/Pub/Cache/hosted/pub.dartlang.org/flutter_svg_provider-1.0.3/lib/ flutter_test:file:///C:/Users/thoma/Documents/flutter/packages/flutter_test/lib/ flutter_web_plugins:file:///C:/Users/thoma/Documents/flutter/packages/flutter_web_plugins/lib/ frontend_server_client:file:///C:/Users/thoma/AppData/Local/Pub/Cache/hosted/pub.dartlang.org/frontend_server_client-2.1.3/lib/ diff --git a/assets/images/cn.svg b/assets/images/cn.svg new file mode 100644 index 0000000..7f27dae --- /dev/null +++ b/assets/images/cn.svg @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/assets/images/de.svg b/assets/images/de.svg new file mode 100644 index 0000000..ccb5ff1 --- /dev/null +++ b/assets/images/de.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/assets/images/en.svg b/assets/images/en.svg new file mode 100644 index 0000000..b261273 --- /dev/null +++ b/assets/images/en.svg @@ -0,0 +1,7 @@ + + + + + + + diff --git a/assets/images/es.svg b/assets/images/es.svg new file mode 100644 index 0000000..f9c9b4b --- /dev/null +++ b/assets/images/es.svg @@ -0,0 +1,547 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/images/fr.svg b/assets/images/fr.svg new file mode 100644 index 0000000..dfa34e8 --- /dev/null +++ b/assets/images/fr.svg @@ -0,0 +1,7 @@ + + + + + + + diff --git a/assets/images/it.svg b/assets/images/it.svg new file mode 100644 index 0000000..b9596d0 --- /dev/null +++ b/assets/images/it.svg @@ -0,0 +1,7 @@ + + + + + + + diff --git a/assets/images/nl.svg b/assets/images/nl.svg new file mode 100644 index 0000000..eb0e360 --- /dev/null +++ b/assets/images/nl.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/assets/images/pl.svg b/assets/images/pl.svg new file mode 100644 index 0000000..8c43577 --- /dev/null +++ b/assets/images/pl.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/lib/Components/LanguageSelection.dart b/lib/Components/LanguageSelection.dart index 3d9bc7f..4632953 100644 --- a/lib/Components/LanguageSelection.dart +++ b/lib/Components/LanguageSelection.dart @@ -1,9 +1,11 @@ import 'package:flutter/material.dart'; +import 'package:flutter_svg_provider/flutter_svg_provider.dart'; import 'package:mymuseum_visitapp/Models/visitContext.dart'; import 'package:mymuseum_visitapp/app_context.dart'; import 'package:mymuseum_visitapp/constants.dart'; import 'package:provider/provider.dart'; + import '../Helpers/DatabaseHelper.dart'; class LanguageSelection extends StatefulWidget { @@ -82,7 +84,9 @@ class _LanguageSelection extends State with TickerProviderSta //border: Border.all(width: 1.5, color: kSecondGrey), image: DecorationImage( fit: BoxFit.contain, - image: AssetImage("assets/images/"+language+".png"), + image: Svg( + "assets/images/"+language.toLowerCase()+".svg", + ), //AssetImage("assets/images/"+language+".png"), ), boxShadow: const [ BoxShadow( diff --git a/lib/constants.dart b/lib/constants.dart index fee5101..78ab0f0 100644 --- a/lib/constants.dart +++ b/lib/constants.dart @@ -10,7 +10,7 @@ const kArticleTitleSize = 25.0; const kArticleDescriptionSize = 12.5; const kArticleContentSize = 16.0; -const List languages = ["FR", "NL", "EN", "DE"]; // hmmmm depends on config.. +const List languages = ["FR", "NL", "EN", "DE", "IT", "ES", "PL", "CN"]; // hmmmm depends on config.. const String defaultLanguage = "EN"; // Text Style diff --git a/lib/translations.dart b/lib/translations.dart index 5468639..51a65b4 100644 --- a/lib/translations.dart +++ b/lib/translations.dart @@ -25,4 +25,28 @@ List translations = [ "noData": "Geen gegevens", "invalidQRCode": "Ongeldige QR-code" }), + Translation(language: "IT", data: { + "visitTitle": "Elenco dei tour", + "visitDownloadWarning": "Per seguire questo tour, devi prima scaricarlo", + "noData": "Nessun dato", + "invalidQRCode": "Codice QR non valido" + }), + Translation(language: "ES", data: { + "visitTitle": "Lista de recorridos", + "visitDownloadWarning": "Para realizar este recorrido, primero debe descargarlo", + "noData": "Sin datos", + "invalidQRCode": "Código QR no válido" + }), + Translation(language: "PL", data: { + "visitTitle": "Lista wycieczek", + "visitDownloadWarning": "Aby wziąć udział w tej wycieczce, musisz ją najpierw pobrać", + "noData": "Brak danych", + "invalidQRCode": "Nieprawidłowy kod QR" + }), + Translation(language: "CN", data: { + "visitTitle": "旅游清单", + "visitDownloadWarning": "要参加此导览,您需要先下载它", + "noData": "没有数据", + "invalidQRCode": "二维码无效" + }), ]; \ No newline at end of file diff --git a/pubspec.lock b/pubspec.lock index e553821..43ea516 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -215,12 +215,19 @@ packages: source: sdk version: "0.0.0" flutter_svg: - dependency: "direct main" + dependency: transitive description: name: flutter_svg url: "https://pub.dartlang.org" source: hosted version: "1.1.5" + flutter_svg_provider: + dependency: "direct main" + description: + name: flutter_svg_provider + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.3" flutter_test: dependency: "direct dev" description: flutter diff --git a/pubspec.yaml b/pubspec.yaml index 5067e83..8a701e0 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -39,7 +39,7 @@ dependencies: sqflite: provider: ^5.0.0 carousel_slider: ^4.0.0 - flutter_svg: ^1.1.3 + flutter_svg_provider: ^1.0.3 photo_view: ^0.13.0 intl: ^0.17.0