File tree Expand file tree Collapse file tree 3 files changed +31
-4
lines changed Expand file tree Collapse file tree 3 files changed +31
-4
lines changed Original file line number Diff line number Diff line change 296
296
"@weight": {
297
297
"description": "The weight of a workout log or body weight entry"
298
298
},
299
+ "chartAllTimeTitle": "{name} all-time",
300
+ "@chartAllTimeTitle": {
301
+ "description": "All-time chart of 'name' (e.g. 'weight', 'body fat' etc.)",
302
+ "type": "text",
303
+ "placeholders": {
304
+ "name": {}
305
+ }
306
+ },
307
+ "chart30DaysTitle": "{name} last 30 days",
308
+ "@chart30DaysTitle": {
309
+ "description": "last 30 days chart of 'name' (e.g. 'weight', 'body fat' etc.)",
310
+ "type": "text",
311
+ "placeholders": {
312
+ "name": {}
313
+ }
314
+ },
315
+ "chartDuringPlanTitle": "{chartName} during nutritional plan {planName}",
316
+ "@chartDuringPlanTitle": {
317
+ "description": "chart of 'chartName' (e.g. 'weight', 'body fat' etc.) logged during plan",
318
+ "type": "text",
319
+ "placeholders": {
320
+ "chartName": {},
321
+ "planName": {}
322
+ }
323
+ },
299
324
"measurement": "Measurement",
300
325
"@measurement": {},
301
326
"measurements": "Measurements",
Original file line number Diff line number Diff line change 1
1
import 'package:flutter/material.dart' ;
2
+ import 'package:flutter_gen/gen_l10n/app_localizations.dart' ;
2
3
import 'package:wger/models/nutrition/nutritional_plan.dart' ;
3
4
import 'package:wger/widgets/measurements/charts.dart' ;
4
5
@@ -36,15 +37,15 @@ List<Widget> getOverviewWidgetsSeries(
36
37
final monthAgo = DateTime .now ().subtract (const Duration (days: 30 ));
37
38
return [
38
39
...getOverviewWidgets (
39
- '$ name all-time' ,
40
+ AppLocalizations . of (context). chartAllTimeTitle ( name) ,
40
41
entriesAll,
41
42
entries7dAvg,
42
43
unit,
43
44
context,
44
45
),
45
46
if (plan != null )
46
47
...getOverviewWidgets (
47
- '$ name during nutritional plan ${ plan .description }' ,
48
+ AppLocalizations . of (context). chartDuringPlanTitle ( name, plan.description) ,
48
49
entriesAll.where ((e) => e.date.isAfter (plan.creationDate)).toList (),
49
50
entries7dAvg.where ((e) => e.date.isAfter (plan.creationDate)).toList (),
50
51
unit,
@@ -60,7 +61,7 @@ List<Widget> getOverviewWidgetsSeries(
60
61
.date
61
62
.isBefore (entriesAll.last.date.subtract (const Duration (days: 30 )))))
62
63
...getOverviewWidgets (
63
- '$ name last 30 days' ,
64
+ AppLocalizations . of (context). chart30DaysTitle ( name) ,
64
65
entriesAll.where ((e) => e.date.isAfter (monthAgo)).toList (),
65
66
entries7dAvg.where ((e) => e.date.isAfter (monthAgo)).toList (),
66
67
unit,
Original file line number Diff line number Diff line change @@ -31,6 +31,7 @@ import 'package:wger/widgets/weight/forms.dart';
31
31
32
32
class WeightOverview extends StatelessWidget {
33
33
const WeightOverview ();
34
+
34
35
@override
35
36
Widget build (BuildContext context) {
36
37
final profile = context.read <UserProvider >().profile;
@@ -46,7 +47,7 @@ class WeightOverview extends StatelessWidget {
46
47
return Column (
47
48
children: [
48
49
...getOverviewWidgetsSeries (
49
- 'Weight' ,
50
+ AppLocalizations . of (context).weight ,
50
51
entriesAll,
51
52
entries7dAvg,
52
53
plan,
You can’t perform that action at this time.
0 commit comments