Skip to content

Commit

Permalink
feat: localization (#1068)
Browse files Browse the repository at this point in the history
* feat: setup example

* feat: translate drawer and login view

* feat: actually partially translate drawer

* feat: translate challenge view

* feat: translate hint panels

* fix: add context on where to find text

* feat: add translation for news feed

* feat: add translation news tutorial view

* feat: add translation bookmark and search view news

* feat: add translation news navigation

* feat: add podcast translations

* feat: add translations settings

* feat: add delete account translations

* feat: add coderadio translations

* feat: add profile translations

* feat: add quincy email translations

* feat: add final translations - still missed some of them probably

* feat: add Spanish and Portuguese

* feat: use plural placeholders

* feat: i18n extension

* fix: analyze warnings

* fix: truncate AppLocalisation to context.t

* fix: change context to description

* feat: add more untranslated messages

* feat: locale service

* feat: language selector

* fix: persist locale code

* fix: persist locale name

* fix: add translations for language and use defined array

* fix: dropdown arrow

* feat: language selector behind dev wall

* chore: revert jiffy version

---------

Co-authored-by: Niraj Nandish <[email protected]>
  • Loading branch information
Sembauke and Nirajn2311 authored Aug 3, 2023
1 parent dc50cb8 commit 1f2bce5
Show file tree
Hide file tree
Showing 44 changed files with 2,430 additions and 467 deletions.
4 changes: 4 additions & 0 deletions mobile-app/l10n.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
arb-dir: lib/l10n
template-arb-file: app_en.arb
output-localization-file: app_localizations.dart
nullable-getter: false
4 changes: 3 additions & 1 deletion mobile-app/lib/app/app.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import 'package:freecodecamp/service/firebase/analytics_service.dart';
import 'package:freecodecamp/service/learn/learn_file_service.dart';
import 'package:freecodecamp/service/learn/learn_offline_service.dart';
import 'package:freecodecamp/service/learn/learn_service.dart';
import 'package:freecodecamp/service/locale_service.dart';
import 'package:freecodecamp/service/navigation/quick_actions_service.dart';
import 'package:freecodecamp/service/news/bookmark_service.dart';
import 'package:freecodecamp/service/podcast/download_service.dart';
Expand Down Expand Up @@ -68,7 +69,8 @@ import 'package:stacked_services/stacked_services.dart';
LazySingleton(classType: LearnOfflineService),
LazySingleton(classType: QuickActionsService),
LazySingleton(classType: AnalyticsService),
LazySingleton(classType: BookmarksDatabaseService)
LazySingleton(classType: BookmarksDatabaseService),
LazySingleton(classType: LocaleService)
],
logger: StackedLogger(),
)
Expand Down
2 changes: 2 additions & 0 deletions mobile-app/lib/app/app.locator.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions mobile-app/lib/extensions/i18n_extension.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import 'package:flutter/widgets.dart';
import 'package:flutter_gen/gen_l10n/app_localizations.dart';

extension I18nContext on BuildContext {
AppLocalizations get t => AppLocalizations.of(this);
}
Loading

0 comments on commit 1f2bce5

Please sign in to comment.