diff --git a/assets/language/language.json b/assets/language/language.json new file mode 100644 index 0000000..562a557 --- /dev/null +++ b/assets/language/language.json @@ -0,0 +1,136 @@ +{ + "de": + { + "pageAmbiente": + { + "question1": "Frage1", + "question2": "Frage2", + "textfield": "Dein Feedback" + }, + "pageAnmerkungen": + { + "question1": "Frage1", + "question2": "Frage2", + "textfield": "Dein Feedback" + }, + "pageEssen": + { + "question1": "Geschmack", + "question2": "Qualität", + "textfield": "Dein Feedback" + }, + "pageHome": + { + + }, + "pageService": + { + "question1": "Frage1", + "question2": "Frage2", + "textfield": "Dein Feedback" + }, + "pageSpecial": + { + "question1": "Frage1", + "question2": "Frage2", + "textfield": "Dein Feedback" + }, + "navBar": + { + "symbol1": "Essen", + "symbol2": "Ambiente", + "symbol3": "Service", + "symbol4": "Anmerkungen", + "symbol5": "Spezielle Ernährung" + }, + "floating": + { + "info": "* Pflichtfeld", + "return": "Absenden" + } + }, + "en": + { + "pageAmbiente": { + "question1": "Question1", + "question2": "Question2", + "textfield": "Your Feedback" + }, + "pageAnmerkungen": { + "question1": "Question1", + "question2": "Question2", + "textfield": "Your Feedback" + }, + "pageEssen": { + "question1": "Taste", + "question2": "Quality", + "textfield": "Your Feedback" + }, + "pageHome": { + + }, + "pageService": { + "question1": "Question1", + "question2": "Question2", + "textfield": "Your Feedback" + }, + "pageSpecial": { + "question1": "Question1", + "question2": "Question2", + "textfield": "Your Feedback" + }, + "navBar": { + "symbol1": "Food", + "symbol2": "Ambience", + "symbol3": "Service", + "symbol4": "Remarks", + "symbol5": "Special Diet" + }, + "floating": { + "info": "* Required field", + "return": "Submit" + } + }, + "fr": + { + "pageAmbiente": { + "question1": "Question1", + "question2": "Question2", + "textfield": "Votre avis" + }, + "pageAnmerkungen": { + "question1": "Question1", + "question2": "Question2", + "textfield": "Votre avis" + }, + "pageEssen": { + "question1": "Goût", + "question2": "Qualité", + "textfield": "Votre avis" + }, + "pageHome": { + + }, + "pageService": { + "question1": "Question1", + "question2": "Question2", + "textfield": "Votre avis" + }, + "pageSpecial": { + "question1": "Question1", + "question2": "Question2", + "textfield": "Votre avis" + }, + "navBar": { + "symbol1": "Nourriture", + "symbol2": "Ambiance", + "symbol3": "Service", + "symbol4": "Remarques", + "symbol5": "Régime spécial" + }, + "floating": { + "info": "* Champ obligatoire", + "return": "Envoyer" + } + } +} \ No newline at end of file diff --git a/lib/main.dart b/lib/main.dart index ab2e6eb..dd2441c 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -1,3 +1,5 @@ +import 'dart:ffi'; + import 'package:flutter/material.dart'; import 'package:google_nav_bar/google_nav_bar.dart'; import 'package:mensaapp/providers/ambienteProvider.dart'; @@ -7,6 +9,8 @@ import 'package:mensaapp/providers/pageProvider.dart'; import 'package:mensaapp/providers/serviceProvider.dart'; import 'package:mensaapp/providers/spezielleErnaehrungProvider.dart'; import 'package:provider/provider.dart'; +import 'dart:convert'; +import 'package:flutter/services.dart' show rootBundle; void main() { runApp(const MyApp()); @@ -15,9 +19,25 @@ void main() { class MyApp extends StatelessWidget { const MyApp({super.key}); + Future loadLanguage() async + { + try + { + String language = await rootBundle.loadString("assets/language/language.json"); + Map languageData = json.decode(language); + print(languageData); + }catch(e) + { + print("Hello World"); + } + } + + + // This widget is the root of your application. @override Widget build(BuildContext context) { + loadLanguage(); return MultiProvider( providers: [ ChangeNotifierProvider( diff --git a/pubspec.yaml b/pubspec.yaml index 8c4f18c..139247d 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -57,6 +57,7 @@ flutter: assets: - assets/flags/ - assets/backgrounds/ + - assets/language/ # The following line ensures that the Material Icons font is # included with your application, so that you can use the icons in # the material Icons class.