~repos /only-bible-app

#kotlin#android#ios

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 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.l10n.title,
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.l10n.hasAudio == "true";
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.l10nEvent.audioError);
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.l10n.bibleSelectTitle, showClose: !context.app.firstOpen),
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.l10n.oldTestamentTitle, showClose: true),
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.l10n.newTestamentTitle, top: 30, bottom: 20),
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.l10nEvent.audioNotAvailable);
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.l10n.settingsTitle, style: context.theme.textTheme.headlineMedium),
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.l10n.bibleTitle),
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.l10n.themeTitle),
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.l10n.incrementFontTitle),
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.l10n.decrementFontTitle),
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.l10n.boldFontTitle),
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.l10n.engTitles),
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.l10n.aboutUsTitle, style: context.theme.textTheme.headlineMedium),
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.l10n.privacyPolicyTitle),
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.l10n.shareAppTitle),
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.l10n.rateAppTitle),
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.l10n.aboutUsTitle),
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 l10n => app.engTitles && app.locale.languageCode != "en"
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 l10nEvent => appEvent.engTitles && appEvent.locale.languageCode != "en"
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
- l10n.genesis,
64
- l10n.exodus,
65
- l10n.leviticus,
66
- l10n.numbers,
67
- l10n.deuteronomy,
68
- l10n.joshua,
69
- l10n.judges,
70
- l10n.ruth,
71
- l10n.firstSamuel,
72
- l10n.secondSamuel,
73
- l10n.firstKings,
74
- l10n.secondKings,
75
- l10n.firstChronicles,
76
- l10n.secondChronicles,
77
- l10n.ezra,
78
- l10n.nehemiah,
79
- l10n.esther,
80
- l10n.job,
81
- l10n.psalms,
82
- l10n.proverbs,
83
- l10n.ecclesiastes,
84
- l10n.song_of_solomon,
85
- l10n.isaiah,
86
- l10n.jeremiah,
87
- l10n.lamentations,
88
- l10n.ezekiel,
89
- l10n.daniel,
90
- l10n.hosea,
91
- l10n.joel,
92
- l10n.amos,
93
- l10n.obadiah,
94
- l10n.jonah,
95
- l10n.micah,
96
- l10n.nahum,
97
- l10n.habakkuk,
98
- l10n.zephaniah,
99
- l10n.haggai,
100
- l10n.zechariah,
101
- l10n.malachi,
102
- l10n.matthew,
103
- l10n.mark,
104
- l10n.luke,
105
- l10n.john,
106
- l10n.acts,
107
- l10n.romans,
108
- l10n.firstCorinthians,
109
- l10n.secondCorinthians,
110
- l10n.galatians,
111
- l10n.ephesians,
112
- l10n.philippians,
113
- l10n.colossians,
114
- l10n.firstThessalonians,
115
- l10n.secondThessalonians,
116
- l10n.firstTimothy,
117
- l10n.secondTimothy,
118
- l10n.titus,
119
- l10n.philemon,
120
- l10n.hebrews,
121
- l10n.james,
122
- l10n.firstPeter,
123
- l10n.secondPeter,
124
- l10n.firstJohn,
125
- l10n.secondJohn,
126
- l10n.thirdJohn,
127
- l10n.jude,
128
- l10n.revelation,
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.l10n.urlError);
193
+ showError(context, context.l.urlError);
194
194
  }