Skip to content

Commit 7397b3e

Browse files
committed
add missing translation strings
1 parent 6c96469 commit 7397b3e

File tree

17 files changed

+141
-57
lines changed

17 files changed

+141
-57
lines changed

assets/translations/en.json

Lines changed: 34 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
"cancel": "Cancel",
77
"login": "Login",
88
"bookmarks": "Bookmarks",
9+
"my_waves": "My Waves",
10+
"explore": "Explore",
911
"dark_mode": "Dark Mode",
1012
"light_mode": "Light Mode",
1113
"settings": "Settings",
@@ -77,5 +79,36 @@
7779
"tip_active_key_required": "Tipping requires an active private key. Choose how you'd like to sign this tip.",
7880
"tip_active_key_instructions": "Enter the active private key for @{} to send the tip.",
7981
"select_tip_amount": "Select amount",
80-
"select_token": "Select token"
82+
"select_token": "Select token",
83+
"tags": "Tags",
84+
"users": "Users",
85+
"hashtags": "Hashtags",
86+
"error": "Error",
87+
"no_data_found": "No data found",
88+
"sign_up": "Sign up",
89+
"dont_have_an_account": "Don't have an account?",
90+
"privatekey_login": "PrivateKey Login",
91+
"posting_private_key": "posting private key",
92+
"post": "Post",
93+
"reply_to_user": "Reply to {}",
94+
"whats_happening": "What's happening?",
95+
"reply_engage_exchange_ideas": "Reply, engage, exchange ideas",
96+
"thread_type_ecency": "Waves",
97+
"thread_type_peakd": "Snaps",
98+
"thread_type_liketu": "Moments",
99+
"thread_type_leo": "Threads",
100+
"thread_type_all": "All",
101+
"search": "Search",
102+
"search_users_or_hashtags": "Search users or hashtags",
103+
"type_to_search_for_users": "Type to search for users",
104+
"unable_to_load_users": "Unable to load users. Please try again.",
105+
"no_users_found": "No users found",
106+
"type_to_search_for_hashtags": "Type to search for hashtags",
107+
"unable_to_load_hashtags": "Unable to load hashtags. Please try again.",
108+
"no_hashtags_found": "No hashtags found",
109+
"load_new_content": "Load new content",
110+
"no_replies_found": "No replies found",
111+
"no_content_found": "No content found",
112+
"no_bookmarks_found": "No bookmarks found",
113+
"version_info": "Version {} ({})"
81114
}

lib/core/common/widgets/drawer/drawer_menu.dart

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,14 +63,14 @@ class DrawerMenu extends StatelessWidget {
6363
},
6464
);
6565
},
66-
text: 'My Waves',
66+
text: LocaleText.myWaves,
6767
icon: Icons.person),
6868
DrawerTile(
6969
onTap: () {
7070
Navigator.pop(context);
7171
context.platformPushNamed(Routes.exploreView);
7272
},
73-
text: 'Explore',
73+
text: LocaleText.explore,
7474
icon: Icons.explore),
7575
DrawerTile(
7676
onTap: () {
@@ -84,7 +84,7 @@ class DrawerMenu extends StatelessWidget {
8484
context
8585
.popAndPlatformPushNamed(Routes.settingsView);
8686
},
87-
text: "Settings",
87+
text: LocaleText.settings,
8888
icon: Icons.settings),
8989
if (isLoggedIn)
9090
DrawerTile(
@@ -118,7 +118,7 @@ class DrawerMenu extends StatelessWidget {
118118
final buildNumber = packageInfo.buildNumber;
119119
final theme = Theme.of(context);
120120
return Text(
121-
'Version $version ($buildNumber)',
121+
LocaleText.versionInfo(version, buildNumber),
122122
style: theme.textTheme.bodySmall?.copyWith(
123123
color: theme.hintColor,
124124
),

lib/core/locales/locale_text.dart

Lines changed: 40 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ class LocaleText {
1212
static String get cancel => "cancel".tr();
1313
static String get login => "login".tr();
1414
static String get bookmarks => "bookmarks".tr();
15+
static String get myWaves => "my_waves".tr();
16+
static String get explore => "explore".tr();
1517
static String get darkMode => "dark_mode".tr();
1618
static String get lightMode => "light_mode".tr();
1719
static String get settings => "settings".tr();
@@ -94,5 +96,42 @@ class LocaleText {
9496
static String get pollRevote => "poll_revote".tr();
9597
static String get theAccountDoesntExist => "the_account_doesnt_exist".tr();
9698

97-
99+
static String get tags => "tags".tr();
100+
static String get users => "users".tr();
101+
static String get hashtags => "hashtags".tr();
102+
static String get error => "error".tr();
103+
static String get noDataFound => "no_data_found".tr();
104+
static String get signUp => "sign_up".tr();
105+
static String get dontHaveAnAccount => "dont_have_an_account".tr();
106+
static String get privateKeyLogin => "privatekey_login".tr();
107+
static String get postingPrivateKey => "posting_private_key".tr();
108+
static String get post => "post".tr();
109+
static String replyToUser(String user) => "reply_to_user".tr(args: [user]);
110+
static String get whatsHappening => "whats_happening".tr();
111+
static String get replyEngageExchangeIdeas =>
112+
"reply_engage_exchange_ideas".tr();
113+
static String get threadTypeEcency => "thread_type_ecency".tr();
114+
static String get threadTypePeakd => "thread_type_peakd".tr();
115+
static String get threadTypeLiketu => "thread_type_liketu".tr();
116+
static String get threadTypeLeo => "thread_type_leo".tr();
117+
static String get threadTypeAll => "thread_type_all".tr();
118+
static String get search => "search".tr();
119+
static String get searchUsersOrHashtags =>
120+
"search_users_or_hashtags".tr();
121+
static String get typeToSearchForUsers =>
122+
"type_to_search_for_users".tr();
123+
static String get unableToLoadUsers =>
124+
"unable_to_load_users".tr();
125+
static String get noUsersFound => "no_users_found".tr();
126+
static String get typeToSearchForHashtags =>
127+
"type_to_search_for_hashtags".tr();
128+
static String get unableToLoadHashtags =>
129+
"unable_to_load_hashtags".tr();
130+
static String get noHashtagsFound => "no_hashtags_found".tr();
131+
static String get loadNewContent => "load_new_content".tr();
132+
static String get noRepliesFound => "no_replies_found".tr();
133+
static String get noContentFound => "no_content_found".tr();
134+
static String get noBookmarksFound => "no_bookmarks_found".tr();
135+
static String versionInfo(String version, String buildNumber) =>
136+
"version_info".tr(args: [version, buildNumber]);
98137
}

lib/core/utilities/generics/classes/thread.dart

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import 'package:waves/core/locales/locale_text.dart';
12
import 'package:waves/core/utilities/enum.dart';
23
import 'package:waves/features/threads/models/thread_feeds/reported/thread_info_model.dart';
34
import 'package:waves/features/threads/models/thread_feeds/thread_feed_model.dart';
@@ -82,15 +83,15 @@ class Thread {
8283
static String gethreadName({required ThreadFeedType type}) {
8384
switch (type) {
8485
case ThreadFeedType.ecency:
85-
return "Waves";
86+
return LocaleText.threadTypeEcency;
8687
case ThreadFeedType.peakd:
87-
return "Snaps";
88+
return LocaleText.threadTypePeakd;
8889
case ThreadFeedType.liketu:
89-
return "Moments";
90+
return LocaleText.threadTypeLiketu;
9091
case ThreadFeedType.leo:
91-
return "Threads";
92+
return LocaleText.threadTypeLeo;
9293
case ThreadFeedType.all:
93-
return "All";
94+
return LocaleText.threadTypeAll;
9495
}
9596
}
9697

lib/features/auth/presentation/view/auth_view.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ class AuthView extends StatelessWidget {
6161
mainAxisSize: MainAxisSize.min,
6262
crossAxisAlignment: CrossAxisAlignment.stretch,
6363
children: [
64-
const Center(child: Text("Don't have an account?")),
64+
Center(child: Text(LocaleText.dontHaveAnAccount)),
6565
const Gap(10),
6666
signUpButton(theme),
6767
],
@@ -87,7 +87,7 @@ class AuthView extends StatelessWidget {
8787
surfaceTintColor: theme.primaryColorLight,
8888
backgroundColor: theme.primaryColor),
8989
child: Text(
90-
"Sign up",
90+
LocaleText.signUp,
9191
style: theme.textTheme.bodyMedium,
9292
),
9393
),

lib/features/auth/presentation/view/posting_key_auth_view.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ class _PostingKeyAuthViewState extends State<PostingKeyAuthView> {
3333
Widget build(BuildContext context) {
3434
return Scaffold(
3535
appBar: AppBar(
36-
title: const Text("PrivateKey Login"),
36+
title: Text(LocaleText.privateKeyLogin),
3737
),
3838
body: SafeArea(
3939
child: Padding(
@@ -47,7 +47,7 @@ class _PostingKeyAuthViewState extends State<PostingKeyAuthView> {
4747
textEditingController: accountNameController),
4848
const Gap(15),
4949
AuthTextField(
50-
hintText: "posting private key",
50+
hintText: LocaleText.postingPrivateKey,
5151
isPassword: true,
5252
leading: const Padding(
5353
padding: EdgeInsets.only(left: 8.0),
@@ -58,7 +58,7 @@ class _PostingKeyAuthViewState extends State<PostingKeyAuthView> {
5858
AuthButton(
5959
authType: AuthType.postingKey,
6060
onTap: onPostingLoginTap,
61-
label: "Login"),
61+
label: LocaleText.login),
6262
],
6363
),
6464
),

lib/features/bookmarks/views/thread_bookmark/bookmark_view.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import 'package:flutter/material.dart';
2+
import 'package:waves/core/locales/locale_text.dart';
23
import 'package:waves/features/bookmarks/views/thread_bookmark/thread_bookmark_widget.dart';
34

45
class BookmarksView extends StatelessWidget {
@@ -8,7 +9,7 @@ class BookmarksView extends StatelessWidget {
89
Widget build(BuildContext context) {
910
return Scaffold(
1011
appBar: AppBar(
11-
title: const Text("Bookmarks"),
12+
title: Text(LocaleText.bookmarks),
1213
),
1314
body: const SafeArea(child: ThreadBookmarkWidget()),
1415
);

lib/features/bookmarks/views/thread_bookmark/thread_bookmark_widget.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import 'package:flutter/material.dart';
22
import 'package:waves/core/common/widgets/empty_state.dart';
33
import 'package:waves/core/common/widgets/images/user_profile_image.dart';
44
import 'package:waves/core/common/widgets/loading_state.dart';
5+
import 'package:waves/core/locales/locale_text.dart';
56
import 'package:waves/core/providers/bookmark_provider.dart';
67
import 'package:waves/core/utilities/constants/ui_constants.dart';
78
import 'package:waves/core/utilities/enum.dart';
@@ -36,7 +37,7 @@ class ThreadBookmarkWidget extends StatelessWidget {
3637
);
3738
});
3839
} else {
39-
return const Emptystate(text: "No bookmarks found");
40+
return Emptystate(text: LocaleText.noBookmarksFound);
4041
}
4142
} else {
4243
return const LoadingState();

lib/features/explore/presentation/tag_feed/view/tag_feed_view.dart

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import 'package:flutter/material.dart';
22
import 'package:provider/provider.dart';
3+
import 'package:waves/core/locales/locale_text.dart';
34
import 'package:waves/core/utilities/enum.dart';
45
import 'package:waves/features/explore/presentation/waves/controller/waves_feed_controller.dart';
56
import 'package:waves/features/explore/presentation/widgets/waves_list_view.dart';
@@ -39,9 +40,9 @@ class TagFeedView extends StatelessWidget {
3940
} else if (state == ViewState.data) {
4041
return const WavesListView();
4142
} else if (state == ViewState.empty) {
42-
return const Center(child: Text('No Data found'));
43+
return Center(child: Text(LocaleText.noDataFound));
4344
} else {
44-
return const Center(child: Text('Error'));
45+
return Center(child: Text(LocaleText.error));
4546
}
4647
},
4748
),

lib/features/explore/presentation/view/explore_view.dart

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import 'package:flutter/material.dart';
22
import 'package:provider/provider.dart';
33
import 'package:waves/core/common/extensions/platform_navigation.dart';
44
import 'package:waves/core/common/widgets/images/user_profile_image.dart';
5+
import 'package:waves/core/locales/locale_text.dart';
56
import 'package:waves/core/routes/route_keys.dart';
67
import 'package:waves/core/routes/routes.dart';
78
import 'package:waves/core/utilities/enum.dart';
@@ -27,10 +28,10 @@ class ExploreView extends StatelessWidget {
2728
value: controller.threadType,
2829
onChanged: controller.onChangeThreadType,
2930
),
30-
bottom: const TabBar(
31+
bottom: TabBar(
3132
tabs: [
32-
Tab(text: 'Tags'),
33-
Tab(text: 'Users'),
33+
Tab(text: LocaleText.tags),
34+
Tab(text: LocaleText.users),
3435
],
3536
),
3637
),
@@ -84,7 +85,7 @@ class _TagsTab extends StatelessWidget {
8485
},
8586
);
8687
} else {
87-
return const Center(child: Text('Error'));
88+
return Center(child: Text(LocaleText.error));
8889
}
8990
},
9091
),
@@ -129,7 +130,7 @@ class _UsersTab extends StatelessWidget {
129130
},
130131
);
131132
} else {
132-
return const Center(child: Text('Error'));
133+
return Center(child: Text(LocaleText.error));
133134
}
134135
},
135136
),

0 commit comments

Comments
 (0)