Commit c1d9c871 authored by Wilko Manger's avatar Wilko Manger

Use localized strings in settings

parent eed0d0af
......@@ -17,6 +17,7 @@
import 'package:dynamic_theme/dynamic_theme.dart';
import 'package:flutter/material.dart';
import 'package:pattle/src/ui/main/settings/settings_bloc.dart';
import 'package:pattle/src/ui/resources/localizations.dart';
import 'package:pattle/src/ui/resources/theme.dart';
import 'package:pattle/src/ui/main/settings/widgets/header.dart';
......@@ -42,7 +43,7 @@ class AppearancePageState extends State<AppearancePage> {
return Scaffold(
appBar: AppBar(
title: Text('Appearance'),
title: Text(l(context).appearance),
),
body: ListView(
children: <Widget>[
......@@ -53,7 +54,7 @@ class AppearancePageState extends State<AppearancePage> {
: Icons.brightness_3,
color: redOnBackground(context),
),
title: Header('Brightness'),
title: Header(l(context).brightness),
),
RadioListTile(
groupValue: brightness,
......@@ -61,7 +62,7 @@ class AppearancePageState extends State<AppearancePage> {
onChanged: (brightness) {
DynamicTheme.of(context).setBrightness(brightness);
},
title: Text('Light'),
title: Text(l(context).light),
),
RadioListTile(
groupValue: brightness,
......@@ -69,7 +70,7 @@ class AppearancePageState extends State<AppearancePage> {
onChanged: (brightness) {
DynamicTheme.of(context).setBrightness(brightness);
},
title: Text('Dark'),
title: Text(l(context).dark),
),
Divider(height: 1)
],
......
......@@ -18,6 +18,7 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:pattle/src/ui/main/settings/settings_bloc.dart';
import 'package:pattle/src/ui/resources/localizations.dart';
import 'package:pattle/src/ui/resources/theme.dart';
import 'package:pattle/src/ui/util/user.dart';
......@@ -55,7 +56,7 @@ class NamePageState extends State<NamePage> {
return Scaffold(
appBar: AppBar(
title: Text(
'Name',
l(context).name,
style: TextStyle(
color: redOnBackground(context),
),
......@@ -111,24 +112,29 @@ class NamePageState extends State<NamePage> {
}
},
),
Row(
children: <Widget>[
Padding(
padding: EdgeInsets.all(16),
child: Icon(
Icons.info_outline,
size: 28,
color: Theme.of(context).textTheme.caption.color,
Padding(
padding: EdgeInsets.all(16),
child: Row(
children: <Widget>[
Padding(
padding: EdgeInsets.only(right: 16),
child: Icon(
Icons.info_outline,
size: 28,
color: Theme.of(context).textTheme.caption.color,
),
),
),
Text(
'This is how you will display to others',
style: TextStyle(
color: Theme.of(context).textTheme.caption.color,
),
)
],
)
Expanded(
child: Text(
l(context).editNameDescription,
style: TextStyle(
color: Theme.of(context).textTheme.caption.color,
),
),
)
],
),
),
],
),
);
......
......@@ -18,6 +18,7 @@
import 'package:flutter/material.dart';
import 'package:pattle/src/ui/main/settings/settings_bloc.dart';
import 'package:pattle/src/ui/main/widgets/user_avatar.dart';
import 'package:pattle/src/ui/resources/localizations.dart';
import 'package:pattle/src/ui/resources/theme.dart';
import 'package:pattle/src/ui/util/user.dart';
......@@ -44,7 +45,7 @@ class ProfilePageState extends State<ProfilePage> {
return Scaffold(
appBar: AppBar(
title: Text('Profile'),
title: Text(l(context).profile),
),
body: Center(
child: Column(
......@@ -80,7 +81,7 @@ class ProfilePageState extends State<ProfilePage> {
Icons.person,
color: redOnBackground(context),
),
title: Text('Name'),
title: Text(l(context).name),
subtitle: Text(displayNameOf(bloc.me)),
trailing: Icon(Icons.edit),
onTap: () => Navigator.pushNamed(
......@@ -93,7 +94,7 @@ class ProfilePageState extends State<ProfilePage> {
Icons.alternate_email,
color: redOnBackground(context),
),
title: Text('Username'),
title: Text(l(context).username),
subtitle: Text(bloc.me.id.toString()),
)
],
......
......@@ -17,6 +17,7 @@
import 'package:flutter/material.dart';
import 'package:pattle/src/ui/main/settings/settings_bloc.dart';
import 'package:pattle/src/ui/main/widgets/user_avatar.dart';
import 'package:pattle/src/ui/resources/localizations.dart';
import 'package:pattle/src/ui/resources/theme.dart';
import 'package:pattle/src/ui/util/user.dart';
......@@ -41,7 +42,7 @@ class SettingsPageState extends State<SettingsPage> {
return Scaffold(
appBar: AppBar(
title: Text('Settings'),
title: Text(l(context).settings),
),
body: ListView(
children: <Widget>[
......@@ -86,13 +87,13 @@ class SettingsPageState extends State<SettingsPage> {
Divider(height: 1),
ListTile(
leading: Icon(Icons.vpn_key, color: LightColors.red),
title: Text('Account'),
subtitle: Text('Privacy, security, change password'),
title: Text(l(context).account),
subtitle: Text(l(context).accountDescription),
),
ListTile(
leading: Icon(Icons.landscape, color: LightColors.red),
title: Text('Appearance'),
subtitle: Text('Theme, font size'),
title: Text(l(context).appearance),
subtitle: Text(l(context).appearanceDescription),
onTap: () =>
Navigator.of(context).pushNamed(Routes.settingsAppearance),
)
......
......@@ -25,6 +25,7 @@ class Strings {
// Common //
final appName = 'Pattle';
final name = 'Name';
final advanced = 'Advanced';
final username = 'Username';
final password = 'Password';
......@@ -43,6 +44,9 @@ class Strings {
final newGroup = 'New group';
final groupName = 'Group name';
final participants = 'Participants';
final profile = 'Profile';
final settings = 'Settings';
final description = 'Description';
final noDescriptionSet = 'No description has been set';
......@@ -93,6 +97,19 @@ class Strings {
String loggingInAs(String name) => 'Logging in as $name';
// SettingsPage //
final account = 'Account';
final accountDescription = 'Privacy, security, change password';
final appearance = 'Appearance';
final appearanceDescription = 'Theme, font size';
final brightness = 'Brightness';
final light = 'Light';
final dark = 'Dark';
final editNameDescription = 'This is not your username.'
' This is the name that will be visible to others.';
// Room creation event
List<TextSpan> createdThisGroup(TextSpan name) =>
[name, TextSpan(text: ' created this group')];
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment