Skip to content

Commit

Permalink
feat: add l10n setup and support to en, es and pt and use
Browse files Browse the repository at this point in the history
  • Loading branch information
felipecastrosales committed Feb 26, 2023
1 parent 09a141f commit 1979fd7
Show file tree
Hide file tree
Showing 43 changed files with 1,454 additions and 146 deletions.
7 changes: 7 additions & 0 deletions l10n.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
arb-dir: lib/app/core/l10n/templates
output-dir: lib/app/core/l10n/localizations
template-arb-file: app_pt.arb
output-localization-file: app_localizations.dart
output-class: AppLocalizations
### Uncomment when generating.
# synthetic-package: false
6 changes: 4 additions & 2 deletions lib/app/app_widget.dart
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import 'package:flutter/material.dart';

import 'package:site/app/core/shared/shared.dart';
import 'package:site/app/core/app_theme.dart';
import 'package:site/app/core/l10n/l10n.dart';
import 'package:site/app/features/home/home_page.dart';

class AppWidget extends StatelessWidget {
Expand All @@ -10,9 +10,11 @@ class AppWidget extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
title: AppTexts.projectTitle,
onGenerateTitle: (context) => AppTexts.get(context).projectTitle,
debugShowCheckedModeBanner: false,
theme: AppTheme.theme,
localizationsDelegates: AppLocalizations.localizationsDelegates,
supportedLocales: AppLocalizations.supportedLocales,
home: HomePage(),
);
}
Expand Down
1 change: 1 addition & 0 deletions lib/app/core/l10n/l10n.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export 'localizations/localizations.dart';
Loading

0 comments on commit 1979fd7

Please sign in to comment.