Added Localizations and ran small fixes
This commit is contained in:
@@ -4,9 +4,10 @@ import 'package:provider/provider.dart';
|
||||
|
||||
import 'package:pshared/provider/locale.dart';
|
||||
|
||||
import 'package:pweb/generated/i18n/app_localizations.dart';
|
||||
import 'package:pweb/services/amplitude.dart';
|
||||
|
||||
import 'package:pweb/generated/i18n/app_localizations.dart';
|
||||
|
||||
|
||||
class LocalePicker extends StatelessWidget {
|
||||
final String title;
|
||||
@@ -74,13 +75,13 @@ class LocalePicker extends StatelessWidget {
|
||||
String _localizedLocaleName(Locale locale, AppLocalizations loc) {
|
||||
switch (locale.languageCode) {
|
||||
case 'en':
|
||||
return 'English';
|
||||
return loc.englishLanguage;
|
||||
case 'ru':
|
||||
return 'Русский';
|
||||
return loc.russianLanguage;
|
||||
case 'de':
|
||||
return 'Deutsch';
|
||||
return loc.germanLanguage;
|
||||
default:
|
||||
return locale.toString();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -37,7 +37,7 @@ class ProfileSettingsPage extends StatelessWidget {
|
||||
errorText: loc.avatarUpdateError,
|
||||
),
|
||||
AccountName(
|
||||
name: 'User Name',
|
||||
name: loc.userNamePlaceholder,
|
||||
title: loc.accountName,
|
||||
hintText: loc.accountNameHint,
|
||||
errorText: loc.accountNameUpdateError,
|
||||
@@ -50,4 +50,4 @@ class ProfileSettingsPage extends StatelessWidget {
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -78,14 +78,21 @@ class SelectValueTile<T> extends BaseEditTile<T> {
|
||||
),
|
||||
),
|
||||
Flexible(
|
||||
child: ListView(
|
||||
shrinkWrap: true,
|
||||
children: displayedOptions.map((o) => RadioListTile<T>(
|
||||
value: o,
|
||||
groupValue: initial,
|
||||
title: Text(labelBuilder(o)),
|
||||
onChanged: isSaving ? null : (v) { if (v != null) onSave(v); },
|
||||
)).toList(),
|
||||
child: RadioGroup<T>(
|
||||
groupValue: initial,
|
||||
onChanged: (value) {
|
||||
if (value != null && !isSaving) {
|
||||
onSave(value);
|
||||
}
|
||||
},
|
||||
child: ListView(
|
||||
shrinkWrap: true,
|
||||
children: displayedOptions.map((o) => RadioListTile<T>(
|
||||
value: o,
|
||||
title: Text(labelBuilder(o)),
|
||||
enabled: !isSaving,
|
||||
)).toList(),
|
||||
),
|
||||
),
|
||||
),
|
||||
const Divider(),
|
||||
|
||||
Reference in New Issue
Block a user