From 270899da1f700d93c3c6ff0dc054eebbef58abce Mon Sep 17 00:00:00 2001 From: Jagandeep Brar Date: Sun, 25 Apr 2021 16:10:46 -0500 Subject: [PATCH] fix(localization): Localize remaining dashboard strings --- assets/localization/en.json | 1 + .../widgets/appbar_switch_view_action.dart | 12 +++++++----- .../routes/dashboard/widgets/navigation_bar.dart | 14 ++++++++------ localization/dashboard/en.json | 1 + 4 files changed, 17 insertions(+), 11 deletions(-) diff --git a/assets/localization/en.json b/assets/localization/en.json index 5f08c18b..1fc70228 100644 --- a/assets/localization/en.json +++ b/assets/localization/en.json @@ -141,6 +141,7 @@ "dashboard.FutureDays": "Future Days", "dashboard.FutureDaysDescription": "Set the number of days in the future to fetch calendar entries for.", "dashboard.MinimumOfOneDay": "Minimum of 1 Day", + "dashboard.Modules": "Modules", "dashboard.Monday": "Monday", "dashboard.NoNewContent": "No New Content", "dashboard.OneMonth": "One Month", diff --git a/lib/modules/dashboard/routes/dashboard/widgets/appbar_switch_view_action.dart b/lib/modules/dashboard/routes/dashboard/widgets/appbar_switch_view_action.dart index ec4f6a6d..4524253a 100644 --- a/lib/modules/dashboard/routes/dashboard/widgets/appbar_switch_view_action.dart +++ b/lib/modules/dashboard/routes/dashboard/widgets/appbar_switch_view_action.dart @@ -10,11 +10,13 @@ class DashboardAppBarSwitchViewAction extends StatelessWidget { builder: (context, view, _) => LunaIconButton( icon: view.icon, onPressed: () { - view == CalendarStartingType.CALENDAR - ? context.read().calendarStartingType = - CalendarStartingType.SCHEDULE - : context.read().calendarStartingType = - CalendarStartingType.CALENDAR; + if (view == CalendarStartingType.CALENDAR) { + context.read().calendarStartingType = + CalendarStartingType.SCHEDULE; + } else { + context.read().calendarStartingType = + CalendarStartingType.CALENDAR; + } }, ), ); diff --git a/lib/modules/dashboard/routes/dashboard/widgets/navigation_bar.dart b/lib/modules/dashboard/routes/dashboard/widgets/navigation_bar.dart index 3268d445..f1df4907 100644 --- a/lib/modules/dashboard/routes/dashboard/widgets/navigation_bar.dart +++ b/lib/modules/dashboard/routes/dashboard/widgets/navigation_bar.dart @@ -2,14 +2,16 @@ import 'package:flutter/material.dart'; import 'package:lunasea/core.dart'; class DashboardNavigationBar extends StatelessWidget { - static List scrollControllers = - List.generate(icons.length, (_) => ScrollController()); + static List scrollControllers = List.generate( + icons.length, + (_) => ScrollController(), + ); final PageController pageController; - static const List titles = [ - 'Modules', - 'Calendar', - ]; + static List get titles => [ + 'dashboard.Modules'.tr(), + 'dashboard.Calendar'.tr(), + ]; static const List icons = [ LunaIcons.modules, diff --git a/localization/dashboard/en.json b/localization/dashboard/en.json index 2d05b9e5..d04e69a3 100644 --- a/localization/dashboard/en.json +++ b/localization/dashboard/en.json @@ -4,6 +4,7 @@ "dashboard.FutureDays": "Future Days", "dashboard.FutureDaysDescription": "Set the number of days in the future to fetch calendar entries for.", "dashboard.MinimumOfOneDay": "Minimum of 1 Day", + "dashboard.Modules": "Modules", "dashboard.Monday": "Monday", "dashboard.NoNewContent": "No New Content", "dashboard.OneMonth": "One Month",