Skip to content

Commit 29407b0

Browse files
resolved conflicts and adapted localization for config screens
1 parent a0bd717 commit 29407b0

13 files changed

Lines changed: 178 additions & 69 deletions

lib/l10n/app_en.arb

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -290,9 +290,9 @@
290290
"showLuxmeterConfig": "Lux Meter Configurations",
291291
"luxmeterConfigurations": "Lux Meter Configurations",
292292
"updatePeriod": "Update Period",
293-
"updatePeriodHint": "Please provide time interval at which data will be updated (100 ms to 1000 ms)",
293+
"luxmeterUpdatePeriodHint": "Please provide time interval at which data will be updated (100 ms to 1000 ms)",
294294
"highLimit": "High Limit",
295-
"highLimitHint": "Please provide the maximum limit of lux value to be recorded (10 Lx to 10000 Lx)",
295+
"luxmeterHighLimitHint": "Please provide the maximum limit of lux value to be recorded (10 Lx to 10000 Lx)",
296296
"sensorGain": "Sensor Gain",
297297
"sensorGainHint": "Please set gain of the sensor",
298298
"locationData": "Include Location Data",
@@ -305,5 +305,14 @@
305305
"baroMeterBulletPoint1": "The Barometer can be used to measure Atmospheric pressure. This instrument is compatible with either the built in pressure sensor on any android device or the BMP-180 pressure sensor",
306306
"baroMeterBulletPoint2": "If you want to use the sensor BMP-180, connect the sensor to PSLab device as shown in the figure.",
307307
"baroMeterBulletPoint3": "The above pin configuration has to be same except for the pin GND. GND is meant for Ground and any of the PSLab device GND pins can be used since they are common.",
308-
"baroMeterBulletPoint4": "Select the sensor by going to the Configure tab from the bottom navigation bar and choose BMP-180 in the drop down menu under Select Sensor."
308+
"baroMeterBulletPoint4": "Select the sensor by going to the Configure tab from the bottom navigation bar and choose BMP-180 in the drop down menu under Select Sensor.",
309+
"soundmeterConfig" : "Soundmeter Configurations",
310+
"barometerConfig" : "Barometer Configurations",
311+
"baroUpdatePeriodHint" : "Please provide time interval at which data will be updated (100 ms to 2000 ms)",
312+
"barometerHighLimitHint" : "Please provide the maximum limit of lux value to be recorded (0 atm to 1.10 atm)",
313+
"gyroscopeConfigurations" : "Gyroscope Configurations",
314+
"gyroscopeHighLimitHint" : "Please provide the maximum limit of lux value to be recorded (0 rad/s to 1000 rad/s)",
315+
"accelerometerConfigurations" : "Accelerometer Configurations",
316+
"accelerometerUpdatePeriodHint" : "Please provide time interval at which data will be updated",
317+
"accelerometerHighLimitHint" : "Please provide the maximum limit of lux value to be recorded"
309318
}

lib/l10n/app_localizations.dart

Lines changed: 58 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1834,23 +1834,23 @@ abstract class AppLocalizations {
18341834
/// **'Update Period'**
18351835
String get updatePeriod;
18361836

1837-
/// No description provided for @updatePeriodHint.
1837+
/// No description provided for @luxmeterUpdatePeriodHint.
18381838
///
18391839
/// In en, this message translates to:
18401840
/// **'Please provide time interval at which data will be updated (100 ms to 1000 ms)'**
1841-
String get updatePeriodHint;
1841+
String get luxmeterUpdatePeriodHint;
18421842

18431843
/// No description provided for @highLimit.
18441844
///
18451845
/// In en, this message translates to:
18461846
/// **'High Limit'**
18471847
String get highLimit;
18481848

1849-
/// No description provided for @highLimitHint.
1849+
/// No description provided for @luxmeterHighLimitHint.
18501850
///
18511851
/// In en, this message translates to:
18521852
/// **'Please provide the maximum limit of lux value to be recorded (10 Lx to 10000 Lx)'**
1853-
String get highLimitHint;
1853+
String get luxmeterHighLimitHint;
18541854

18551855
/// No description provided for @sensorGain.
18561856
///
@@ -1929,6 +1929,60 @@ abstract class AppLocalizations {
19291929
/// In en, this message translates to:
19301930
/// **'Select the sensor by going to the Configure tab from the bottom navigation bar and choose BMP-180 in the drop down menu under Select Sensor.'**
19311931
String get baroMeterBulletPoint4;
1932+
1933+
/// No description provided for @soundmeterConfig.
1934+
///
1935+
/// In en, this message translates to:
1936+
/// **'Soundmeter Configurations'**
1937+
String get soundmeterConfig;
1938+
1939+
/// No description provided for @barometerConfig.
1940+
///
1941+
/// In en, this message translates to:
1942+
/// **'Barometer Configurations'**
1943+
String get barometerConfig;
1944+
1945+
/// No description provided for @baroUpdatePeriodHint.
1946+
///
1947+
/// In en, this message translates to:
1948+
/// **'Please provide time interval at which data will be updated (100 ms to 2000 ms)'**
1949+
String get baroUpdatePeriodHint;
1950+
1951+
/// No description provided for @barometerHighLimitHint.
1952+
///
1953+
/// In en, this message translates to:
1954+
/// **'Please provide the maximum limit of lux value to be recorded (0 atm to 1.10 atm)'**
1955+
String get barometerHighLimitHint;
1956+
1957+
/// No description provided for @gyroscopeConfigurations.
1958+
///
1959+
/// In en, this message translates to:
1960+
/// **'Gyroscope Configurations'**
1961+
String get gyroscopeConfigurations;
1962+
1963+
/// No description provided for @gyroscopeHighLimitHint.
1964+
///
1965+
/// In en, this message translates to:
1966+
/// **'Please provide the maximum limit of lux value to be recorded (0 rad/s to 1000 rad/s)'**
1967+
String get gyroscopeHighLimitHint;
1968+
1969+
/// No description provided for @accelerometerConfigurations.
1970+
///
1971+
/// In en, this message translates to:
1972+
/// **'Accelerometer Configurations'**
1973+
String get accelerometerConfigurations;
1974+
1975+
/// No description provided for @accelerometerUpdatePeriodHint.
1976+
///
1977+
/// In en, this message translates to:
1978+
/// **'Please provide time interval at which data will be updated'**
1979+
String get accelerometerUpdatePeriodHint;
1980+
1981+
/// No description provided for @accelerometerHighLimitHint.
1982+
///
1983+
/// In en, this message translates to:
1984+
/// **'Please provide the maximum limit of lux value to be recorded'**
1985+
String get accelerometerHighLimitHint;
19321986
}
19331987

19341988
class _AppLocalizationsDelegate

lib/l10n/app_localizations_en.dart

Lines changed: 34 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -931,14 +931,14 @@ class AppLocalizationsEn extends AppLocalizations {
931931
String get updatePeriod => 'Update Period';
932932

933933
@override
934-
String get updatePeriodHint =>
934+
String get luxmeterUpdatePeriodHint =>
935935
'Please provide time interval at which data will be updated (100 ms to 1000 ms)';
936936

937937
@override
938938
String get highLimit => 'High Limit';
939939

940940
@override
941-
String get highLimitHint =>
941+
String get luxmeterHighLimitHint =>
942942
'Please provide the maximum limit of lux value to be recorded (10 Lx to 10000 Lx)';
943943

944944
@override
@@ -985,4 +985,36 @@ class AppLocalizationsEn extends AppLocalizations {
985985
@override
986986
String get baroMeterBulletPoint4 =>
987987
'Select the sensor by going to the Configure tab from the bottom navigation bar and choose BMP-180 in the drop down menu under Select Sensor.';
988+
989+
@override
990+
String get soundmeterConfig => 'Soundmeter Configurations';
991+
992+
@override
993+
String get barometerConfig => 'Barometer Configurations';
994+
995+
@override
996+
String get baroUpdatePeriodHint =>
997+
'Please provide time interval at which data will be updated (100 ms to 2000 ms)';
998+
999+
@override
1000+
String get barometerHighLimitHint =>
1001+
'Please provide the maximum limit of lux value to be recorded (0 atm to 1.10 atm)';
1002+
1003+
@override
1004+
String get gyroscopeConfigurations => 'Gyroscope Configurations';
1005+
1006+
@override
1007+
String get gyroscopeHighLimitHint =>
1008+
'Please provide the maximum limit of lux value to be recorded (0 rad/s to 1000 rad/s)';
1009+
1010+
@override
1011+
String get accelerometerConfigurations => 'Accelerometer Configurations';
1012+
1013+
@override
1014+
String get accelerometerUpdatePeriodHint =>
1015+
'Please provide time interval at which data will be updated';
1016+
1017+
@override
1018+
String get accelerometerHighLimitHint =>
1019+
'Please provide the maximum limit of lux value to be recorded';
9881020
}

lib/view/accelerometer_config_screen.dart

Lines changed: 20 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
import 'package:flutter/material.dart';
22
import 'package:flutter/services.dart';
33
import 'package:provider/provider.dart';
4-
import 'package:pslab/constants.dart';
4+
import 'package:pslab/l10n/app_localizations.dart';
55
import 'package:pslab/providers/accelerometer_config_provider.dart';
66
import 'package:pslab/view/widgets/config_widgets.dart';
77

8+
import '../providers/locator.dart';
89
import '../theme/colors.dart';
910

1011
class AccelerometerConfigScreen extends StatefulWidget {
@@ -19,6 +20,7 @@ class _AccelerometerConfigScreenState extends State<AccelerometerConfigScreen> {
1920
final TextEditingController _updatePeriodController = TextEditingController();
2021
final TextEditingController _highLimitController = TextEditingController();
2122
final TextEditingController _sensorGainController = TextEditingController();
23+
AppLocalizations appLocalizations = getIt.get<AppLocalizations>();
2224

2325
@override
2426
void initState() {
@@ -70,7 +72,7 @@ class _AccelerometerConfigScreenState extends State<AccelerometerConfigScreen> {
7072
}),
7173
backgroundColor: primaryRed,
7274
title: Text(
73-
accelerometerConfigurations,
75+
appLocalizations.accelerometerConfigurations,
7476
style: TextStyle(
7577
color: appBarContentColor,
7678
fontSize: 15,
@@ -87,8 +89,9 @@ class _AccelerometerConfigScreenState extends State<AccelerometerConfigScreen> {
8789
crossAxisAlignment: CrossAxisAlignment.start,
8890
children: [
8991
ConfigInputItem(
90-
title: updatePeriod,
91-
value: '${provider.config.updatePeriod} $ms',
92+
title: appLocalizations.updatePeriod,
93+
value:
94+
'${provider.config.updatePeriod} ${appLocalizations.ms}',
9295
controller: _updatePeriodController,
9396
onChanged: (value) {
9497
final intValue = int.tryParse(value);
@@ -100,18 +103,19 @@ class _AccelerometerConfigScreenState extends State<AccelerometerConfigScreen> {
100103
ScaffoldMessenger.of(context).showSnackBar(
101104
SnackBar(
102105
content: Text(
103-
updatePeriodErrorMessage,
106+
appLocalizations.updatePeriodErrorMessage,
104107
style: TextStyle(color: snackBarContentColor),
105108
),
106109
backgroundColor: snackBarBackgroundColor),
107110
);
108111
}
109112
},
110-
hint: accelerometerUpdatePeriodHint,
113+
hint: appLocalizations.accelerometerUpdatePeriodHint,
111114
),
112115
ConfigInputItem(
113-
title: highLimit,
114-
value: '${provider.config.highLimit} $lx',
116+
title: appLocalizations.highLimit,
117+
value:
118+
'${provider.config.highLimit} ${appLocalizations.lx}',
115119
controller: _highLimitController,
116120
onChanged: (value) {
117121
final intValue = int.tryParse(value);
@@ -123,30 +127,30 @@ class _AccelerometerConfigScreenState extends State<AccelerometerConfigScreen> {
123127
ScaffoldMessenger.of(context).showSnackBar(
124128
SnackBar(
125129
content: Text(
126-
highLimitErrorMessage,
130+
appLocalizations.highLimitErrorMessage,
127131
style: TextStyle(color: snackBarContentColor),
128132
),
129133
backgroundColor: snackBarBackgroundColor),
130134
);
131135
}
132136
},
133-
hint: accelerometerHighLimitHint,
137+
hint: appLocalizations.accelerometerHighLimitHint,
134138
),
135139
ConfigDropdownItem(
136-
title: activeSensor,
140+
title: appLocalizations.activeSensor,
137141
selectedValue: provider.config.activeSensor,
138142
options: [
139143
ConfigOption(
140144
value: 'In-built Sensor',
141-
displayName: inBuiltSensor),
145+
displayName: appLocalizations.inBuiltSensor),
142146
ConfigOption(value: 'MPU6050', displayName: 'MPU6050'),
143147
],
144148
onChanged: (value) {
145149
provider.updateActiveSensor(value);
146150
},
147151
),
148152
ConfigInputItem(
149-
title: sensorGain,
153+
title: appLocalizations.sensorGain,
150154
value: provider.config.sensorGain.toString(),
151155
controller: _sensorGainController,
152156
onChanged: (value) {
@@ -155,11 +159,11 @@ class _AccelerometerConfigScreenState extends State<AccelerometerConfigScreen> {
155159
provider.updateSensorGain(intValue);
156160
}
157161
},
158-
hint: sensorGainHint,
162+
hint: appLocalizations.sensorGainHint,
159163
),
160164
ConfigCheckboxItem(
161-
title: locationData,
162-
subtitle: locationDataHint,
165+
title: appLocalizations.locationData,
166+
subtitle: appLocalizations.locationDataHint,
163167
value: provider.config.includeLocationData,
164168
onChanged: (value) {
165169
provider.updateIncludeLocationData(value);

lib/view/accelerometer_screen.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,11 +68,11 @@ class _AccelerometerScreenState extends State<AccelerometerScreen> {
6868
items: [
6969
PopupMenuItem(
7070
value: 'show_logged_data',
71-
child: Text(showLoggedData),
71+
child: Text(appLocalizations.showLoggedData),
7272
),
7373
PopupMenuItem(
7474
value: 'accelerometer_config',
75-
child: Text(accelerometerConfigurations),
75+
child: Text(appLocalizations.accelerometerConfigurations),
7676
),
7777
],
7878
elevation: 8,

0 commit comments

Comments
 (0)