Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

scrubbed through app widgets and added localization text #493

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
97 changes: 92 additions & 5 deletions assets/l10n/intl_en.arb
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@
"@posts": {},
"comments": "Comments",
"@comments": {},
"comment": "Comment",
"@comment": {},
"modlog": "Modlog",
"@modlog": {},
"modlog_reason": "Reason",
Expand Down Expand Up @@ -100,6 +102,7 @@
"@all": {},
"replies": "Replies",
"@replies": {},

"mentions": "Mentions",
"@mentions": {},
"from": "from",
Expand All @@ -112,6 +115,8 @@
"@more": {},
"mark_as_read": "mark as read",
"@mark_as_read": {},
"mark_all_as_read": "mark all as read",
"@mark_all_as_read": {},
"mark_as_unread": "mark as unread",
"@mark_as_unread": {},
"reply": "reply",
Expand Down Expand Up @@ -162,6 +167,10 @@
"@hide_nsfw_explanation": {},
"show_nsfw": "Show NSFW content",
"@show_nsfw": {},
"show_all": "show all",
"@show_all": {},
"show_only_unread": "show only unread",
"@show_only_unread": {},
"send_notifications_to_email": "Send notifications to Email",
"@send_notifications_to_email": {},
"remove_account": "Remove account",
Expand Down Expand Up @@ -236,8 +245,10 @@
"@not_an_admin": {},
"couldnt_find_post": "Couldn't find post.",
"@couldnt_find_post": {},
"not_logged_in": "Not logged in.",
"@not_logged_in": {},
"not_logged_in": "Not logged in",
"@not_logged_in": {
"description": "a message to the user informing them they are not logged into a Lemmy instance"
},
"site_ban": "You have been banned from the site",
"@site_ban": {},
"community_ban": "You have been banned from this community.",
Expand All @@ -256,6 +267,22 @@
"@couldnt_update_comment": {},
"no_comment_edit_allowed": "Not allowed to edit comment.",
"@no_comment_edit_allowed": {},
"no_comments_yet": "no comments yet",
"@no_comments_yet": {
"description": "informers the user that the post has zero comments in-place of comment thread"
},
"no_replies": "no replies",
"@no_replies": {
"description": "informers the user that the post has no replies yet"
},
"no_mentions": "no mentions",
"@no_mentions": {
"description": "informers the user that the post has no mentions yet"
},
"no_messages": "no messages",
"@no_messages": {
"description": "informers the user that the post has no messages yet"
},
"couldnt_save_comment": "Couldn't save comment.",
"@couldnt_save_comment": {},
"couldnt_get_comments": "Couldn't get comments.",
Expand Down Expand Up @@ -446,6 +473,8 @@
},
"block": "Block",
"@block": {},
"blocked": "Blocked",
"@blocked": {},
"block_user": "Block user",
"@block_user": {},
"no_users_blocked": "No users blocked",
Expand All @@ -456,6 +485,8 @@
"@no_communities_blocked": {},
"unblock": "Unblock",
"@unblock": {},
"unblocked": "Unblocked",
"@unblocked": {},
"unblock_user": "Unblock user",
"@unblock_user": {},
"unblock_community": "Unblock community",
Expand Down Expand Up @@ -538,10 +569,32 @@
"@nerd_stuff": {},
"open_in_browser": "Open in browser",
"@open_in_browser": {},
"share": "share",
"@share": {
"description": "tooltip for user for sharing"
},
"share_text": "Share text",
"@share_text": {},
"@share_text": {
"description": "tooltip for user to share text"

},
"share_url": "Share URL",
"@share_url": {},
"@share_url": {
"description": "tooltip for user to share a URL"

},
"share_link": "Share Link",
"@share_link": {
"description": "tooltip for user to share a link"
},
"share_image": "Share Image",
"@share_image": {
"description": "tooltip on button/selector for user to share an image"
},
"share_file": "Share File",
"@share_file": {
"description": "tooltip on button/selector for user to share a file or image"
},
"translate": "Translate",
"@translate": {},
"make_text_selectable": "Make text selectable",
Expand Down Expand Up @@ -676,6 +729,10 @@
"@cancel": {
"description": "Cancel button on popup"
},
"tap_back_again_to_leave": "tap back again to leave",
"@tap_back_again_to_leave": {
"description": "inform the user that another press of the 'back' button will close the app"
},
"editor_add_link_label": "label",
"@editor_add_link_label": {
"description": "palceholder for link label on an Add link popup in markdown editor"
Expand All @@ -688,22 +745,52 @@
"@instance_error": {},
"instance_record_notfound": "Hmm... it seems like your instance couldn't find what you were looking for.",
"@instance_record_notfound": {},
"looking_for": "Looking for {item}",
"@looking_for": {
"description": "used in search bar to remind user what they searched for",
"placeholders" : {
"item": {
"type": "String",
"example": "..."
}
}
},
"try_again": "Try Again",
"@try_again": {},
"kbin_instances_not_supported": "Please note that kbin instances are not supported at present.",
"@kbin_instances_not_supported": {},
"no_instances_added": "You do not have any instances added",
"@no_instances_added": {},
"pick_a_photo": "Pick a photo",
"@pick_a_photo": {},
"use_this_image": "Use this image",
"@use_this_image": {},
"photo_picker_explanation": "Pick an image, then adjust the crop box to the right shape.\n\nYou can then drag the image until it's in the right place. \n\nResizing the crop box will zoom the selection in and out.",
"@photo_picker_explanation": {},
"edit_image": "Edit Image",
"@edit_image": {
"description": "notes to the user that the image can me edited"
},
"accounts_explanation": "The first instance on this screen will be treated as your default in other screens, and the marked account will be the default on that instance.\n\nPress and hold on an account to make it your default on that instance.\n\nPress and hold an instance or account to remove it from this app. You can add it back later. You may lose some local settings but your bookmarks, subscriptions etc will still be held on your instance.",
"@accounts_explanation": {},
"comment_tag_op": "OP",
"@comment_tag_op": {},
"comment_tag_you": "YOU",
"@comment_tag_you": {},
"code_of_conduct_clickthrough": "By accessing the Lemmy network using Liftoff! you agree to adhere to our Code of Conduct",
"@code_of_conduct_clickthrough": {}
"@code_of_conduct_clickthrough": {},
"join": "{tense, select, past{joined} present{join} future{will join} other{join}}",
"@join": {
"description": "the verb describing the act of adding a lemmy community to the user's subscriptions",
"placeholder" : {
"tense": {
"type": "String"
}
}
},
"download": "download",
"@download": {},
"create_post": "Create Post",
"@create_post": {}

}
5 changes: 3 additions & 2 deletions lib/pages/communities_tab.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import '../hooks/delayed_loading.dart';
import '../hooks/logged_in_action.dart';
import '../hooks/refreshable.dart';
import '../hooks/stores.dart';
import '../l10n/gen/l10n.dart';
import '../stores/accounts_store.dart';
import '../util/extensions/api.dart';
import '../util/extensions/iterators.dart';
Expand Down Expand Up @@ -164,8 +165,8 @@ class CommunitiesTab extends HookWidget {
body: PullToRefresh(
onRefresh: refresh,
child: amountOfDisplayInstances == 0
? const Center(
child: Text('You are not logged in to any instances'),
? Center(
child: Text(L10n.of(context).not_logged_in),
)
: ListView(
children: [
Expand Down
28 changes: 16 additions & 12 deletions lib/pages/community/community_about_tab.dart
Original file line number Diff line number Diff line change
Expand Up @@ -53,26 +53,30 @@ class CommmunityAboutTab extends StatelessWidget {
label: Text(L10n.of(context)
.number_of_users_online(onlineUsers ?? 0))),
Chip(
label:
Text('${community.counts.usersActiveDay} users / day')),
label: Text('${L10n.of(context)
.number_of_users(community.counts.usersActiveDay)}'
' / ${L10n.of(context).day}')),
Chip(
label: Text(
'${community.counts.usersActiveWeek} users / week')),
label: Text('${L10n.of(context)
.number_of_users(community.counts.usersActiveWeek)}'
' / ${L10n.of(context).week}')),
Chip(
label: Text(
'${community.counts.usersActiveMonth} users / month')),
label: Text('${L10n.of(context)
.number_of_users(community.counts.usersActiveMonth)}'
' / ${L10n.of(context).month}')),
Chip(
label: Text(
'${community.counts.usersActiveHalfYear} users / 6 months')),
label: Text('${L10n.of(context)
.number_of_users(community.counts.usersActiveHalfYear)}'
' / 6 ${L10n.of(context).month}s')),
Chip(
label: Text(L10n.of(context)
.number_of_subscribers(community.counts.subscribers))),
Chip(
label: Text(
'${community.counts.posts} post${community.counts.posts == 1 ? '' : 's'}')),
label: Text(L10n.of(context)
.number_of_posts(community.counts.posts ))),
Chip(
label: Text(
'${community.counts.comments} comment${community.counts.comments == 1 ? '' : 's'}')),
label: Text(L10n.of(context)
.number_of_comments(community.counts.comments, 0))), // TODO why does this need 2 args???
].spaced(8),
),
),
Expand Down
2 changes: 1 addition & 1 deletion lib/pages/create_post/create_post.dart
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ class CreatePostPage extends HookWidget {
},
child: Scaffold(
appBar: AppBar(
title: const Text('Create post'),
title: Text(L10n.of(context).create_post),
actions: [
ObserverBuilder<CreatePostStore>(
builder: (context, store) => IconButton(
Expand Down
9 changes: 4 additions & 5 deletions lib/pages/full_post/comment_section.dart
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,10 @@ class CommentSection {
// sorting menu goes here
if (postComments != null && postComments.isEmpty && newComments.isEmpty)
_centeredWithConstraints(
child: const Padding(
padding: EdgeInsets.symmetric(vertical: 50),
child: Text(
'no comments yet',
style: TextStyle(fontStyle: FontStyle.italic),
child: Padding(
padding: const EdgeInsets.symmetric(vertical: 50),
child: Text(L10n.of(context).no_comments_yet,
style: const TextStyle(fontStyle: FontStyle.italic),
),
),
)
Expand Down
3 changes: 2 additions & 1 deletion lib/pages/full_post/full_post.dart
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@ class FullPostPage extends HookWidget {
asyncStore: fullPostStore.communityBlockingState,
successMessageBuilder: (context, data) {
final name = data.communityView.community.originPreferredName;
return '${data.blocked ? 'Blocked' : 'Unblocked'} $name';
return '${data.blocked ?
L10n.of(context).blocked : L10n.of(context).unblocked} $name';
},
),
],
Expand Down
6 changes: 4 additions & 2 deletions lib/pages/home_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@ import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_hooks/flutter_hooks.dart';

import '../../l10n/l10n.dart';
import '../app_link_handler.dart';
import '../hooks/stores.dart';
import '../util/extensions/brightness.dart';

import 'communities_tab.dart';
import 'create_post/create_post_fab.dart';
import 'home_tab.dart';
Expand Down Expand Up @@ -73,8 +75,8 @@ class HomePage extends HookWidget {
// show snackbar warning
snackBarShowing.value = true;
ScaffoldMessenger.of(context)
.showSnackBar(const SnackBar(
content: Text('Tap back again to leave'),
.showSnackBar(SnackBar(
content: Text(L10n.of(context).tap_back_again_to_leave),
))
.closed
.then((SnackBarClosedReason reason) =>
Expand Down
10 changes: 5 additions & 5 deletions lib/pages/home_tab.dart
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ class HomeTab extends HookWidget {

final everythingChoices = [
const ListTile(
title: Text('EVERYTHING'),
title: Text('EVERYTHING'), // TODO localize this string
dense: true,
contentPadding: EdgeInsets.zero,
visualDensity:
Expand Down Expand Up @@ -227,7 +227,7 @@ class HomeTab extends HookWidget {
body: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Center(child: Text('there needs to be at least one instance')),
Center(child: Text('there needs to be at least one instance')), // TODO localize this string
],
),
);
Expand Down Expand Up @@ -306,21 +306,21 @@ class HomeTab extends HookWidget {
value: 0,
child: ListTile(
leading: Icon(Icons.keyboard_double_arrow_up),
title: Text('Back to top'),
title: Text('Back to top'), // TODO localize this string
),
),
const PopupMenuItem<int>(
value: 1,
child: ListTile(
leading: Icon(Icons.refresh),
title: Text('Refresh'),
title: Text('Refresh'), // TODO localize this string
),
),
const PopupMenuItem<int>(
value: 2,
child: ListTile(
leading: Icon(Icons.settings),
title: Text('Settings'),
title: Text('Settings'), // TODO localize this string
),
),
// PopupMenuItem<int>(
Expand Down
Loading