Integrate first batch of strings
This commit is contained in:
parent
ffb8fc0ada
commit
ca8cb67f6d
|
@ -10,6 +10,7 @@ import '../hooks/delayed_loading.dart';
|
|||
import '../hooks/logged_in_action.dart';
|
||||
import '../hooks/memo_future.dart';
|
||||
import '../hooks/stores.dart';
|
||||
import '../l10n/l10n.dart';
|
||||
import '../util/extensions/api.dart';
|
||||
import '../util/extensions/spaced.dart';
|
||||
import '../util/goto.dart';
|
||||
|
@ -171,11 +172,11 @@ class CommunityPage extends HookWidget {
|
|||
preferredSize: const TabBar(tabs: []).preferredSize,
|
||||
child: Material(
|
||||
color: theme.cardColor,
|
||||
child: const TabBar(
|
||||
child: TabBar(
|
||||
tabs: [
|
||||
Tab(text: 'Posts'),
|
||||
Tab(text: 'Comments'),
|
||||
Tab(text: 'About'),
|
||||
Tab(text: L10n.of(context).posts),
|
||||
Tab(text: L10n.of(context).comments),
|
||||
const Tab(text: 'About'),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
@ -430,7 +431,7 @@ class _AboutTab extends StatelessWidget {
|
|||
communityName: community.community.name,
|
||||
),
|
||||
),
|
||||
child: const Text('Modlog'),
|
||||
child: Text(L10n.of(context).modlog),
|
||||
),
|
||||
),
|
||||
const _Divider(),
|
||||
|
|
|
@ -10,6 +10,7 @@ import '../hooks/image_picker.dart';
|
|||
import '../hooks/logged_in_action.dart';
|
||||
import '../hooks/memo_future.dart';
|
||||
import '../hooks/stores.dart';
|
||||
import '../l10n/l10n.dart';
|
||||
import '../util/extensions/api.dart';
|
||||
import '../util/extensions/spaced.dart';
|
||||
import '../util/goto.dart';
|
||||
|
@ -165,7 +166,7 @@ class CreatePostPage extends HookWidget {
|
|||
child: DropdownButtonHideUnderline(
|
||||
child: DropdownButton<int>(
|
||||
value: selectedCommunity.value?.community?.id,
|
||||
hint: const Text('Community'),
|
||||
hint: Text(L10n.of(context).community),
|
||||
onChanged: (communityId) => selectedCommunity.value =
|
||||
allCommunitiesSnap.data
|
||||
?.firstWhere((e) => e.community.id == communityId),
|
||||
|
@ -179,9 +180,9 @@ class CreatePostPage extends HookWidget {
|
|||
child: TextField(
|
||||
enabled: pictrsDeleteToken.value == null,
|
||||
controller: urlController,
|
||||
decoration: const InputDecoration(
|
||||
labelText: 'URL',
|
||||
suffixIcon: Icon(Icons.link),
|
||||
decoration: InputDecoration(
|
||||
labelText: L10n.of(context).url,
|
||||
suffixIcon: const Icon(Icons.link),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
@ -203,7 +204,7 @@ class CreatePostPage extends HookWidget {
|
|||
controller: titleController,
|
||||
minLines: 1,
|
||||
maxLines: 2,
|
||||
decoration: const InputDecoration(labelText: 'Title'),
|
||||
decoration: InputDecoration(labelText: L10n.of(context).title),
|
||||
);
|
||||
|
||||
final body = IndexedStack(
|
||||
|
@ -214,7 +215,7 @@ class CreatePostPage extends HookWidget {
|
|||
keyboardType: TextInputType.multiline,
|
||||
maxLines: null,
|
||||
minLines: 5,
|
||||
decoration: const InputDecoration(labelText: 'Body'),
|
||||
decoration: InputDecoration(labelText: L10n.of(context).body),
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.all(16),
|
||||
|
@ -289,7 +290,7 @@ class CreatePostPage extends HookWidget {
|
|||
value: nsfw.value,
|
||||
onChanged: (val) => nsfw.value = val,
|
||||
),
|
||||
const Text('NSFW')
|
||||
Text(L10n.of(context).nsfw)
|
||||
],
|
||||
),
|
||||
),
|
||||
|
@ -297,7 +298,7 @@ class CreatePostPage extends HookWidget {
|
|||
onPressed: delayed.pending ? () {} : handleSubmit,
|
||||
child: delayed.loading
|
||||
? const CircularProgressIndicator()
|
||||
: const Text('post'),
|
||||
: Text(L10n.of(context).post),
|
||||
)
|
||||
],
|
||||
),
|
||||
|
|
|
@ -9,6 +9,7 @@ import 'package:lemmy_api_client/v2.dart';
|
|||
import '../hooks/infinite_scroll.dart';
|
||||
import '../hooks/memo_future.dart';
|
||||
import '../hooks/stores.dart';
|
||||
import '../l10n/l10n.dart';
|
||||
import '../util/goto.dart';
|
||||
import '../widgets/bottom_modal.dart';
|
||||
import '../widgets/infinite_scroll.dart';
|
||||
|
@ -83,7 +84,7 @@ class HomeTab extends HookWidget {
|
|||
),
|
||||
ListTile(
|
||||
title: Text(
|
||||
'Subscribed',
|
||||
L10n.of(context).subscribed,
|
||||
style: TextStyle(
|
||||
color: accStore.hasNoAccount
|
||||
? theme.textTheme.bodyText1.color.withOpacity(0.4)
|
||||
|
@ -143,7 +144,7 @@ class HomeTab extends HookWidget {
|
|||
),
|
||||
ListTile(
|
||||
title: Text(
|
||||
'Subscribed',
|
||||
L10n.of(context).subscribed,
|
||||
style: TextStyle(
|
||||
color: accStore.isAnonymousFor(instance)
|
||||
? theme.textTheme.bodyText1.color.withOpacity(0.4)
|
||||
|
@ -161,7 +162,7 @@ class HomeTab extends HookWidget {
|
|||
leading: const SizedBox(width: 20),
|
||||
),
|
||||
ListTile(
|
||||
title: const Text('Local'),
|
||||
title: Text(L10n.of(context).local),
|
||||
onTap: () => pop(_SelectedList(
|
||||
listingType: PostListingType.local,
|
||||
instanceHost: instance,
|
||||
|
@ -169,7 +170,7 @@ class HomeTab extends HookWidget {
|
|||
leading: const SizedBox(width: 20),
|
||||
),
|
||||
ListTile(
|
||||
title: const Text('All'),
|
||||
title: Text(L10n.of(context).all),
|
||||
onTap: () => pop(_SelectedList(
|
||||
listingType: PostListingType.all,
|
||||
instanceHost: instance,
|
||||
|
|
|
@ -10,6 +10,7 @@ import 'package:matrix4_transform/matrix4_transform.dart';
|
|||
import '../hooks/delayed_loading.dart';
|
||||
import '../hooks/infinite_scroll.dart';
|
||||
import '../hooks/stores.dart';
|
||||
import '../l10n/l10n.dart';
|
||||
import '../util/delayed_action.dart';
|
||||
import '../util/extensions/api.dart';
|
||||
import '../util/extensions/datetime.dart';
|
||||
|
@ -58,7 +59,7 @@ class InboxPage extends HookWidget {
|
|||
selected.value = val;
|
||||
isc.clear();
|
||||
},
|
||||
title: 'select instance',
|
||||
title: L10n.of(context).select_instance,
|
||||
groupValue: selected.value,
|
||||
buttonBuilder: (context, displayString, onPressed) => TextButton(
|
||||
style: TextButton.styleFrom(
|
||||
|
@ -90,11 +91,11 @@ class InboxPage extends HookWidget {
|
|||
tooltip: unreadOnly.value ? 'show all' : 'show only unread',
|
||||
)
|
||||
],
|
||||
bottom: const TabBar(
|
||||
bottom: TabBar(
|
||||
tabs: [
|
||||
Tab(text: 'Replies'),
|
||||
Tab(text: 'Mentions'),
|
||||
Tab(text: 'Messages'),
|
||||
Tab(text: L10n.of(context).replies),
|
||||
Tab(text: L10n.of(context).mentions),
|
||||
const Tab(text: 'Messages'),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
@ -279,7 +280,7 @@ class PrivateMessageTile extends HookWidget {
|
|||
Row(
|
||||
children: [
|
||||
Text(
|
||||
toMe ? 'from ' : 'to ',
|
||||
'${toMe ? L10n.of(context).from : L10n.of(context).to} ',
|
||||
style: TextStyle(color: theme.textTheme.caption.color),
|
||||
),
|
||||
InkWell(
|
||||
|
@ -343,19 +344,19 @@ class PrivateMessageTile extends HookWidget {
|
|||
TileAction(
|
||||
icon: moreIcon,
|
||||
onPressed: showMoreMenu,
|
||||
tooltip: 'more',
|
||||
tooltip: L10n.of(context).more,
|
||||
),
|
||||
if (toMe) ...[
|
||||
TileAction(
|
||||
iconColor: read.value ? theme.accentColor : null,
|
||||
icon: Icons.check,
|
||||
tooltip: 'mark as read',
|
||||
tooltip: L10n.of(context).mark_as_read,
|
||||
onPressed: handleRead,
|
||||
delayedLoading: readDelayed,
|
||||
),
|
||||
TileAction(
|
||||
icon: Icons.reply,
|
||||
tooltip: 'reply',
|
||||
tooltip: L10n.of(context).reply,
|
||||
onPressed: () {
|
||||
showCupertinoModalPopup(
|
||||
context: context,
|
||||
|
@ -368,7 +369,7 @@ class PrivateMessageTile extends HookWidget {
|
|||
] else ...[
|
||||
TileAction(
|
||||
icon: Icons.edit,
|
||||
tooltip: 'edit',
|
||||
tooltip: L10n.of(context).edit,
|
||||
onPressed: () async {
|
||||
final val = await showCupertinoModalPopup<PrivateMessageView>(
|
||||
context: context,
|
||||
|
@ -379,7 +380,9 @@ class PrivateMessageTile extends HookWidget {
|
|||
TileAction(
|
||||
delayedLoading: deleteDelayed,
|
||||
icon: deleted.value ? Icons.restore : Icons.delete,
|
||||
tooltip: deleted.value ? 'restore' : 'delete',
|
||||
tooltip: deleted.value
|
||||
? L10n.of(context).restore
|
||||
: L10n.of(context).delete,
|
||||
onPressed: handleDelete,
|
||||
),
|
||||
]
|
||||
|
|
|
@ -7,6 +7,7 @@ import 'package:lemmy_api_client/v2.dart';
|
|||
import 'package:url_launcher/url_launcher.dart' as ul;
|
||||
|
||||
import '../hooks/stores.dart';
|
||||
import '../l10n/l10n.dart';
|
||||
import '../util/extensions/api.dart';
|
||||
import '../util/extensions/spaced.dart';
|
||||
import '../util/goto.dart';
|
||||
|
@ -162,11 +163,11 @@ class InstancePage extends HookWidget {
|
|||
preferredSize: const TabBar(tabs: []).preferredSize,
|
||||
child: Material(
|
||||
color: theme.cardColor,
|
||||
child: const TabBar(
|
||||
child: TabBar(
|
||||
tabs: [
|
||||
Tab(text: 'Posts'),
|
||||
Tab(text: 'Comments'),
|
||||
Tab(text: 'About'),
|
||||
Tab(text: L10n.of(context).posts),
|
||||
Tab(text: L10n.of(context).comments),
|
||||
const Tab(text: 'About'),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
@ -332,7 +333,7 @@ class _AboutTab extends HookWidget {
|
|||
onTap: () => goToBannedUsers(context),
|
||||
),
|
||||
ListTile(
|
||||
title: const Center(child: Text('Modlog')),
|
||||
title: Center(child: Text(L10n.of(context).modlog)),
|
||||
onTap: () => goTo(
|
||||
context,
|
||||
(context) => ModlogPage.forInstance(instanceHost: instanceHost),
|
||||
|
|
|
@ -9,6 +9,7 @@ import '../hooks/delayed_loading.dart';
|
|||
import '../hooks/image_picker.dart';
|
||||
import '../hooks/ref.dart';
|
||||
import '../hooks/stores.dart';
|
||||
import '../l10n/l10n.dart';
|
||||
import '../util/pictrs.dart';
|
||||
import '../widgets/bottom_safe.dart';
|
||||
import '../widgets/radio_picker.dart';
|
||||
|
@ -166,11 +167,11 @@ class _ManageAccount extends HookWidget {
|
|||
actions: [
|
||||
TextButton(
|
||||
onPressed: () => Navigator.of(context).pop(false),
|
||||
child: const Text('no'),
|
||||
child: Text(L10n.of(context).no),
|
||||
),
|
||||
TextButton(
|
||||
onPressed: () => Navigator.of(context).pop(true),
|
||||
child: const Text('yes'),
|
||||
child: Text(L10n.of(context).yes),
|
||||
),
|
||||
],
|
||||
),
|
||||
|
@ -205,7 +206,7 @@ class _ManageAccount extends HookWidget {
|
|||
children: [
|
||||
_ImagePicker(
|
||||
user: user,
|
||||
name: 'Avatar',
|
||||
name: L10n.of(context).avatar,
|
||||
initialUrl: avatar.current,
|
||||
onChange: (value) => avatar.current = value,
|
||||
informAcceptedRef: informAcceptedAvatarRef,
|
||||
|
@ -213,26 +214,26 @@ class _ManageAccount extends HookWidget {
|
|||
const SizedBox(height: 8),
|
||||
_ImagePicker(
|
||||
user: user,
|
||||
name: 'Banner',
|
||||
name: L10n.of(context).banner,
|
||||
initialUrl: banner.current,
|
||||
onChange: (value) => banner.current = value,
|
||||
informAcceptedRef: informAcceptedBannerRef,
|
||||
),
|
||||
const SizedBox(height: 8),
|
||||
Text('Display Name', style: theme.textTheme.headline6),
|
||||
Text(L10n.of(context).display_name, style: theme.textTheme.headline6),
|
||||
TextField(controller: displayNameController),
|
||||
const SizedBox(height: 8),
|
||||
Text('Bio', style: theme.textTheme.headline6),
|
||||
Text(L10n.of(context).bio, style: theme.textTheme.headline6),
|
||||
TextField(
|
||||
controller: bioController,
|
||||
minLines: 4,
|
||||
maxLines: 10,
|
||||
),
|
||||
const SizedBox(height: 8),
|
||||
Text('Email', style: theme.textTheme.headline6),
|
||||
Text(L10n.of(context).email, style: theme.textTheme.headline6),
|
||||
TextField(controller: emailController),
|
||||
const SizedBox(height: 8),
|
||||
Text('Matrix User', style: theme.textTheme.headline6),
|
||||
Text(L10n.of(context).matrix_user, style: theme.textTheme.headline6),
|
||||
TextField(controller: matrixUserController),
|
||||
const SizedBox(height: 8),
|
||||
Text('New password', style: theme.textTheme.headline6),
|
||||
|
@ -258,9 +259,9 @@ class _ManageAccount extends HookWidget {
|
|||
children: [
|
||||
Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: const [
|
||||
Text('Sort type'),
|
||||
Text(
|
||||
children: [
|
||||
Text(L10n.of(context).sort_type),
|
||||
const Text(
|
||||
'This has currently no effect on lemmur',
|
||||
style: TextStyle(fontSize: 10),
|
||||
)
|
||||
|
@ -284,9 +285,9 @@ class _ManageAccount extends HookWidget {
|
|||
children: [
|
||||
Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: const [
|
||||
Text('Type'),
|
||||
Text(
|
||||
children: [
|
||||
Text(L10n.of(context).type),
|
||||
const Text(
|
||||
'This has currently no effect on lemmur',
|
||||
style: TextStyle(fontSize: 10),
|
||||
)
|
||||
|
@ -312,7 +313,7 @@ class _ManageAccount extends HookWidget {
|
|||
CheckboxListTile(
|
||||
value: showNsfw.value,
|
||||
onChanged: (checked) => showNsfw.value = checked,
|
||||
title: const Text('Show NSFW content'),
|
||||
title: Text(L10n.of(context).show_nsfw),
|
||||
subtitle: const Text('This has currently no effect on lemmur'),
|
||||
dense: true,
|
||||
),
|
||||
|
@ -320,7 +321,7 @@ class _ManageAccount extends HookWidget {
|
|||
CheckboxListTile(
|
||||
value: sendNotificationsToEmail.value,
|
||||
onChanged: (checked) => sendNotificationsToEmail.value = checked,
|
||||
title: const Text('Send notifications to Email'),
|
||||
title: Text(L10n.of(context).send_notifications_to_email),
|
||||
dense: true,
|
||||
),
|
||||
const SizedBox(height: 8),
|
||||
|
@ -332,7 +333,7 @@ class _ManageAccount extends HookWidget {
|
|||
height: 20,
|
||||
child: CircularProgressIndicator(),
|
||||
)
|
||||
: const Text('save'),
|
||||
: Text(L10n.of(context).save),
|
||||
),
|
||||
const SizedBox(height: 8),
|
||||
ElevatedButton(
|
||||
|
@ -340,7 +341,7 @@ class _ManageAccount extends HookWidget {
|
|||
style: ElevatedButton.styleFrom(
|
||||
primary: Colors.red,
|
||||
),
|
||||
child: const Text('DELETE ACCOUNT'),
|
||||
child: Text(L10n.of(context).delete_account.toUpperCase()),
|
||||
),
|
||||
const BottomSafe(),
|
||||
],
|
||||
|
|
|
@ -3,6 +3,7 @@ import 'package:flutter/material.dart';
|
|||
import 'package:flutter_hooks/flutter_hooks.dart';
|
||||
|
||||
import '../hooks/stores.dart';
|
||||
import '../l10n/l10n.dart';
|
||||
import '../util/goto.dart';
|
||||
import '../widgets/radio_picker.dart';
|
||||
import '../widgets/user_profile.dart';
|
||||
|
@ -41,7 +42,7 @@ class UserProfileTab extends HookWidget {
|
|||
goTo(context, (_) => AccountsConfigPage());
|
||||
},
|
||||
icon: const Icon(Icons.add),
|
||||
label: const Text('Add account'),
|
||||
label: Text(L10n.of(context).add_account),
|
||||
)
|
||||
],
|
||||
),
|
||||
|
|
|
@ -3,6 +3,7 @@ import 'package:flutter_hooks/flutter_hooks.dart';
|
|||
import 'package:lemmy_api_client/v2.dart';
|
||||
|
||||
import '../hooks/stores.dart';
|
||||
import '../l10n/l10n.dart';
|
||||
import '../widgets/sortable_infinite_list.dart';
|
||||
|
||||
/// Page with saved posts/comments. Fetches such saved data from the default user
|
||||
|
@ -16,11 +17,11 @@ class SavedPage extends HookWidget {
|
|||
length: 2,
|
||||
child: Scaffold(
|
||||
appBar: AppBar(
|
||||
title: const Text('Saved'),
|
||||
bottom: const TabBar(
|
||||
title: Text(L10n.of(context).saved),
|
||||
bottom: TabBar(
|
||||
tabs: [
|
||||
Tab(text: 'Posts'),
|
||||
Tab(text: 'Comments'),
|
||||
Tab(text: L10n.of(context).posts),
|
||||
Tab(text: L10n.of(context).comments),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
|
|
@ -3,6 +3,7 @@ import 'package:flutter_hooks/flutter_hooks.dart';
|
|||
import 'package:lemmy_api_client/v2.dart';
|
||||
|
||||
import '../hooks/stores.dart';
|
||||
import '../l10n/l10n.dart';
|
||||
import '../widgets/comment.dart';
|
||||
import '../widgets/post.dart';
|
||||
import '../widgets/sortable_infinite_list.dart';
|
||||
|
@ -27,13 +28,13 @@ class SearchResultsPage extends HookWidget {
|
|||
child: Scaffold(
|
||||
appBar: AppBar(
|
||||
title: Text('Looking for "$query"'),
|
||||
bottom: const TabBar(
|
||||
bottom: TabBar(
|
||||
isScrollable: true,
|
||||
tabs: [
|
||||
Tab(text: 'Posts'),
|
||||
Tab(text: 'Comments'),
|
||||
Tab(text: 'Users'),
|
||||
Tab(text: 'Communities'),
|
||||
Tab(text: L10n.of(context).posts),
|
||||
Tab(text: L10n.of(context).comments),
|
||||
Tab(text: L10n.of(context).users),
|
||||
Tab(text: L10n.of(context).communities),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
|
|
@ -21,20 +21,20 @@ class SettingsPage extends StatelessWidget {
|
|||
@override
|
||||
Widget build(BuildContext context) => Scaffold(
|
||||
appBar: AppBar(
|
||||
title: const Text('Settings'),
|
||||
title: Text(L10n.of(context).settings),
|
||||
),
|
||||
body: ListView(
|
||||
children: [
|
||||
ListTile(
|
||||
leading: const Icon(Icons.person),
|
||||
title: const Text('Accounts'),
|
||||
title: Text(L10n.of(context).accounts),
|
||||
onTap: () {
|
||||
goTo(context, (_) => AccountsConfigPage());
|
||||
},
|
||||
),
|
||||
ListTile(
|
||||
leading: const Icon(Icons.color_lens),
|
||||
title: const Text('Appearance'),
|
||||
title: Text(L10n.of(context).appearance),
|
||||
onTap: () {
|
||||
goTo(context, (_) => const AppearanceConfigPage());
|
||||
},
|
||||
|
@ -55,7 +55,7 @@ class AppearanceConfigPage extends HookWidget {
|
|||
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
title: const Text('Appearance'),
|
||||
title: Text(L10n.of(context).appearance),
|
||||
),
|
||||
body: ListView(
|
||||
children: [
|
||||
|
@ -79,7 +79,7 @@ class AppearanceConfigPage extends HookWidget {
|
|||
const SizedBox(height: 12),
|
||||
const _SectionHeading('General'),
|
||||
ListTile(
|
||||
title: const Text('Language'),
|
||||
title: Text(L10n.of(context).language),
|
||||
trailing: SizedBox(
|
||||
width: 120,
|
||||
child: RadioPicker<Locale>(
|
||||
|
@ -117,11 +117,11 @@ class AccountsConfigPage extends HookWidget {
|
|||
actions: [
|
||||
TextButton(
|
||||
onPressed: () => Navigator.of(context).pop(false),
|
||||
child: const Text('no'),
|
||||
child: Text(L10n.of(context).no),
|
||||
),
|
||||
TextButton(
|
||||
onPressed: () => Navigator.of(context).pop(true),
|
||||
child: const Text('yes'),
|
||||
child: Text(L10n.of(context).yes),
|
||||
),
|
||||
],
|
||||
),
|
||||
|
@ -141,11 +141,11 @@ class AccountsConfigPage extends HookWidget {
|
|||
actions: [
|
||||
TextButton(
|
||||
onPressed: () => Navigator.of(context).pop(false),
|
||||
child: const Text('no'),
|
||||
child: Text(L10n.of(context).no),
|
||||
),
|
||||
TextButton(
|
||||
onPressed: () => Navigator.of(context).pop(true),
|
||||
child: const Text('yes'),
|
||||
child: Text(L10n.of(context).yes),
|
||||
),
|
||||
],
|
||||
),
|
||||
|
@ -158,7 +158,7 @@ class AccountsConfigPage extends HookWidget {
|
|||
return Scaffold(
|
||||
key: _scaffoldKey,
|
||||
appBar: AppBar(
|
||||
title: const Text('Accounts'),
|
||||
title: Text(L10n.of(context).accounts),
|
||||
),
|
||||
floatingActionButton: SpeedDial(
|
||||
animatedIcon: AnimatedIcons.menu_close, // TODO: change to + => x
|
||||
|
@ -168,7 +168,7 @@ class AccountsConfigPage extends HookWidget {
|
|||
children: [
|
||||
SpeedDialChild(
|
||||
child: const Icon(Icons.person_add),
|
||||
label: 'Add account',
|
||||
label: L10n.of(context).add_account,
|
||||
labelBackgroundColor: theme.canvasColor,
|
||||
onTap: () => showCupertinoModalPopup(
|
||||
context: context,
|
||||
|
@ -178,7 +178,7 @@ class AccountsConfigPage extends HookWidget {
|
|||
SpeedDialChild(
|
||||
child: const Icon(Icons.dns),
|
||||
labelBackgroundColor: theme.canvasColor,
|
||||
label: 'Add instance',
|
||||
label: L10n.of(context).add_instance,
|
||||
onTap: () => showCupertinoModalPopup(
|
||||
context: context, builder: (_) => AddInstancePage()),
|
||||
),
|
||||
|
@ -199,7 +199,7 @@ class AccountsConfigPage extends HookWidget {
|
|||
builder: (_) => AddInstancePage(),
|
||||
),
|
||||
icon: const Icon(Icons.add),
|
||||
label: const Text('Add instance'),
|
||||
label: Text(L10n.of(context).add_instance),
|
||||
),
|
||||
),
|
||||
],
|
||||
|
@ -267,7 +267,7 @@ class AccountsConfigPage extends HookWidget {
|
|||
if (accountsStore.usernamesFor(instance).isEmpty)
|
||||
ListTile(
|
||||
leading: const Icon(Icons.add),
|
||||
title: const Text('Add account'),
|
||||
title: Text(L10n.of(context).add_account),
|
||||
onTap: () {
|
||||
showCupertinoModalPopup(
|
||||
context: context,
|
||||
|
|
|
@ -3,6 +3,7 @@ import 'package:flutter_hooks/flutter_hooks.dart';
|
|||
import 'package:lemmy_api_client/v2.dart';
|
||||
|
||||
import '../hooks/stores.dart';
|
||||
import '../l10n/l10n.dart';
|
||||
import '../util/extensions/api.dart';
|
||||
import '../widgets/markdown_mode_icon.dart';
|
||||
import '../widgets/markdown_text.dart';
|
||||
|
@ -41,7 +42,7 @@ class WriteMessagePage extends HookWidget {
|
|||
useTextEditingController(text: privateMessage?.content);
|
||||
final loading = useState(false);
|
||||
|
||||
final submit = _isEdit ? 'save' : 'send';
|
||||
final submit = _isEdit ? L10n.of(context).save : 'send';
|
||||
final title = _isEdit ? 'Edit message' : 'Send message';
|
||||
|
||||
handleSubmit() async {
|
||||
|
|
|
@ -10,6 +10,7 @@ import '../comment_tree.dart';
|
|||
import '../hooks/delayed_loading.dart';
|
||||
import '../hooks/logged_in_action.dart';
|
||||
import '../hooks/stores.dart';
|
||||
import '../l10n/l10n.dart';
|
||||
import '../util/delayed_action.dart';
|
||||
import '../util/extensions/api.dart';
|
||||
import '../util/extensions/datetime.dart';
|
||||
|
@ -292,14 +293,14 @@ class CommentWidget extends HookWidget {
|
|||
icon: Icons.more_horiz,
|
||||
onPressed: () => _openMoreMenu(context),
|
||||
delayedLoading: delayedDeletion,
|
||||
tooltip: 'more',
|
||||
tooltip: L10n.of(context).more,
|
||||
),
|
||||
_SaveComment(commentTree.comment),
|
||||
if (!isDeleted.value && !comment.comment.removed)
|
||||
TileAction(
|
||||
icon: Icons.reply,
|
||||
onPressed: loggedInAction((_) => reply()),
|
||||
tooltip: 'reply',
|
||||
tooltip: L10n.of(context).reply,
|
||||
),
|
||||
TileAction(
|
||||
icon: Icons.arrow_upward,
|
||||
|
@ -364,7 +365,10 @@ class CommentWidget extends HookWidget {
|
|||
),
|
||||
if (isOP) _CommentTag('OP', theme.accentColor),
|
||||
if (comment.creator.admin)
|
||||
_CommentTag('ADMIN', theme.accentColor),
|
||||
_CommentTag(
|
||||
L10n.of(context).admin.toUpperCase(),
|
||||
theme.accentColor,
|
||||
),
|
||||
if (comment.creator.banned)
|
||||
const _CommentTag('BANNED', Colors.red),
|
||||
if (comment.creatorBannedFromCommunity)
|
||||
|
@ -465,7 +469,9 @@ class _MarkAsRead extends HookWidget {
|
|||
onPressed:
|
||||
userMentionId != null ? handleMarkMentionAsSeen : handleMarkAsSeen,
|
||||
iconColor: isRead.value ? Theme.of(context).accentColor : null,
|
||||
tooltip: 'mark as ${isRead.value ? 'un' : ''}read',
|
||||
tooltip: isRead.value
|
||||
? L10n.of(context).mark_as_unread
|
||||
: L10n.of(context).mark_as_read,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,6 +4,7 @@ import 'package:flutter_hooks/flutter_hooks.dart';
|
|||
import 'package:lemmy_api_client/v2.dart';
|
||||
|
||||
import '../comment_tree.dart';
|
||||
import '../l10n/l10n.dart';
|
||||
import 'bottom_modal.dart';
|
||||
import 'bottom_safe.dart';
|
||||
import 'comment.dart';
|
||||
|
@ -16,11 +17,11 @@ class CommentSection extends HookWidget {
|
|||
final CommentSortType sortType;
|
||||
|
||||
static const sortPairs = {
|
||||
CommentSortType.hot: [Icons.whatshot, 'Hot'],
|
||||
CommentSortType.new_: [Icons.new_releases, 'New'],
|
||||
CommentSortType.old: [Icons.calendar_today, 'Old'],
|
||||
CommentSortType.top: [Icons.trending_up, 'Top'],
|
||||
CommentSortType.chat: [Icons.chat, 'Chat'],
|
||||
CommentSortType.hot: [Icons.whatshot, 'hot'],
|
||||
CommentSortType.new_: [Icons.new_releases, 'new_'],
|
||||
CommentSortType.old: [Icons.calendar_today, 'old'],
|
||||
CommentSortType.top: [Icons.trending_up, 'top'],
|
||||
CommentSortType.chat: [Icons.chat, 'chat'],
|
||||
};
|
||||
|
||||
CommentSection(
|
||||
|
@ -60,7 +61,7 @@ class CommentSection extends HookWidget {
|
|||
for (final e in sortPairs.entries)
|
||||
ListTile(
|
||||
leading: Icon(e.value[0] as IconData),
|
||||
title: Text(e.value[1] as String),
|
||||
title: Text((e.value[1] as String).tr(context)),
|
||||
trailing: sorting.value == e.key
|
||||
? const Icon(Icons.check)
|
||||
: null,
|
||||
|
@ -75,7 +76,7 @@ class CommentSection extends HookWidget {
|
|||
},
|
||||
child: Row(
|
||||
children: [
|
||||
Text(sortPairs[sorting.value][1] as String),
|
||||
Text((sortPairs[sorting.value][1] as String).tr(context)),
|
||||
const Icon(Icons.arrow_drop_down),
|
||||
],
|
||||
),
|
||||
|
|
|
@ -10,6 +10,7 @@ import 'package:url_launcher/url_launcher.dart' as ul;
|
|||
|
||||
import '../hooks/delayed_loading.dart';
|
||||
import '../hooks/logged_in_action.dart';
|
||||
import '../l10n/l10n.dart';
|
||||
import '../pages/full_post.dart';
|
||||
import '../url_launcher.dart';
|
||||
import '../util/cleanup_url.dart';
|
||||
|
@ -180,10 +181,11 @@ class PostWidget extends HookWidget {
|
|||
fontSize: 13,
|
||||
color: theme.textTheme.bodyText1.color),
|
||||
children: [
|
||||
const TextSpan(
|
||||
text: 'by',
|
||||
style:
|
||||
TextStyle(fontWeight: FontWeight.w300)),
|
||||
TextSpan(
|
||||
text: L10n.of(context).by,
|
||||
style: const TextStyle(
|
||||
fontWeight: FontWeight.w300),
|
||||
),
|
||||
TextSpan(
|
||||
text: ' ${post.creator.originDisplayName}',
|
||||
style: const TextStyle(
|
||||
|
@ -203,9 +205,10 @@ class PostWidget extends HookWidget {
|
|||
const TextSpan(text: ' · 📌'),
|
||||
if (post.post.nsfw) const TextSpan(text: ' · '),
|
||||
if (post.post.nsfw)
|
||||
const TextSpan(
|
||||
text: 'NSFW',
|
||||
style: TextStyle(color: Colors.red)),
|
||||
TextSpan(
|
||||
text: L10n.of(context).nsfw,
|
||||
style:
|
||||
const TextStyle(color: Colors.red)),
|
||||
if (urlDomain != null)
|
||||
TextSpan(text: ' · $urlDomain'),
|
||||
if (post.post.removed)
|
||||
|
|
|
@ -6,6 +6,7 @@ import 'package:lemmy_api_client/v2.dart';
|
|||
|
||||
import '../hooks/memo_future.dart';
|
||||
import '../hooks/stores.dart';
|
||||
import '../l10n/l10n.dart';
|
||||
import '../pages/manage_account.dart';
|
||||
import '../util/extensions/api.dart';
|
||||
import '../util/extensions/datetime.dart';
|
||||
|
@ -81,11 +82,11 @@ class UserProfile extends HookWidget {
|
|||
preferredSize: const TabBar(tabs: []).preferredSize,
|
||||
child: Material(
|
||||
color: theme.cardColor,
|
||||
child: const TabBar(
|
||||
child: TabBar(
|
||||
tabs: [
|
||||
Tab(text: 'Posts'),
|
||||
Tab(text: 'Comments'),
|
||||
Tab(text: 'About'),
|
||||
Tab(text: L10n.of(context).posts),
|
||||
Tab(text: L10n.of(context).comments),
|
||||
const Tab(text: 'About'),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
|
|
@ -4,6 +4,7 @@ import 'package:lemmy_api_client/v2.dart';
|
|||
|
||||
import '../hooks/delayed_loading.dart';
|
||||
import '../hooks/stores.dart';
|
||||
import '../l10n/l10n.dart';
|
||||
import 'markdown_mode_icon.dart';
|
||||
import 'markdown_text.dart';
|
||||
|
||||
|
@ -119,7 +120,7 @@ class WriteComment extends HookWidget {
|
|||
onPressed: delayed.pending ? () {} : handleSubmit,
|
||||
child: delayed.loading
|
||||
? const CircularProgressIndicator()
|
||||
: const Text('post'),
|
||||
: Text(L10n.of(context).post),
|
||||
)
|
||||
],
|
||||
),
|
||||
|
|
Loading…
Reference in New Issue