Skip to content

Commit 3aedeaa

Browse files
authored
chore: Hardcoded strings → localization files
* Update SettingsCommonScreen.dart * Update SettingsBottomSheet.dart * Update LoginScreen.dart * Update SettingsPlayerScreen.dart * Update app_en.arb * Update LoginScreen.dart * Update SettingsBottomSheet.dart * Update SettingsPlayerScreen.dart
1 parent 0e28e65 commit 3aedeaa

File tree

5 files changed

+122
-77
lines changed

5 files changed

+122
-77
lines changed

assets/translations/app_en.arb

Lines changed: 72 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,85 @@
11
{
2-
"appName": "Dartotsu",
3-
"anilist": "AniList",
4-
"mal": "MyAnimeList",
5-
"discord": "Discord",
2+
"about": "About",
3+
"aboutDescription": "Learn more about the app and its creators",
64
"account": "Account",
75
"accountDescription": "Manage your AniList, MAL, and Discord accounts effortlessly",
8-
"theme": "Theme",
9-
"themeDescription": "Customize the appearance and vibe of your app",
10-
"common": "Common",
11-
"commonDescription": "Access general settings for seamless app usage",
6+
"activities": "Activities",
127
"anime": "Anime",
138
"animeDescription": "Personalize and manage your anime preferences",
14-
"manga": "Manga",
15-
"mangaDescription": "Organize and tailor your manga experience",
16-
"extensions": "Extensions",
17-
"extensionsDescription": "Install and manage extensions for added functionality",
18-
"notifications": "Notifications",
19-
"notificationsDescription": "Configure how and when you receive notifications",
20-
"about": "About",
21-
"aboutDescription": "Learn more about the app and its creators",
22-
"supportMaintainer": "Want to support Dartotsu's Maintainer?\nConsider Donating",
23-
"donationGoal": "No donation goal atm",
24-
"settings": "Settings",
25-
"darkMode": "Dark Mode",
26-
"enableDarkMode": "Enable Dark Mode",
27-
"oledThemeVariant": "OLED theme Variant",
28-
"oledThemeVariantDescription": "Enable OLED Mode",
29-
"materialYou": "Material You",
30-
"materialYouDescription": "Use the same color as your wallpaper",
31-
"customTheme": "Custom theme",
32-
"customThemeDescription": "Use your own color for the theme",
9+
"anilist": "AniList",
10+
"appName": "Dartotsu",
11+
"appTagline": "The NEW Best App For\nTracking Anime & Manga",
12+
"backgroundColor": "Background Color",
13+
"backgroundColorDescription": "Subtitle background color",
14+
"bottomPadding": "Bottom Padding",
15+
"bottomPaddingDescription": "Subtitle bottom padding",
16+
"cancel": "Cancel",
3317
"colorPicker": "Color Picker",
3418
"colorPickerDescription": "Choose a color",
19+
"common": "Common",
20+
"commonDescription": "Access general settings for seamless app usage",
21+
"cursedSpeed": "Cursed Speed",
22+
"cursedSpeedDescription": "For people who are too busy with life",
23+
"customTheme": "Custom theme",
24+
"customThemeDescription": "Use your own color for the theme",
25+
"darkMode": "Dark Mode",
26+
"discord": "Discord",
27+
"donationGoal": "No donation goal atm",
28+
"enableDarkMode": "Enable Dark Mode",
29+
"extension": "Extension",
30+
"extensions": "Extensions",
31+
"extensionsDescription": "Install and manage extensions for added functionality",
32+
"fontColor": "Font Color",
33+
"fontColorDescription": "Subtitle font color",
34+
"fontFamily": "Font Family",
35+
"fontFamilyDescription": "Subtitle font family",
36+
"fontSize": "Font Size",
37+
"fontSizeDescription": "Subtitle font size",
38+
"fontWeight": "Font Weight",
39+
"fontWeightDescription": "Subtitle font weight",
40+
"hidePrivate": "Hide Private",
41+
"hidePrivateDescription": "Hide private media from the home page",
42+
"incognitoMode": "Incognito Mode",
43+
"incognitoModeDescription": "Browse without saving your activity",
44+
"login": "Login",
45+
"logout": "Logout",
46+
"logoutConfirmation": "Are you sure you want to logout?",
47+
"mal": "MyAnimeList",
3548
"manageAnimeLayouts": "Manage Layouts of Anime Page",
3649
"manageAnimeLayoutsDescription": "Rearrange and remove sections on the anime page",
37-
"manageMangaLayouts": "Manage Layouts of Manga Page",
38-
"manageMangaLayoutsDescription": "Rearrange and remove sections on the manga page",
3950
"manageHomeLayouts": "Manage Layouts of Home Page",
4051
"manageHomeLayoutsDescription": "Rearrange and remove sections on the HomePage",
52+
"manageMangaLayouts": "Manage Layouts of Manga Page",
53+
"manageMangaLayoutsDescription": "Rearrange and remove sections on the manga page",
54+
"manga": "Manga",
55+
"mangaDescription": "Organize and tailor your manga experience",
56+
"materialYou": "Material You",
57+
"materialYouDescription": "Use the same color as your wallpaper",
58+
"no": "No",
59+
"notifications": "Notifications",
60+
"notificationsDescription": "Configure how and when you receive notifications",
61+
"offlineMode": "Offline Mode",
62+
"offlineModeDescription": "Use the app without an internet connection",
4163
"ok": "OK",
42-
"cancel": "Cancel"
64+
"oledThemeVariant": "OLED theme Variant",
65+
"oledThemeVariantDescription": "Enable OLED Mode",
66+
"outlineColor": "Outline Color",
67+
"outlineColorDescription": "Subtitle outline color",
68+
"playerSettingsTitle": "Player Settings",
69+
"resizeMode": "Resize mode",
70+
"resizeModeDescription": "Default resize mode for player",
71+
"restoreSettings": "Restore Settings",
72+
"settings": "Settings",
73+
"showSubtitles": "Show Subtitles",
74+
"showSubtitlesDescription": "Show subtitles by default",
75+
"skipButton": "Skip Button",
76+
"skipButtonDescription": "Skip button duration",
77+
"speed": "Speed",
78+
"speedDescription": "Default speed for player",
79+
"subtitles": "Subtitles",
80+
"subtitlePreview": "Subtitle Preview",
81+
"supportMaintainer": "Want to support Dartotsu's Maintainer?\nConsider Donating",
82+
"theme": "Theme",
83+
"themeDescription": "Customize the appearance and vibe of your app",
84+
"yes": "Yes"
4385
}

lib/Screens/Login/LoginScreen.dart

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import 'package:dantotsu/Widgets/LoadSvg.dart';
22
import 'package:flutter/material.dart';
33
import 'package:icons_plus/icons_plus.dart';
44
import 'package:provider/provider.dart';
5+
import '../../Theme/LanguageSwitcher.dart';
56
import '../../Functions/Function.dart';
67
import '../../Services/ServiceSwitcher.dart';
78

@@ -29,7 +30,7 @@ class LoginScreenState extends State<LoginScreen> {
2930
children: [
3031
const SizedBox(height: 64),
3132
Text(
32-
'Dartotsu',
33+
getString.appName,
3334
style: TextStyle(
3435
fontFamily: 'Poppins',
3536
fontWeight: FontWeight.w100,
@@ -39,7 +40,7 @@ class LoginScreenState extends State<LoginScreen> {
3940
),
4041
const SizedBox(height: 8),
4142
const Text(
42-
'The NEW Best Anime & Manga app\nfor idk.',
43+
getString.appTagline,
4344
textAlign: TextAlign.center,
4445
style: TextStyle(fontSize: 14),
4546
),
@@ -62,7 +63,7 @@ class LoginScreenState extends State<LoginScreen> {
6263
GestureDetector(
6364
onTap: () {},
6465
child: Text(
65-
'Restore Settings',
66+
getString.restoreSettings,
6667
style: TextStyle(
6768
fontFamily: 'Poppins',
6869
fontWeight: FontWeight.bold,
@@ -93,7 +94,7 @@ class LoginScreenState extends State<LoginScreen> {
9394
),
9495
),
9596
label: Text(
96-
'Login',
97+
getString.login,
9798
style: TextStyle(
9899
fontFamily: 'Poppins',
99100
color: theme.onPrimaryContainer,

lib/Screens/Settings/SettingsBottomSheet.dart

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import 'package:dantotsu/Widgets/CustomBottomDialog.dart';
88
import 'package:flutter/material.dart';
99
import 'package:get/get_state_manager/src/rx_flutter/rx_obx_widget.dart';
1010
import 'package:provider/provider.dart';
11+
import '../../Theme/LanguageSwitcher.dart';
1112
import '../../Preferences/PrefManager.dart';
1213
import '../../Services/ServiceSwitcher.dart';
1314

@@ -72,17 +73,17 @@ class SettingsBottomSheetState extends State<SettingsBottomSheet> {
7273
GestureDetector(
7374
onTap: () {
7475
AlertDialogBuilder(context)
75-
..setTitle('Logout')
76-
..setMessage('Are you sure you want to logout?')
77-
..setPositiveButton('Yes', () {
76+
..setTitle(getString.logout)
77+
..setMessage(getString.logoutConfirmation)
78+
..setPositiveButton(getString.yes, () {
7879
service.removeSavedToken();
7980
Navigator.of(context).pop();
8081
})
81-
..setNegativeButton('No', null)
82+
..setNegativeButton(getString.no, null)
8283
..show();
8384
},
8485
child: Text(
85-
'Logout',
86+
getString.logout,
8687
style: TextStyle(
8788
fontFamily: 'Poppins',
8889
color: Theme.of(context).colorScheme.secondary,
@@ -95,7 +96,7 @@ class SettingsBottomSheetState extends State<SettingsBottomSheet> {
9596
GestureDetector(
9697
onTap: () => service.login(context),
9798
child: Text(
98-
'Login',
99+
getString.login,
99100
style: TextStyle(
100101
fontFamily: 'Poppins',
101102
color: Theme.of(context).colorScheme.secondary,
@@ -160,7 +161,7 @@ class SettingsBottomSheetState extends State<SettingsBottomSheet> {
160161
const SizedBox(height: 24.0),
161162
_buildSwitchListTile(
162163
context: context,
163-
title: 'Incognito Mode',
164+
title: getString.incognitoMode,
164165
icon: Icons.person,
165166
isChecked: incognito,
166167
onChanged: (bool value) {
@@ -172,7 +173,7 @@ class SettingsBottomSheetState extends State<SettingsBottomSheet> {
172173
const SizedBox(height: 12.0),
173174
_buildSwitchListTile(
174175
context: context,
175-
title: 'Offline Mode',
176+
title: getString.offlineMode,
176177
icon: Icons.download,
177178
isChecked: offline,
178179
onChanged: (bool value) {
@@ -183,13 +184,13 @@ class SettingsBottomSheetState extends State<SettingsBottomSheet> {
183184
}),
184185
const SizedBox(height: 10.0),
185186
_buildListTile(
186-
context, 'Activities', Icons.inbox, const SettingsScreen()),
187+
context, getString.activities, Icons.inbox, const SettingsScreen()),
187188
const SizedBox(height: 10.0),
188189
_buildListTile(
189-
context, 'Extension', Icons.extension, const ExtensionScreen()),
190+
context, getString.extension, Icons.extension, const ExtensionScreen()),
190191
const SizedBox(height: 10.0),
191192
_buildListTile(
192-
context, 'Settings', Icons.settings, const SettingsScreen()),
193+
context, getString.settings, Icons.settings, const SettingsScreen()),
193194
],
194195
);
195196
}

lib/Screens/Settings/SettingsCommonScreen.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@ class SettingsCommonScreenState extends BaseSettingsScreen {
4545
settings: [
4646
Setting(
4747
type: SettingType.switchType,
48-
name: 'Hide Private',
49-
description: 'Hide private media from the home page',
48+
name: getString.hidePrivate,
49+
description: getString.hidePrivateDescription,
5050
icon: Icons.visibility_off,
5151
isChecked: PrefManager.getVal(PrefName.anilistHidePrivate),
5252
onSwitchChange: (value) {

0 commit comments

Comments
 (0)