Skip to content

Commit

Permalink
feat: Add flutter localizations
Browse files Browse the repository at this point in the history
  • Loading branch information
shihabkandil committed Aug 27, 2024
1 parent 94a72f0 commit 5e65f7e
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 0 deletions.
6 changes: 6 additions & 0 deletions l10n.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
arb-dir: lib/l10n
template-arb-file: app_en.arb
synthetic-package: false
output-dir: lib/l10n/generated
output-localization-file: app_localizations.dart
nullable-getter: false
6 changes: 6 additions & 0 deletions lib/l10n/app_en.arb
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"inspiredByTheFuture": "INSPIRED BY THE FUTURE:",
"theVisionUiDashboard": "THE VISION UI DASHBOARD",
"designedBySimmmple": "Designed by Simmmple & Creative Tim",
"developedByShihabKandil": "@2024, Developed by Shihab Kandil"
}
8 changes: 8 additions & 0 deletions lib/main.dart
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import 'package:flutter/material.dart';
import 'package:flutter_localizations/flutter_localizations.dart';
import 'common/constants/theme/app_theme_data.dart';
import 'common/core/injector/locator.dart';
import 'common/core/router/app_router.dart';
import 'l10n/generated/app_localizations.dart';

void commonMain() {
WidgetsFlutterBinding.ensureInitialized();
Expand All @@ -23,6 +25,12 @@ class App extends StatelessWidget {
return MaterialApp.router(
theme: AppThemeData.lightTheme,
routerConfig: appRouter.config(),
supportedLocales: const [Locale('en')],
localizationsDelegates: const [
AppLocalizations.delegate,
GlobalCupertinoLocalizations.delegate,
GlobalWidgetsLocalizations.delegate,
],
);
}
}
5 changes: 5 additions & 0 deletions pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@ dependencies:
auto_route: ^9.2.2
envied: ^0.5.4+1
flutter_gen: ^5.6.0
flutter_localizations:
sdk: flutter
intl: ^0.19.0


dev_dependencies:
flutter_test:
Expand All @@ -59,6 +63,7 @@ dev_dependencies:
flutter_gen_runner: ^5.6.0

flutter:
generate: true

uses-material-design: true

Expand Down

0 comments on commit 5e65f7e

Please sign in to comment.