Skip to content

Commit e3a97b0

Browse files
committed
Added translations for profile page
1 parent 1c1fa22 commit e3a97b0

File tree

5 files changed

+77
-14
lines changed

5 files changed

+77
-14
lines changed

lib/app/modules/profile/views/deleteprofiledialog.dart

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import 'package:get/get.dart';
33
import 'package:taskwarrior/app/modules/splash/controllers/splash_controller.dart';
44
import 'package:taskwarrior/app/utils/constants/taskwarrior_colors.dart';
55
import 'package:taskwarrior/app/utils/constants/utilites.dart';
6+
import 'package:taskwarrior/app/utils/language/sentence_manager.dart';
67
import 'package:taskwarrior/app/utils/theme/app_settings.dart';
78

89
class DeleteProfileDialog extends StatelessWidget {
@@ -23,7 +24,10 @@ class DeleteProfileDialog extends StatelessWidget {
2324
child: Utils.showAlertDialog(
2425
scrollable: true,
2526
title: Text(
26-
'Delete Profile?',
27+
SentenceManager(
28+
currentLanguage: AppSettings.selectedLanguage)
29+
.sentences
30+
.profilePageDeleteProfile,
2731
style: TextStyle(
2832
color: AppSettings.isDarkMode
2933
? TaskWarriorColors.white

lib/app/modules/profile/views/manageprofile.dart

Lines changed: 39 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import 'package:flutter/material.dart';
22
import 'package:google_fonts/google_fonts.dart';
33
import 'package:taskwarrior/app/utils/constants/taskwarrior_colors.dart';
44
import 'package:taskwarrior/app/utils/constants/taskwarrior_fonts.dart';
5+
import 'package:taskwarrior/app/utils/language/sentence_manager.dart';
56
import 'package:taskwarrior/app/utils/theme/app_settings.dart';
67

78
import 'package:tuple/tuple.dart';
@@ -25,11 +26,41 @@ class ManageProfile extends StatelessWidget {
2526
@override
2627
Widget build(BuildContext context) {
2728
var triples = [
28-
Tuple3(Icons.edit, 'Rename Alias', rename),
29-
Tuple3(Icons.link, 'Configure Taskserver', configure),
30-
Tuple3(Icons.upload, 'Export tasks', export),
31-
Tuple3(Icons.copy, 'Copy config to new profile', copy),
32-
Tuple3(Icons.delete, 'Delete profile', delete),
29+
Tuple3(
30+
Icons.edit,
31+
SentenceManager(currentLanguage: AppSettings.selectedLanguage)
32+
.sentences
33+
.profilePageRenameAlias,
34+
rename,
35+
),
36+
Tuple3(
37+
Icons.link,
38+
SentenceManager(currentLanguage: AppSettings.selectedLanguage)
39+
.sentences
40+
.profilePageConfigureTaskserver,
41+
configure,
42+
),
43+
Tuple3(
44+
Icons.upload,
45+
SentenceManager(currentLanguage: AppSettings.selectedLanguage)
46+
.sentences
47+
.profilePageExportTasks,
48+
export,
49+
),
50+
Tuple3(
51+
Icons.copy,
52+
SentenceManager(currentLanguage: AppSettings.selectedLanguage)
53+
.sentences
54+
.profilePageCopyConfigToNewProfile,
55+
copy,
56+
),
57+
Tuple3(
58+
Icons.delete,
59+
SentenceManager(currentLanguage: AppSettings.selectedLanguage)
60+
.sentences
61+
.profilePageDeleteProfile,
62+
delete,
63+
),
3364
];
3465

3566
return ExpansionTile(
@@ -49,7 +80,9 @@ class ManageProfile extends StatelessWidget {
4980
? TaskWarriorColors.white
5081
: TaskWarriorColors.black,
5182
title: Text(
52-
'Manage selected profile',
83+
SentenceManager(currentLanguage: AppSettings.selectedLanguage)
84+
.sentences
85+
.profilePageManageSelectedProfile,
5386
style: GoogleFonts.poppins(
5487
fontWeight: TaskWarriorFonts.bold,
5588
fontSize: TaskWarriorFonts.fontSizeMedium,

lib/app/modules/profile/views/profile_view.dart

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import 'package:taskwarrior/app/routes/app_pages.dart';
1111
import 'package:taskwarrior/app/utils/constants/palette.dart';
1212
import 'package:taskwarrior/app/utils/constants/taskwarrior_colors.dart';
1313
import 'package:taskwarrior/app/utils/constants/utilites.dart';
14+
import 'package:taskwarrior/app/utils/language/sentence_manager.dart';
1415
import 'package:taskwarrior/app/utils/theme/app_settings.dart';
1516

1617
import '../controllers/profile_controller.dart';
@@ -25,8 +26,18 @@ class ProfileView extends GetView<ProfileController> {
2526
appBar: AppBar(
2627
backgroundColor: Palette.kToDark.shade200,
2728
title: Obx(() => Text(
28-
controller.profilesMap.length == 1 ? 'Profile' : 'Profiles',
29-
style: GoogleFonts.poppins(color: TaskWarriorColors.white),
29+
controller.profilesMap.length == 1
30+
? SentenceManager(
31+
currentLanguage: AppSettings.selectedLanguage)
32+
.sentences
33+
.profilePageProfile
34+
: SentenceManager(
35+
currentLanguage: AppSettings.selectedLanguage)
36+
.sentences
37+
.profilePageProfiles,
38+
style: GoogleFonts.poppins(
39+
color: TaskWarriorColors.white,
40+
),
3041
)),
3142
leading: IconButton(
3243
onPressed: () {
@@ -302,7 +313,10 @@ class ProfilesColumn extends StatelessWidget {
302313
? TaskWarriorColors.deepPurpleAccent
303314
: TaskWarriorColors.deepPurple),
304315
label: Text(
305-
'Add new Profile',
316+
SentenceManager(
317+
currentLanguage: AppSettings.selectedLanguage)
318+
.sentences
319+
.profilePageAddNewProfile,
306320
key: addNewProfileKey,
307321
style: TextStyle(
308322
color: AppSettings.isDarkMode

lib/app/modules/profile/views/renameprofiledialog.dart

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import 'package:get/get.dart';
33
import 'package:taskwarrior/app/modules/splash/controllers/splash_controller.dart';
44
import 'package:taskwarrior/app/utils/constants/taskwarrior_colors.dart';
55
import 'package:taskwarrior/app/utils/constants/utilites.dart';
6+
import 'package:taskwarrior/app/utils/language/sentence_manager.dart';
67
import 'package:taskwarrior/app/utils/theme/app_settings.dart';
78

89
class RenameProfileDialog extends StatelessWidget {
@@ -26,7 +27,10 @@ class RenameProfileDialog extends StatelessWidget {
2627
child: Utils.showAlertDialog(
2728
scrollable: true,
2829
title: Text(
29-
'Rename Alias',
30+
SentenceManager(
31+
currentLanguage: AppSettings.selectedLanguage)
32+
.sentences
33+
.profilePageRenameAliasDialogueBoxTitle,
3034
style: TextStyle(
3135
color: AppSettings.isDarkMode
3236
? TaskWarriorColors.white
@@ -47,7 +51,9 @@ class RenameProfileDialog extends StatelessWidget {
4751
Get.back();
4852
},
4953
child: Text(
50-
'Cancel',
54+
SentenceManager(currentLanguage: AppSettings.selectedLanguage)
55+
.sentences
56+
.profilePageRenameAliasDialogueBoxCancel,
5157
style: TextStyle(
5258
color: AppSettings.isDarkMode
5359
? TaskWarriorColors.white
@@ -65,7 +71,9 @@ class RenameProfileDialog extends StatelessWidget {
6571
Get.back();
6672
},
6773
child: Text(
68-
'Submit',
74+
SentenceManager(currentLanguage: AppSettings.selectedLanguage)
75+
.sentences
76+
.profilePageRenameAliasDialogueBoxSubmit,
6977
style: TextStyle(
7078
color: AppSettings.isDarkMode
7179
? TaskWarriorColors.black

lib/app/modules/profile/views/selectprofile.dart

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import 'package:google_fonts/google_fonts.dart';
55
import 'package:taskwarrior/app/modules/home/controllers/home_controller.dart';
66
import 'package:taskwarrior/app/utils/constants/taskwarrior_colors.dart';
77
import 'package:taskwarrior/app/utils/constants/taskwarrior_fonts.dart';
8+
import 'package:taskwarrior/app/utils/language/sentence_manager.dart';
89
import 'package:taskwarrior/app/utils/theme/app_settings.dart';
910

1011
class SelectProfile extends StatelessWidget {
@@ -44,7 +45,10 @@ class SelectProfile extends StatelessWidget {
4445
crossAxisAlignment: CrossAxisAlignment.start,
4546
children: [
4647
Text(
47-
'Current Profile:',
48+
SentenceManager(
49+
currentLanguage: AppSettings.selectedLanguage)
50+
.sentences
51+
.profilePageCurrentProfile,
4852
key : currentProfileKey,
4953
overflow: TextOverflow.fade,
5054
style: GoogleFonts.poppins(

0 commit comments

Comments
 (0)