Replace more unstranslated strings

This commit is contained in:
Roland Geider
2021-03-12 13:07:52 +01:00
parent d1da745d58
commit cc729f305b
9 changed files with 57 additions and 27 deletions

View File

@@ -58,6 +58,8 @@
"@gymMode": {
"description": "Label when starting the gym mode"
},
"logHelpEntries": "If on a single day there is more than one entry with the same number of repetitions, but different weights, only the entry with the higher weight is shown in the diagram.",
"logHelpEntriesUnits": "Note that only entries with a weight unit (kg or lb) and repetitions are charted, other combinations such as time or until failure are ignored here.",
"description": "Description",
"@description": {},
"save": "Save",
@@ -138,10 +140,18 @@
"@amount": {
"description": "The amount (e.g. in grams) of an ingredient in a meal"
},
"unit": "Unit",
"@unit": {
"description": "The unit used for a repetition (kg, time, etc.)"
},
"newEntry": "New entry",
"@newEntry": {
"description": "Title when adding a new entry such as a weight or log entry"
},
"noWeightEntries": "You have no weight entries",
"@noWeightEntries": {
"description": "Message shown when the user has no logged weight entries"
},
"edit": "Edit",
"@edit": {},
"loadingText": "Loading...",
@@ -159,5 +169,22 @@
"aboutText": "wger is copylefted libre software, licensed GPLv3+ and available on GitHub:",
"@aboutText": {
"description": "Text in the about dialog"
},
"calendar": "Calendar",
"goToToday": "Go to today",
"@goToToday": {
"description": "Label on button to jump back to 'today' in the calendar widget"
},
"enterValue": "Please enter a value",
"@enterValue": {
"description": "Error message when the user hasn't entered a value on a required field"
},
"enterValidNumber": "Please enter a valid number",
"@enterValidNumber": {
"description": "Error message when the user has submitted an invalid number (e.g. '3,.,.,.')"
},
"selectIngredient": "Please select an ingredient",
"@selectIngredient": {
"description": "Error message when the user hasn't selected an ingredient from the autocompleter"
}
}

View File

@@ -101,7 +101,7 @@ class _DashboardScreenState extends State<DashboardScreen> {
DashboardWeightWidget(context: context),
Container(
height: 650, // TODO: refactor calendar so we can get rid of size
child: DashboardCalendarWidget(title: 'Calendar'),
child: DashboardCalendarWidget(),
),
],
),

View File

@@ -30,6 +30,8 @@ import 'package:wger/providers/workout_plans.dart';
import 'package:wger/theme/theme.dart';
// Example holidays
//
// (perhaps we can do something with this, such as marking future training days?)
final Map<DateTime, List> _holidays = {
DateTime(2021, 1, 1): ['New Year\'s Day'],
DateTime(2021, 1, 6): ['Epiphany'],
@@ -62,9 +64,7 @@ class Event {
}
class DashboardCalendarWidget extends StatefulWidget {
DashboardCalendarWidget({Key key, this.title}) : super(key: key);
final String title;
DashboardCalendarWidget({Key key}) : super(key: key);
@override
_DashboardCalendarWidgetState createState() => _DashboardCalendarWidgetState();
@@ -136,7 +136,7 @@ class _DashboardCalendarWidgetState extends State<DashboardCalendarWidget>
// Add events to lists
_events[date].add(Event(
EventType.session,
'Impression: ${session.impressionAsString} $time',
'${AppLocalizations.of(context).impression}: ${session.impressionAsString} $time',
));
}
});
@@ -185,7 +185,11 @@ class _DashboardCalendarWidgetState extends State<DashboardCalendarWidget>
mainAxisSize: MainAxisSize.max,
children: [
const SizedBox(height: 8.0),
Text(widget.title, style: Theme.of(context).textTheme.headline4),
Text(
AppLocalizations.of(context).calendar,
style: Theme.of(context).textTheme.headline4,
),
// Switch out 2 lines below to play with TableCalendar's settings
//-----------------------
_buildTableCalendar(),
@@ -193,7 +197,6 @@ class _DashboardCalendarWidgetState extends State<DashboardCalendarWidget>
const SizedBox(height: 8.0),
_buildButtons(),
const SizedBox(height: 8.0),
//_buildEventList(),
Expanded(child: _buildEventList()),
],
),
@@ -358,7 +361,7 @@ class _DashboardCalendarWidgetState extends State<DashboardCalendarWidget>
mainAxisAlignment: MainAxisAlignment.end,
children: <Widget>[
TextButton(
child: Text('Go to today'),
child: Text(AppLocalizations.of(context).goToToday),
onPressed: () async {
final today = DateTime.now();
_calendarController.setSelectedDay(

View File

@@ -149,7 +149,7 @@ class _DashboardWeightWidgetState extends State<DashboardWeightWidget> {
: Container(
alignment: Alignment.center,
height: 150,
child: Text('You have no weight entries'),
child: Text(AppLocalizations.of(context).noWeightEntries),
),
Row(
mainAxisAlignment: MainAxisAlignment.end,
@@ -213,7 +213,7 @@ class _DashboardWorkoutWidgetState extends State<DashboardWorkoutWidget> {
...set.settings.map((s) {
return Column(
children: [
Text(s.exerciseObj.name, style: TextStyle(fontWeight: FontWeight.bold)),
Text(s.exerciseObj.name),
Text(s.repsText),
SizedBox(height: 10),
],

View File

@@ -145,10 +145,10 @@ class MealItemForm extends StatelessWidget {
},
validator: (value) {
if (value.isEmpty) {
return 'Please select an ingredient';
return AppLocalizations.of(context).selectIngredient;
}
if (mealItem.ingredientId == null) {
return 'Please select an ingredient';
return AppLocalizations.of(context).selectIngredient;
}
return null;
},
@@ -165,7 +165,7 @@ class MealItemForm extends StatelessWidget {
try {
double.parse(value);
} catch (error) {
return 'Please enter a valid number';
return AppLocalizations.of(context).enterValidNumber;
}
return null;
},

View File

@@ -61,12 +61,12 @@ class WeightForm extends StatelessWidget {
},
validator: (value) {
if (value.isEmpty) {
return 'Please enter a weight';
return AppLocalizations.of(context).enterValue;
}
try {
double.parse(value);
} catch (error) {
return 'Please enter a valid number';
return AppLocalizations.of(context).enterValidNumber;
}
return null;
},

View File

@@ -211,7 +211,7 @@ class LogPage extends StatelessWidget {
try {
double.parse(value);
} catch (error) {
return 'Please enter a valid number';
return AppLocalizations.of(context).enterValidNumber;
}
return null;
},

View File

@@ -18,6 +18,7 @@
import 'package:flutter/material.dart';
import 'package:flutter/widgets.dart';
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
import 'package:intl/intl.dart';
import 'package:provider/provider.dart';
import 'package:wger/models/exercises/exercise.dart';
@@ -90,11 +91,11 @@ class ExerciseLog extends StatelessWidget {
Row(
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: [
Text('Amount'),
Text('Unit'),
Text('Weight'),
Text('Unit'),
Text('RiR'),
Text(AppLocalizations.of(context).amount),
Text(AppLocalizations.of(context).unit),
Text(AppLocalizations.of(context).weight),
Text(AppLocalizations.of(context).unit),
Text(AppLocalizations.of(context).rir),
],
),
],

View File

@@ -17,6 +17,7 @@
*/
import 'package:flutter/material.dart';
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
import 'package:wger/models/workouts/workout_plan.dart';
import 'package:wger/screens/workout_plan_screen.dart';
import 'package:wger/widgets/workouts/log.dart';
@@ -47,6 +48,7 @@ class _WorkoutLogsState extends State<WorkoutLogs> {
style: Theme.of(context).textTheme.headline5,
),
),
/*
Padding(
padding: const EdgeInsets.all(8.0),
child: Text(
@@ -55,21 +57,18 @@ class _WorkoutLogsState extends State<WorkoutLogs> {
textAlign: TextAlign.justify,
),
),
*/
Padding(
padding: const EdgeInsets.all(8.0),
child: Text(
'If on a single day there is more than one entry with the same'
'number of repetitions, but different weights, only the entry with'
'the higher weight is shown in the diagram.',
AppLocalizations.of(context).logHelpEntries,
textAlign: TextAlign.justify,
),
),
Padding(
padding: const EdgeInsets.all(8.0),
child: Text(
'Note that only entries with a weight unit (kg or lb) and repetitions'
'are charted, other combinations such as time or until failure'
'are ignored here.',
AppLocalizations.of(context).logHelpEntriesUnits,
textAlign: TextAlign.justify,
),
),