Skip to content

Commit

Permalink
Merge pull request #143 from Nesteo/localization
Browse files Browse the repository at this point in the history
Added localization to boxlist screen. #resolves 128
  • Loading branch information
SimonOyen authored Nov 13, 2019
2 parents bd2757e + aba99cc commit 061734d
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 20 deletions.
2 changes: 2 additions & 0 deletions lib/generated/locale_base.dart
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@ class LocaleboxList {

String get sortByID => _data["sortByID"];
String get sortByLastInspection => _data["sortByLastInspection"];
String get lastInspection => _data["lastInspection"];
String get daysAgo => _data["daysAgo"];
}
class LocaleboxNew {
final Map<String, String> _data;
Expand Down
6 changes: 4 additions & 2 deletions lib/screens/boxlist_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ class BoxListScreen extends NesteoFramedScreen {

@override
Widget build(BuildContext context) {
final loc = Localizations.of<LocaleBase>(context, LocaleBase);
BoxDataBloc boxDataBloc = BlocProvider.of<BoxDataBloc>(context);
MapControlBloc mapControlBloc = BlocProvider.of<MapControlBloc>(context);

Expand Down Expand Up @@ -108,8 +109,9 @@ class BoxListScreen extends NesteoFramedScreen {
BlocProvider.of<PageControlBloc>(context)
.add(GoToNewInspectionEvent());
},
subtitle: Text(
"Last Inspection: $daysSinceLastInspection days ago"),
subtitle: Text("${loc.boxList.lastInspection}"
" $daysSinceLastInspection "
"${loc.boxList.daysAgo}"),
onTap: () {
// Set the box Id to this selection and add get box for the info page
boxDataBloc.boxId =
Expand Down
1 change: 0 additions & 1 deletion lib/screens/newbox_screen.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import 'package:flutter/material.dart';
import 'package:flutter_typeahead/flutter_typeahead.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
import 'package:intl/intl.dart';
Expand Down
4 changes: 3 additions & 1 deletion locales/DE_DE.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@
},
"boxList": {
"sortByID": "Sortieren nach ID",
"sortByLastInspection": "Sortiere nach letzter Inspektion"
"sortByLastInspection": "Sortiere nach letzter Inspektion",
"lastInspection": "Letzte Inspektion",
"daysAgo": "Tage her"
},
"boxNew": {
"id": "ID",
Expand Down
4 changes: 3 additions & 1 deletion locales/EN_US.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@
},
"boxList": {
"sortByID": "sort by ID",
"sortByLastInspection": "sort by last inspection"
"sortByLastInspection": "sort by last inspection",
"lastInspection": "Last inspection",
"daysAgo": "days ago"
},
"boxNew": {
"id": "ID",
Expand Down
4 changes: 3 additions & 1 deletion locales/desc.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@
},
"boxList": {
"sortByID": "sort boxlist by ID",
"sortByLastInspection": "sort boxlist by last inspection"
"sortByLastInspection": "sort boxlist by last inspection",
"lastInspection": "last inspection",
"daysAgo": "days ago"
},
"boxNew": {
"id": "id",
Expand Down
14 changes: 0 additions & 14 deletions pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -223,13 +223,6 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.1"
flutter_keyboard_visibility:
dependency: transitive
description:
name: flutter_keyboard_visibility
url: "https://pub.dartlang.org"
source: hosted
version: "0.7.0"
flutter_launcher_icons:
dependency: "direct dev"
description:
Expand All @@ -254,13 +247,6 @@ packages:
description: flutter
source: sdk
version: "0.0.0"
flutter_typeahead:
dependency: "direct main"
description:
name: flutter_typeahead
url: "https://pub.dartlang.org"
source: hosted
version: "1.7.0"
font_awesome_flutter:
dependency: "direct main"
description:
Expand Down

0 comments on commit 061734d

Please sign in to comment.