language
englisch german and ... french.... (we had to) texts written into assets directory has json format for fast access
This commit is contained in:
@@ -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"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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<void> loadLanguage() async
|
||||
{
|
||||
try
|
||||
{
|
||||
String language = await rootBundle.loadString("assets/language/language.json");
|
||||
Map<String, dynamic> 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(
|
||||
|
||||
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user