hello multilang !
This commit is contained in:
parent
1c3aa6997b
commit
b89de85e90
|
@ -0,0 +1,3 @@
|
||||||
|
{
|
||||||
|
"msg": "hello {} there !"
|
||||||
|
}
|
|
@ -0,0 +1,3 @@
|
||||||
|
{
|
||||||
|
"msg": "Salut ici !"
|
||||||
|
}
|
|
@ -45,11 +45,14 @@ import 'package:shared_preferences/shared_preferences.dart';
|
||||||
import 'package:sentry_flutter/sentry_flutter.dart';
|
import 'package:sentry_flutter/sentry_flutter.dart';
|
||||||
import 'package:window_size/window_size.dart';
|
import 'package:window_size/window_size.dart';
|
||||||
import 'package:graphql_flutter/graphql_flutter.dart';
|
import 'package:graphql_flutter/graphql_flutter.dart';
|
||||||
|
import 'package:flutter_localizations/flutter_localizations.dart';
|
||||||
|
import 'package:easy_localization/easy_localization.dart';
|
||||||
|
|
||||||
const bool enableSentry = true;
|
const bool enableSentry = true;
|
||||||
|
|
||||||
Future<void> main() async {
|
Future<void> main() async {
|
||||||
WidgetsFlutterBinding.ensureInitialized();
|
WidgetsFlutterBinding.ensureInitialized();
|
||||||
|
await EasyLocalization.ensureInitialized();
|
||||||
if (!kIsWeb && (Platform.isWindows || Platform.isLinux || Platform.isMacOS)) {
|
if (!kIsWeb && (Platform.isWindows || Platform.isLinux || Platform.isMacOS)) {
|
||||||
setWindowTitle('Ğecko');
|
setWindowTitle('Ğecko');
|
||||||
setWindowMinSize(const Size(400, 700));
|
setWindowMinSize(const Size(400, 700));
|
||||||
|
@ -97,10 +100,21 @@ Future<void> main() async {
|
||||||
// // ]);
|
// // ]);
|
||||||
// Catcher(rootWidget: Gecko(endPointGVA, _store), debugConfig: debugOptions);
|
// Catcher(rootWidget: Gecko(endPointGVA, _store), debugConfig: debugOptions);
|
||||||
|
|
||||||
await SentryFlutter.init((options) {
|
await SentryFlutter.init(
|
||||||
options.dsn =
|
(options) {
|
||||||
'https://c09587b46eaa42e8b9fda28d838ed180@o496840.ingest.sentry.io/5572110';
|
options.dsn =
|
||||||
}, appRunner: () => runApp(Gecko(indexerEndpoint)));
|
'https://c09587b46eaa42e8b9fda28d838ed180@o496840.ingest.sentry.io/5572110';
|
||||||
|
},
|
||||||
|
appRunner: () => runApp(
|
||||||
|
EasyLocalization(
|
||||||
|
supportedLocales: const [Locale('en'), Locale('fr')],
|
||||||
|
path:
|
||||||
|
'assets/translations', // <-- change the path of the translation files
|
||||||
|
fallbackLocale: const Locale('fr'),
|
||||||
|
child: Gecko(indexerEndpoint),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
|
||||||
// runZoned<Future<void>>(
|
// runZoned<Future<void>>(
|
||||||
// () async {
|
// () async {
|
||||||
|
@ -117,7 +131,15 @@ Future<void> main() async {
|
||||||
} else {
|
} else {
|
||||||
print('Debug mode enabled: No sentry alerte');
|
print('Debug mode enabled: No sentry alerte');
|
||||||
|
|
||||||
runApp(Gecko(indexerEndpoint));
|
runApp(
|
||||||
|
EasyLocalization(
|
||||||
|
supportedLocales: const [Locale('en'), Locale('fr')],
|
||||||
|
path:
|
||||||
|
'assets/translations', // <-- change the path of the translation files
|
||||||
|
fallbackLocale: const Locale('fr'),
|
||||||
|
child: Gecko(indexerEndpoint),
|
||||||
|
),
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -145,6 +167,9 @@ class Gecko extends StatelessWidget {
|
||||||
ChangeNotifierProvider(create: (_) => DuniterIndexer())
|
ChangeNotifierProvider(create: (_) => DuniterIndexer())
|
||||||
],
|
],
|
||||||
child: MaterialApp(
|
child: MaterialApp(
|
||||||
|
localizationsDelegates: context.localizationDelegates,
|
||||||
|
supportedLocales: context.supportedLocales,
|
||||||
|
locale: context.locale,
|
||||||
builder: (context, widget) => ResponsiveWrapper.builder(
|
builder: (context, widget) => ResponsiveWrapper.builder(
|
||||||
BouncingScrollWrapper.builder(context, widget!),
|
BouncingScrollWrapper.builder(context, widget!),
|
||||||
maxWidth: 1200,
|
maxWidth: 1200,
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
import 'package:bubble/bubble.dart';
|
import 'package:bubble/bubble.dart';
|
||||||
import 'package:connectivity_plus/connectivity_plus.dart';
|
import 'package:connectivity_plus/connectivity_plus.dart';
|
||||||
|
import 'package:easy_localization/easy_localization.dart';
|
||||||
import 'package:gecko/globals.dart';
|
import 'package:gecko/globals.dart';
|
||||||
import 'package:gecko/models/stateful_wrapper.dart';
|
import 'package:gecko/models/stateful_wrapper.dart';
|
||||||
import 'package:gecko/providers/chest_provider.dart';
|
import 'package:gecko/providers/chest_provider.dart';
|
||||||
|
@ -301,6 +302,7 @@ Widget geckHome(context) {
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
const SizedBox(height: 12),
|
const SizedBox(height: 12),
|
||||||
|
const Text('msg').tr(args: [currencyName]),
|
||||||
Text(
|
Text(
|
||||||
"Rechercher un\nportefeuille",
|
"Rechercher un\nportefeuille",
|
||||||
textAlign: TextAlign.center,
|
textAlign: TextAlign.center,
|
||||||
|
|
|
@ -351,7 +351,7 @@ class WalletOptions extends StatelessWidget {
|
||||||
height: 45,
|
height: 45,
|
||||||
),
|
),
|
||||||
const SizedBox(width: 22),
|
const SizedBox(width: 22),
|
||||||
const Text('Activité',
|
const Text("Voir l'activité",
|
||||||
style: TextStyle(fontSize: 20, fontWeight: FontWeight.w500)),
|
style: TextStyle(fontSize: 20, fontWeight: FontWeight.w500)),
|
||||||
]),
|
]),
|
||||||
),
|
),
|
||||||
|
|
19
pubspec.lock
19
pubspec.lock
|
@ -316,6 +316,20 @@ packages:
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.1.6"
|
version: "0.1.6"
|
||||||
|
easy_localization:
|
||||||
|
dependency: "direct main"
|
||||||
|
description:
|
||||||
|
name: easy_localization
|
||||||
|
url: "https://pub.dartlang.org"
|
||||||
|
source: hosted
|
||||||
|
version: "3.0.1"
|
||||||
|
easy_logger:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: easy_logger
|
||||||
|
url: "https://pub.dartlang.org"
|
||||||
|
source: hosted
|
||||||
|
version: "0.0.2"
|
||||||
fake_async:
|
fake_async:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
@ -389,6 +403,11 @@ packages:
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.0.4"
|
version: "1.0.4"
|
||||||
|
flutter_localizations:
|
||||||
|
dependency: transitive
|
||||||
|
description: flutter
|
||||||
|
source: sdk
|
||||||
|
version: "0.0.0"
|
||||||
flutter_logs:
|
flutter_logs:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
|
|
|
@ -72,6 +72,7 @@ dependencies:
|
||||||
web_socket_channel: ^2.2.0
|
web_socket_channel: ^2.2.0
|
||||||
connectivity_plus: ^2.3.3
|
connectivity_plus: ^2.3.3
|
||||||
image_cropper: ^2.0.3
|
image_cropper: ^2.0.3
|
||||||
|
easy_localization: ^3.0.1
|
||||||
|
|
||||||
dev_dependencies:
|
dev_dependencies:
|
||||||
# flutter_launcher_icons: ^0.9.2
|
# flutter_launcher_icons: ^0.9.2
|
||||||
|
@ -99,6 +100,7 @@ flutter:
|
||||||
assets:
|
assets:
|
||||||
- config/
|
- config/
|
||||||
- assets/
|
- assets/
|
||||||
|
- assets/translations/
|
||||||
- assets/home/
|
- assets/home/
|
||||||
- assets/avatars/
|
- assets/avatars/
|
||||||
- assets/chests/
|
- assets/chests/
|
||||||
|
|
Loading…
Reference in New Issue