This commit is contained in:
Hillel Coren 2018-12-13 22:29:20 +02:00
parent b26e02f4d4
commit 753e0e8590
2 changed files with 12 additions and 2 deletions

View File

@ -145,6 +145,9 @@ class _ProjectEditState extends State<ProjectEdit> {
TextFormField(
autocorrect: false,
controller: _nameController,
validator: (String val) => val.trim().isEmpty
? AppLocalization.of(context).pleaseEnterAName
: null,
decoration: InputDecoration(
labelText: localization.name,
),
@ -161,8 +164,8 @@ class _ProjectEditState extends State<ProjectEdit> {
keyboardType: TextInputType.number,
controller: _hoursController,
decoration: InputDecoration(
//labelText: localization.budgetedHours,
),
labelText: localization.budgetedHours,
),
),
TextFormField(
keyboardType: TextInputType.number,

View File

@ -20,6 +20,8 @@ class AppLocalization {
static final Map<String, Map<String, String>> _localizedValues = {
'en': {
'please_enter_a_name': 'Please enter a name',
'budgeted_hours': 'Budgeted Hours',
'created_project': 'Successfully created project',
'updated_project': 'Successfully updated project',
'archived_project': 'Successfully archived project',
@ -10620,6 +10622,11 @@ class AppLocalization {
String get expired => _localizedValues[locale.toString()]['expired'];
String get budgetedHours => _localizedValues[locale.toString()]['budgeted_hours'];
String get pleaseEnterAName => _localizedValues[locale.toString()]['please_enter_a_name'];
String lookup(String key) {
final lookupKey = toSnakeCase(key);
return _localizedValues[locale.toString()][lookupKey] ??