Skip to content

Commit

Permalink
Merge pull request #147 from Nesteo/localization
Browse files Browse the repository at this point in the history
localization for static strings on boxinfo screen. #126
  • Loading branch information
SimonOyen authored Nov 13, 2019
2 parents d4ab0f5 + c220dbb commit bca61c3
Show file tree
Hide file tree
Showing 5 changed files with 63 additions and 16 deletions.
11 changes: 11 additions & 0 deletions lib/generated/locale_base.dart
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,17 @@ class LocaleboxInfo {
String get boxConditionReplace => _data["boxConditionReplace"];
String get boxConditionRepair => _data["boxConditionRepair"];
String get boxConditionFixed => _data["boxConditionFixed"];
String get newInspection => _data["newInspection"];
String get showInspections => _data["showInspections"];
String get hangedUpBy => _data["hangedUpBy"];
String get hangupDate => _data["hangupDate"];
String get inspected => _data["inspected"];
String get times => _data["times"];
String get material => _data["material"];
String get lastInspection => _data["lastInspection"];
String get information => _data["information"];
String get boxId => _data["boxId"];
String get daysAgo => _data["daysAgo"];
}
class LocaleboxList {
final Map<String, String> _data;
Expand Down
29 changes: 16 additions & 13 deletions lib/screens/boxinfo_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class BoxInfoScreen extends NesteoFullScreen {
Widget build(BuildContext context) {
PageControlBloc pageControlBloc = BlocProvider.of<PageControlBloc>(context);
BoxDataBloc boxDataBloc = BlocProvider.of<BoxDataBloc>(context);

final loc = Localizations.of<LocaleBase>(context, LocaleBase);
return Container(
color: Colors.lightGreen,
child: BlocBuilder<BoxDataBloc, BoxDataState>(
Expand Down Expand Up @@ -51,14 +51,16 @@ class BoxInfoScreen extends NesteoFullScreen {
children: [
FlatButton.icon(
icon: Icon(Icons.add),
label: Text("New Inspection", style: TextStyle(fontSize: 16)),
label: Text(loc.boxInfo.newInspection,
style: TextStyle(fontSize: 16)),
onPressed: () {
pageControlBloc.add(GoToNewInspectionEvent());
},
),
FlatButton.icon(
icon: Icon(Icons.list),
label: Text("Show Inspections"),
label: Text(loc.boxInfo.showInspections,
style: TextStyle(fontSize: 16)),
onPressed: () {
pageControlBloc.add(GoToInspectionListEvent());
},
Expand All @@ -70,7 +72,7 @@ class BoxInfoScreen extends NesteoFullScreen {
children: [
TableCell(
child: ListTile(
title: Text("Hanged-up by:"),
title: Text(loc.boxInfo.hangedUpBy),
leading: Icon(FontAwesomeIcons.tools),
),
),
Expand All @@ -87,7 +89,7 @@ class BoxInfoScreen extends NesteoFullScreen {
children: [
TableCell(
child: ListTile(
title: Text("Hangup-Date:"),
title: Text(loc.boxInfo.hangupDate),
leading: Icon(FontAwesomeIcons.calendarAlt),
),
),
Expand All @@ -104,12 +106,13 @@ class BoxInfoScreen extends NesteoFullScreen {
children: [
TableCell(
child: ListTile(
title: Text("Inspected:"),
title: Text(loc.boxInfo.inspected),
leading: Icon(FontAwesomeIcons.search)),
),
TableCell(
child: ListTile(
title: Text("${nestingBox.inspectionsCount} times"),
title: Text(
"${nestingBox.inspectionsCount} ${loc.boxInfo.times}"),
),
),
],
Expand All @@ -119,7 +122,7 @@ class BoxInfoScreen extends NesteoFullScreen {
children: [
TableCell(
child: ListTile(
title: Text("Material:"),
title: Text(loc.boxInfo.material),
leading: Icon(FontAwesomeIcons.box)),
),
TableCell(
Expand Down Expand Up @@ -177,7 +180,7 @@ class BoxInfoScreen extends NesteoFullScreen {
children: [
TableCell(
child: ListTile(
title: Text("Comment:"),
title: Text(loc.boxInfo.comment),
leading: Icon(FontAwesomeIcons.pen),
),
),
Expand Down Expand Up @@ -212,9 +215,9 @@ class BoxInfoScreen extends NesteoFullScreen {
),
Card(
child: ListTile(
title: Text("Box ID: ${nestingBox.id}"),
title: Text("${loc.boxInfo.boxId} ${nestingBox.id}"),
subtitle: Text(
"Last Inspection: $daysSinceLastInspection days ago"),
"${loc.boxInfo.lastInspection}: $daysSinceLastInspection ${loc.boxInfo.daysAgo}"),
trailing: IconButton(
icon: Icon(Icons.gps_fixed),
onPressed: () {
Expand All @@ -236,8 +239,8 @@ class BoxInfoScreen extends NesteoFullScreen {
child: Column(
children: [
ListTile(
title:
Text("Information", style: TextStyle(fontSize: 18)),
title: Text(loc.boxInfo.information,
style: TextStyle(fontSize: 18)),
),
Container(
child: DefaultTextStyle(
Expand Down
13 changes: 12 additions & 1 deletion locales/DE_DE.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,18 @@
"addPhoto": "Foto hinzufügen",
"boxConditionReplace": "Ersetzen",
"boxConditionRepair": "Reparieren",
"boxConditionFixed": "Heile"
"boxConditionFixed": "Heile",
"newInspection": "Neue Inspektion",
"showInspections": "Zeige Inspektionen",
"hangedUpBy": "Aufgehängt von:",
"hangupDate": "Aufhängdatum:",
"inspected": "Inspiziert:",
"times": "mal",
"material": "Marerial:",
"lastInspection": "Letzte Inspektion",
"information": "Information",
"boxId": "Box ID:",
"daysAgo": "Tage her"
},
"boxList": {
"sortByID": "Sortieren nach ID",
Expand Down
13 changes: 12 additions & 1 deletion locales/EN_US.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,18 @@
"addPhoto": "Add Photo",
"boxConditionReplace": "Needs Replacement",
"boxConditionRepair": "Needs Repair",
"boxConditionFixed": "Fixed"
"boxConditionFixed": "Fixed",
"newInspection": "New Inspection",
"showInspections": "Show Inspections",
"hangedUpBy": "Hanged-up by:",
"hangupDate": "Hangup-Date:",
"inspected": "Inspected:",
"times": "times",
"material": "Material:",
"lastInspection": "Last Inspection",
"information": "Information",
"boxId": "Box ID:",
"daysAgo": "days ago"
},
"boxList": {
"sortByID": "sort by ID",
Expand Down
13 changes: 12 additions & 1 deletion locales/desc.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,18 @@
"addPhoto": "add photo",
"boxConditionReplace": "replace box condition",
"boxConditionRepair": "repair",
"boxConditionFixed": "fixed"
"boxConditionFixed": "fixed",
"newInspection": "new Inspection",
"showInspections": "show inspections",
"hangedUpBy": "hanged up by",
"hangupDate": "hangup date",
"inspected": "inspected",
"times": "times box was inspected",
"material": "material",
"lastInspection": "last inspection",
"information": "information",
"boxId": "Box id",
"daysAgo": "days ago"
},
"boxList": {
"sortByID": "sort boxlist by ID",
Expand Down

0 comments on commit bca61c3

Please sign in to comment.