Skip to content

Commit

Permalink
fix:i18n
Browse files Browse the repository at this point in the history
  • Loading branch information
appdevelpo committed Feb 19, 2024
1 parent 20ce45d commit f7b024a
Show file tree
Hide file tree
Showing 3 changed files with 64 additions and 99 deletions.
7 changes: 6 additions & 1 deletion assets/i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,12 @@
"topLeft": "Top left",
"topRight": "Top right",
"indicator-alignment": "Indicator alignment",
"status-bar":"Status bar"
"status-bar":"Status bar",
"prevPageHitBox": "Tapping region of previous page",
"nextPageHitBox": "Tapping region of next page",
"enable-autoscroller": "Enable autoscroller",
"autoscroller-interval": "Autoscroller interval",
"autoscroller-offset": "Autoscroller offset"
},
"reader-settings": {
"enable-wakelock": "Keep screen on",
Expand Down
112 changes: 44 additions & 68 deletions lib/utils/miru_storage.dart
Original file line number Diff line number Diff line change
Expand Up @@ -179,73 +179,49 @@ class MiruStorage {
}

class SettingKey {
static String theme = "Theme";
static String miruRepoUrl = "MiruRepoUrl";
static String tmdbKey = 'TMDBKey';
static String autoCheckUpdate = 'AutoCheckUpdate';
static String language = 'Language';
static String novelFontSize = 'NovelFontSize';
static String enableNSFW = 'EnableNSFW';
static String videoPlayer = 'VideoPlayer';
static String databaseVersion = 'DatabaseVersion';
static String listMode = 'ListMode';
static String keyI = 'KeyI';
static String keyJ = 'KeyJ';
static String arrowLeft = 'Arrowleft';
static String arrowRight = 'Arrowright';
static const String theme = "Theme";
static const String miruRepoUrl = "MiruRepoUrl";
static const String tmdbKey = 'TMDBKey';
static const String autoCheckUpdate = 'AutoCheckUpdate';
static const String language = 'Language';
static const String novelFontSize = 'NovelFontSize';
static const String enableNSFW = 'EnableNSFW';
static const String videoPlayer = 'VideoPlayer';
static const String databaseVersion = 'DatabaseVersion';
static const String listMode = 'ListMode';
static const String keyI = 'KeyI';
static const String keyJ = 'KeyJ';
static const String arrowLeft = 'Arrowleft';
static const String arrowRight = 'Arrowright';
//reading mode
static String readingMode = 'ReadingMode';
static String enableWakelock = 'EnableWakelock';
static String aniListToken = 'AniListToken';
static String aniListUserId = 'AniListUserId';
static String autoTracking = 'AutoTracking';
static String windowSize = 'WindowsSize';
static String windowPosition = 'WindowsPosition';
static String androidWebviewUA = "AndroidWebviewUA";
static String windowsWebviewUA = "WindowsWebviewUA";
static String proxy = "Proxy";
static String proxyType = "ProxyType";
static String saveLog = "SaveLog";
static String nextPageHitBox = "NextPageHitBox";
static String prevPageHitBox = "PrevPageHitBox";
static String autoScrollInterval = "AutoScrollInterval";
static String autoScrollOffset = "AutoScrollOffset";
static String ttsLanguage = "TTSLanguage";
static String ttsPitch = "TTSPitch";
static String ttsRate = "TTSRate";
static String ttsVolume = "TTSVolume";
static String leading = "Leading";
static const theme = "Theme";
static const miruRepoUrl = "MiruRepoUrl";
static const tmdbKey = 'TMDBKey';
static const autoCheckUpdate = 'AutoCheckUpdate';
static const language = 'Language';
static const novelFontSize = 'NovelFontSize';
static const enableNSFW = 'EnableNSFW';
static const videoPlayer = 'VideoPlayer';
static const databaseVersion = 'DatabaseVersion';
static const listMode = 'ListMode';
static const keyI = 'KeyI';
static const keyJ = 'KeyJ';
static const arrowLeft = 'Arrowleft';
static const arrowRight = 'Arrowright';
static const readingMode = 'ReadingMode';
static const aniListToken = 'AniListToken';
static const aniListUserId = 'AniListUserId';
static const autoTracking = 'AutoTracking';
static const windowSize = 'WindowsSize';
static const windowPosition = 'WindowsPosition';
static const androidWebviewUA = "AndroidWebviewUA";
static const windowsWebviewUA = "WindowsWebviewUA";
static const proxy = "Proxy";
static const proxyType = "ProxyType";
static const saveLog = "SaveLog";
static const subtitleFontSize = "SubtitleFontSize";
static const subtitleFontWeight = "SubtitleFontWeight";
static const subtitleFontColor = "SubtitleFontColor";
static const subtitleBackgroundColor = "SubtitleBackgroundColor";
static const subtitleBackgroundOpacity = "SubtitleBackgroundOpacity";
static const subtitleTextAlign = "SubtitleTextAlign";
static const subtitleLastLanguageSelected = "SubtitleLastLanguageSelected";
static const subtitleLastTitleSelected = "SubtitleLastTitleSelected";
static const String readingMode = 'ReadingMode';
static const String enableWakelock = 'EnableWakelock';
static const String aniListToken = 'AniListToken';
static const String aniListUserId = 'AniListUserId';
static const String autoTracking = 'AutoTracking';
static const String windowSize = 'WindowsSize';
static const String windowPosition = 'WindowsPosition';
static const String androidWebviewUA = "AndroidWebviewUA";
static const String windowsWebviewUA = "WindowsWebviewUA";
static const String proxy = "Proxy";
static const String proxyType = "ProxyType";
static const String saveLog = "SaveLog";
static const String nextPageHitBox = "NextPageHitBox";
static const String prevPageHitBox = "PrevPageHitBox";
static const String autoScrollInterval = "AutoScrollInterval";
static const String autoScrollOffset = "AutoScrollOffset";
static const String ttsLanguage = "TTSLanguage";
static const String ttsPitch = "TTSPitch";
static const String ttsRate = "TTSRate";
static const String ttsVolume = "TTSVolume";
static const String leading = "Leading";
static const String subtitleFontSize = "SubtitleFontSize";
static const String subtitleFontWeight = "SubtitleFontWeight";
static const String subtitleFontColor = "SubtitleFontColor";
static const String subtitleBackgroundColor = "SubtitleBackgroundColor";
static const String subtitleBackgroundOpacity = "SubtitleBackgroundOpacity";
static const String subtitleTextAlign = "SubtitleTextAlign";
static const String subtitleLastLanguageSelected =
"SubtitleLastLanguageSelected";
static const String subtitleLastTitleSelected = "SubtitleLastTitleSelected";
}
44 changes: 14 additions & 30 deletions lib/views/pages/watch/reader/comic/comic_reader_settings.dart
Original file line number Diff line number Diff line change
Expand Up @@ -103,41 +103,25 @@ class _ComicReaderSettingsState extends State<ComicReaderSettings> {
segments: [
ButtonSegment<Alignment>(
value: Alignment.bottomLeft,
label: Column(children: [
Text('comic-settings.bottomLeft'.i18n),
const SizedBox(height: 5),
Transform.rotate(
angle: -3.14,
child: const Icon(Icons.arrow_outward))
]),
label: Transform.rotate(
angle: -3.14,
child: const Icon(Icons.arrow_outward)),
),
ButtonSegment<Alignment>(
value: Alignment.bottomRight,
label: Column(children: [
Text('comic-settings.bottomRight'.i18n),
const SizedBox(height: 5),
Transform.rotate(
angle: 1.57,
child: const Icon(Icons.arrow_outward))
]),
label: Transform.rotate(
angle: 1.57,
child: const Icon(Icons.arrow_outward)),
),
ButtonSegment<Alignment>(
value: Alignment.topLeft,
label: Column(children: [
Text('comic-settings.topLeft'.i18n),
const SizedBox(height: 5),
Transform.rotate(
angle: -1.57,
child: const Icon(Icons.arrow_outward))
]),
label: Transform.rotate(
angle: -1.57,
child: const Icon(Icons.arrow_outward)),
),
ButtonSegment<Alignment>(
const ButtonSegment<Alignment>(
value: Alignment.topRight,
label: Column(children: [
Text('comic-settings.topRight'.i18n),
const SizedBox(height: 5),
const Icon(Icons.arrow_outward)
]),
label: Icon(Icons.arrow_outward),
)
],
selected: <Alignment>{_c.alignMode.value},
Expand Down Expand Up @@ -212,14 +196,14 @@ class _ComicReaderSettingsState extends State<ComicReaderSettings> {
children: [
SettingsSwitchTile(
icon: const Icon(Icons.play_arrow_rounded),
title: "reader-settings.enable-autoscroller".i18n,
title: "comic-settings.enable-autoscroller".i18n,
buildValue: () => _c.enableAutoScroll.value,
onChanged: (val) {
Get.back();
_c.enableAutoScroll.value = val;
}),
const SizedBox(height: 16),
Text('reader-settings.auto-scroller-interval'.i18n),
Text('comic-settings.autoscroller-interval'.i18n),
Slider(
value: _c.autoScrollInterval.value.toDouble(),
max: 500.0,
Expand All @@ -231,7 +215,7 @@ class _ComicReaderSettingsState extends State<ComicReaderSettings> {
SettingKey.autoScrollInterval, val.toInt());
}),
const SizedBox(height: 16),
Text('reader-settings.auto-scroller-offset'.i18n),
Text('comic-settings.autoscroller-offset'.i18n),
Slider(
value: _c.autoScrollOffset.value,
max: 300.0,
Expand Down

0 comments on commit f7b024a

Please sign in to comment.