~repos /only-bible-app
git clone https://pyrossh.dev/repos/only-bible-app.git
The only bible app you will ever need. No ads. No in-app purchases. No distractions.
dd112d1b
—
pyrossh 2 years ago
Rename l10n
- lib/app.dart +1 -1
- lib/providers/app_provider.dart +2 -2
- lib/screens/bible_select_screen.dart +1 -1
- lib/screens/book_select_screen.dart +2 -2
- lib/sheets/actions_sheet.dart +1 -1
- lib/sheets/settings_sheet.dart +12 -12
- lib/utils.dart +69 -69
lib/app.dart
CHANGED
|
@@ -16,7 +16,7 @@ class App extends StatelessWidget {
|
|
|
16
16
|
@override
|
|
17
17
|
Widget build(BuildContext context) {
|
|
18
18
|
return MaterialApp(
|
|
19
|
-
onGenerateTitle: (context) => context.
|
|
19
|
+
onGenerateTitle: (context) => context.l.title,
|
|
20
20
|
localizationsDelegates: AppLocalizations.localizationsDelegates,
|
|
21
21
|
supportedLocales: AppLocalizations.supportedLocales,
|
|
22
22
|
debugShowCheckedModeBanner: false,
|
lib/providers/app_provider.dart
CHANGED
|
@@ -102,7 +102,7 @@ class AppProvider extends ChangeNotifier {
|
|
|
102
102
|
}
|
|
103
103
|
|
|
104
104
|
hasAudio(BuildContext context) {
|
|
105
|
-
return context.
|
|
105
|
+
return context.l.hasAudio == "true";
|
|
106
106
|
}
|
|
107
107
|
|
|
108
108
|
changeBible(BuildContext context) {
|
|
@@ -485,7 +485,7 @@ class AppProvider extends ChangeNotifier {
|
|
|
485
485
|
log("Could not play audio", name: "play", error: (err.toString(), pathname));
|
|
486
486
|
FirebaseCrashlytics.instance.recordFlutterError(FlutterErrorDetails(exception: (err.toString(), pathname)));
|
|
487
487
|
if (context.mounted) {
|
|
488
|
-
showError(context, context.
|
|
488
|
+
showError(context, context.lEvent.audioError);
|
|
489
489
|
}
|
|
490
490
|
return;
|
|
491
491
|
} finally {
|
lib/screens/bible_select_screen.dart
CHANGED
|
@@ -14,7 +14,7 @@ class BibleSelectScreen extends StatelessWidget {
|
|
|
14
14
|
child: CustomScrollView(
|
|
15
15
|
physics: const BouncingScrollPhysics(),
|
|
16
16
|
slivers: [
|
|
17
|
-
SliverHeading(title: context.
|
|
17
|
+
SliverHeading(title: context.l.bibleSelectTitle, showClose: !context.app.firstOpen),
|
|
18
18
|
SliverTileGrid(
|
|
19
19
|
listType: ListType.large,
|
|
20
20
|
children: List.of(
|
lib/screens/book_select_screen.dart
CHANGED
|
@@ -31,7 +31,7 @@ class BookSelectScreen extends StatelessWidget {
|
|
|
31
31
|
child: CustomScrollView(
|
|
32
32
|
physics: const BouncingScrollPhysics(),
|
|
33
33
|
slivers: [
|
|
34
|
-
SliverHeading(title: context.
|
|
34
|
+
SliverHeading(title: context.l.oldTestamentTitle, showClose: true),
|
|
35
35
|
SliverTileGrid(
|
|
36
36
|
children: List.of(
|
|
37
37
|
bible.getOldBooks().map((book) {
|
|
@@ -42,7 +42,7 @@ class BookSelectScreen extends StatelessWidget {
|
|
|
42
42
|
}),
|
|
43
43
|
),
|
|
44
44
|
),
|
|
45
|
-
SliverHeading(title: context.
|
|
45
|
+
SliverHeading(title: context.l.newTestamentTitle, top: 30, bottom: 20),
|
|
46
46
|
SliverTileGrid(
|
|
47
47
|
children: List.of(
|
|
48
48
|
bible.getNewBooks().map((book) {
|
lib/sheets/actions_sheet.dart
CHANGED
|
@@ -36,7 +36,7 @@ class ActionsSheet extends StatelessWidget {
|
|
|
36
36
|
if (audioEnabled) {
|
|
37
37
|
context.appEvent.onPlay(context);
|
|
38
38
|
} else {
|
|
39
|
-
showError(context, context.
|
|
39
|
+
showError(context, context.lEvent.audioNotAvailable);
|
|
40
40
|
}
|
|
41
41
|
},
|
|
42
42
|
icon: Icon(audioIcon, size: 34, color: audioEnabled ? iconColor : Colors.grey),
|
lib/sheets/settings_sheet.dart
CHANGED
|
@@ -18,18 +18,18 @@ class SettingsSheet extends StatelessWidget {
|
|
|
18
18
|
),
|
|
19
19
|
sections: [
|
|
20
20
|
SettingsSection(
|
|
21
|
-
title: Text(context.
|
|
21
|
+
title: Text(context.l.settingsTitle, style: context.theme.textTheme.headlineMedium),
|
|
22
22
|
margin: const EdgeInsetsDirectional.symmetric(horizontal: 20),
|
|
23
23
|
tiles: [
|
|
24
24
|
SettingsTile.navigation(
|
|
25
25
|
leading: const Icon(Icons.book_outlined, color: Colors.blueAccent),
|
|
26
|
-
title: Text(context.
|
|
26
|
+
title: Text(context.l.bibleTitle),
|
|
27
27
|
value: Text(context.app.bible.name),
|
|
28
28
|
onPressed: context.app.changeBible,
|
|
29
29
|
),
|
|
30
30
|
SettingsTile.navigation(
|
|
31
31
|
leading: const Icon(Icons.color_lens_outlined, color: Colors.pink),
|
|
32
|
-
title: Text(context.
|
|
32
|
+
title: Text(context.l.themeTitle),
|
|
33
33
|
trailing: ToggleButtons(
|
|
34
34
|
onPressed: (int index) {
|
|
35
35
|
context.appEvent.toggleDarkMode();
|
|
@@ -53,7 +53,7 @@ class SettingsSheet extends StatelessWidget {
|
|
|
53
53
|
),
|
|
54
54
|
),
|
|
55
55
|
SettingsTile(
|
|
56
|
-
title: Text(context.
|
|
56
|
+
title: Text(context.l.incrementFontTitle),
|
|
57
57
|
leading: Icon(Icons.font_download, color: context.theme.colorScheme.onBackground),
|
|
58
58
|
trailing: IconButton(
|
|
59
59
|
onPressed: context.appEvent.increaseFont,
|
|
@@ -61,7 +61,7 @@ class SettingsSheet extends StatelessWidget {
|
|
|
61
61
|
),
|
|
62
62
|
),
|
|
63
63
|
SettingsTile(
|
|
64
|
-
title: Text(context.
|
|
64
|
+
title: Text(context.l.decrementFontTitle),
|
|
65
65
|
leading: Icon(Icons.font_download, color: context.theme.colorScheme.onBackground),
|
|
66
66
|
trailing: IconButton(
|
|
67
67
|
onPressed: context.appEvent.decreaseFont,
|
|
@@ -71,40 +71,40 @@ class SettingsSheet extends StatelessWidget {
|
|
|
71
71
|
SettingsTile.switchTile(
|
|
72
72
|
initialValue: context.app.fontBold,
|
|
73
73
|
leading: Icon(Icons.format_bold, color: context.theme.colorScheme.onBackground),
|
|
74
|
-
title: Text(context.
|
|
74
|
+
title: Text(context.l.boldFontTitle),
|
|
75
75
|
onToggle: (value) => context.appEvent.toggleBold(),
|
|
76
76
|
),
|
|
77
77
|
SettingsTile.switchTile(
|
|
78
78
|
initialValue: context.app.engTitles,
|
|
79
79
|
leading: Icon(Icons.abc, color: context.theme.colorScheme.onBackground),
|
|
80
|
-
title: Text(context.
|
|
80
|
+
title: Text(context.l.engTitles),
|
|
81
81
|
onToggle: (value) => context.appEvent.toggleEngBookNames(),
|
|
82
82
|
),
|
|
83
83
|
],
|
|
84
84
|
),
|
|
85
85
|
SettingsSection(
|
|
86
|
-
title: Text(context.
|
|
86
|
+
title: Text(context.l.aboutUsTitle, style: context.theme.textTheme.headlineMedium),
|
|
87
87
|
margin: const EdgeInsetsDirectional.symmetric(horizontal: 20, vertical: 20),
|
|
88
88
|
tiles: [
|
|
89
89
|
SettingsTile.navigation(
|
|
90
90
|
leading: const Icon(Icons.policy_outlined, color: Colors.brown),
|
|
91
|
-
title: Text(context.
|
|
91
|
+
title: Text(context.l.privacyPolicyTitle),
|
|
92
92
|
onPressed: context.appEvent.showPrivacyPolicy,
|
|
93
93
|
),
|
|
94
94
|
SettingsTile.navigation(
|
|
95
95
|
leading: const Icon(Icons.share_outlined, color: Colors.blueAccent),
|
|
96
|
-
title: Text(context.
|
|
96
|
+
title: Text(context.l.shareAppTitle),
|
|
97
97
|
onPressed: context.appEvent.shareAppLink,
|
|
98
98
|
),
|
|
99
99
|
if (!isDesktop()) // TODO: mabe support OSx if we release in that store
|
|
100
100
|
SettingsTile.navigation(
|
|
101
101
|
leading: Icon(Icons.star, color: Colors.yellowAccent.shade700),
|
|
102
|
-
title: Text(context.
|
|
102
|
+
title: Text(context.l.rateAppTitle),
|
|
103
103
|
onPressed: context.appEvent.rateApp,
|
|
104
104
|
),
|
|
105
105
|
SettingsTile.navigation(
|
|
106
106
|
leading: Icon(Icons.info_outline, color: context.theme.colorScheme.onBackground),
|
|
107
|
-
title: Text(context.
|
|
107
|
+
title: Text(context.l.aboutUsTitle),
|
|
108
108
|
onPressed: context.appEvent.showAboutUs,
|
|
109
109
|
),
|
|
110
110
|
],
|
lib/utils.dart
CHANGED
|
@@ -17,11 +17,11 @@ extension MyIterable<E> on Iterable<E> {
|
|
|
17
17
|
extension AppContext on BuildContext {
|
|
18
18
|
ThemeData get theme => Theme.of(this);
|
|
19
19
|
|
|
20
|
-
AppLocalizations get
|
|
20
|
+
AppLocalizations get l => app.engTitles && app.locale.languageCode != "en"
|
|
21
21
|
? lookupAppLocalizations(const Locale("en"))
|
|
22
22
|
: AppLocalizations.of(this)!;
|
|
23
23
|
|
|
24
|
-
AppLocalizations get
|
|
24
|
+
AppLocalizations get lEvent => appEvent.engTitles && appEvent.locale.languageCode != "en"
|
|
25
25
|
? lookupAppLocalizations(const Locale("en"))
|
|
26
26
|
: AppLocalizations.of(this)!;
|
|
27
27
|
|
|
@@ -60,72 +60,72 @@ extension AppContext on BuildContext {
|
|
|
60
60
|
|
|
61
61
|
List<String> get bookNames {
|
|
62
62
|
return [
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
63
|
+
l.genesis,
|
|
64
|
+
l.exodus,
|
|
65
|
+
l.leviticus,
|
|
66
|
+
l.numbers,
|
|
67
|
+
l.deuteronomy,
|
|
68
|
+
l.joshua,
|
|
69
|
+
l.judges,
|
|
70
|
+
l.ruth,
|
|
71
|
+
l.firstSamuel,
|
|
72
|
+
l.secondSamuel,
|
|
73
|
+
l.firstKings,
|
|
74
|
+
l.secondKings,
|
|
75
|
+
l.firstChronicles,
|
|
76
|
+
l.secondChronicles,
|
|
77
|
+
l.ezra,
|
|
78
|
+
l.nehemiah,
|
|
79
|
+
l.esther,
|
|
80
|
+
l.job,
|
|
81
|
+
l.psalms,
|
|
82
|
+
l.proverbs,
|
|
83
|
+
l.ecclesiastes,
|
|
84
|
+
l.song_of_solomon,
|
|
85
|
+
l.isaiah,
|
|
86
|
+
l.jeremiah,
|
|
87
|
+
l.lamentations,
|
|
88
|
+
l.ezekiel,
|
|
89
|
+
l.daniel,
|
|
90
|
+
l.hosea,
|
|
91
|
+
l.joel,
|
|
92
|
+
l.amos,
|
|
93
|
+
l.obadiah,
|
|
94
|
+
l.jonah,
|
|
95
|
+
l.micah,
|
|
96
|
+
l.nahum,
|
|
97
|
+
l.habakkuk,
|
|
98
|
+
l.zephaniah,
|
|
99
|
+
l.haggai,
|
|
100
|
+
l.zechariah,
|
|
101
|
+
l.malachi,
|
|
102
|
+
l.matthew,
|
|
103
|
+
l.mark,
|
|
104
|
+
l.luke,
|
|
105
|
+
l.john,
|
|
106
|
+
l.acts,
|
|
107
|
+
l.romans,
|
|
108
|
+
l.firstCorinthians,
|
|
109
|
+
l.secondCorinthians,
|
|
110
|
+
l.galatians,
|
|
111
|
+
l.ephesians,
|
|
112
|
+
l.philippians,
|
|
113
|
+
l.colossians,
|
|
114
|
+
l.firstThessalonians,
|
|
115
|
+
l.secondThessalonians,
|
|
116
|
+
l.firstTimothy,
|
|
117
|
+
l.secondTimothy,
|
|
118
|
+
l.titus,
|
|
119
|
+
l.philemon,
|
|
120
|
+
l.hebrews,
|
|
121
|
+
l.james,
|
|
122
|
+
l.firstPeter,
|
|
123
|
+
l.secondPeter,
|
|
124
|
+
l.firstJohn,
|
|
125
|
+
l.secondJohn,
|
|
126
|
+
l.thirdJohn,
|
|
127
|
+
l.jude,
|
|
128
|
+
l.revelation,
|
|
129
129
|
];
|
|
130
130
|
}
|
|
131
131
|
}
|
|
@@ -190,5 +190,5 @@ openUrl(BuildContext context, String url) async {
|
|
|
190
190
|
}
|
|
191
191
|
}
|
|
192
192
|
if (!context.mounted) return;
|
|
193
|
-
showError(context, context.
|
|
193
|
+
showError(context, context.l.urlError);
|
|
194
194
|
}
|