-
-
Notifications
You must be signed in to change notification settings - Fork 405
Expand file tree
/
Copy pathi18n.dart
More file actions
139 lines (96 loc) · 2.73 KB
/
Copy pathi18n.dart
File metadata and controls
139 lines (96 loc) · 2.73 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
/// This code is autogenerated in the backend repo in extract-i18n.py do not edit!
library;
/// Translate dynamic strings that are returned from the server
/// These strings such as categories or equipment are returned by the server
/// in English and need to be translated here in the application (there are
/// probably better ways to do this, but that's the way it is right now).
import 'package:flutter/widgets.dart';
import 'package:logging/logging.dart';
import 'package:wger/l10n/generated/app_localizations.dart';
String getServerStringTranslation(String value, BuildContext context) {
final logger = Logger('getServerStringTranslation');
final i18n = AppLocalizations.of(context);
switch (value) {
case 'Abs':
return i18n.abs;
case 'Arms':
return i18n.arms;
case 'Back':
return i18n.back;
case 'Barbell':
return i18n.barbell;
case 'Bench':
return i18n.bench;
case 'Biceps':
return i18n.biceps;
case 'Body Weight':
return i18n.body_weight;
case 'Calves':
return i18n.calves;
case 'Cardio':
return i18n.cardio;
case 'Chest':
return i18n.chest;
case 'Dumbbell':
return i18n.dumbbell;
case 'Glutes':
return i18n.glutes;
case 'Gym mat':
return i18n.gym_mat;
case 'Hamstrings':
return i18n.hamstrings;
case 'Incline bench':
return i18n.incline_bench;
case 'Kettlebell':
return i18n.kettlebell;
case 'Kilometers':
return i18n.kilometers;
case 'Kilometers Per Hour':
return i18n.kilometers_per_hour;
case 'Lats':
return i18n.lats;
case 'Legs':
return i18n.legs;
case 'Lower back':
return i18n.lower_back;
case 'Max Reps':
return i18n.max_reps;
case 'Miles':
return i18n.miles;
case 'Miles Per Hour':
return i18n.miles_per_hour;
case 'Minutes':
return i18n.minutes;
case 'Plates':
return i18n.plates;
case 'Pull-up bar':
return i18n.pull_up_bar;
case 'Quads':
return i18n.quads;
case 'Repetitions':
return i18n.repetitions;
case 'Resistance band':
return i18n.resistance_band;
case 'SZ-Bar':
return i18n.sz_bar;
case 'Seconds':
return i18n.seconds;
case 'Shoulders':
return i18n.shoulders;
case 'Swiss Ball':
return i18n.swiss_ball;
case 'Triceps':
return i18n.triceps;
case 'Until Failure':
return i18n.until_failure;
case 'kg':
return i18n.kg;
case 'lb':
return i18n.lb;
case 'none (bodyweight exercise)':
return i18n.none__bodyweight_exercise_;
default:
logger.warning('Could not translate the server string $value');
return value;
}
}