Skip to content

Commit

Permalink
i18n
Browse files Browse the repository at this point in the history
  • Loading branch information
appdevelpo committed Jan 20, 2024
1 parent 5bfbe6c commit 933b40b
Show file tree
Hide file tree
Showing 5 changed files with 51 additions and 15 deletions.
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"cmake.sourceDirectory": "C:/Users/USER/Documents/miru-app/windows/flutter"
}
15 changes: 14 additions & 1 deletion assets/i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,20 @@
"read-mode": "Read mode",
"standard": "Standard",
"right-to-left": "Right to left",
"web-tonn": "Webtoon"
"web-tonn": "Webtoon",
"bottomLeft": "Bottom left",
"bottomRight": "Bottom right",
"topLeft": "Top left",
"topRight": "Top right",
"indicator-alignment": "Indicator alignment",
"status-bar":"Status bar"
},
"reader-settings": {
"enable-wakelock": "Keep screen on",
"battery": "Battery",
"time": "Time",
"page-indicator": "Page Indicator",
"battery-icon": "Battery Icon"
},
"novel-settings": {
"font-size": "Font size"
Expand Down
8 changes: 4 additions & 4 deletions lib/controllers/watch/comic_controller.dart
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,10 @@ class ComicController extends ReaderController<ExtensionMangaWatch> {
// 是否按下 ctrl
Timer? _barreryTimer;
final statusBarElement = <String, RxBool>{
'reader-setting.battery'.i18n: true.obs,
'reader-setting.time'.i18n: true.obs,
'reader-setting.page-indicator'.i18n: true.obs,
'reader-setting.battery-icon'.i18n: true.obs,
'reader-settings.battery'.i18n: true.obs,
'reader-settings.time'.i18n: true.obs,
'reader-settings.page-indicator'.i18n: true.obs,
'reader-settings.battery-icon'.i18n: true.obs,
};
final isZoom = false.obs;
final currentTime = "".obs;
Expand Down
10 changes: 5 additions & 5 deletions lib/views/pages/watch/reader/comic/comic_reader_content.dart
Original file line number Diff line number Diff line change
Expand Up @@ -62,16 +62,16 @@ class _ComicReaderContentState extends State<ComicReaderContent> {

Widget _indicatorBuilder() {
return Obx(() => Row(mainAxisSize: MainAxisSize.min, children: [
if (_c.statusBarElement["reader-setting.page-indicator".i18n]!
if (_c.statusBarElement["reader-settings.page-indicator".i18n]!
.value) ...[
Text(
"${_c.currentPage.value + 1}/${_c.watchData.value?.urls.length ?? 0}",
style: const TextStyle(color: Colors.white, fontSize: 15),
),
const SizedBox(width: 8)
],
if (_c
.statusBarElement["reader-setting.battery-icon".i18n]!.value) ...[
if (_c.statusBarElement["reader-settings.battery-icon".i18n]!
.value) ...[
BasedBatteryIndicator(
status: BasedBatteryStatus(
value: _c.batteryLevel.value,
Expand All @@ -84,14 +84,14 @@ class _ComicReaderContentState extends State<ComicReaderContent> {
),
const SizedBox(width: 8)
],
if (_c.statusBarElement["reader-setting.battery".i18n]!.value) ...[
if (_c.statusBarElement["reader-settings.battery".i18n]!.value) ...[
Text(
"${_c.batteryLevel.value}%",
style: const TextStyle(color: Colors.white, fontSize: 15),
),
const SizedBox(width: 8)
],
if (_c.statusBarElement["reader-setting.time".i18n]!.value) ...[
if (_c.statusBarElement["reader-settings.time".i18n]!.value) ...[
Text(
_c.currentTime.value,
style: const TextStyle(color: Colors.white, fontSize: 15),
Expand Down
30 changes: 25 additions & 5 deletions lib/views/pages/watch/reader/comic/comic_reader_settings.dart
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ class ComicReaderSettings extends StatefulWidget {

class _ComicReaderSettingsState extends State<ComicReaderSettings> {
late final ComicController _c = Get.find<ComicController>(tag: widget.tag);

Widget _buildAndroid(BuildContext context) {
return Padding(
padding: const EdgeInsets.all(16),
Expand Down Expand Up @@ -67,19 +66,40 @@ class _ComicReaderSettingsState extends State<ComicReaderSettings> {
segments: [
ButtonSegment<Alignment>(
value: Alignment.bottomLeft,
label: Text('comic-settings.bottomLeft'.i18n),
label: Column(children: [
Text('comic-settings.bottomLeft'.i18n),
const SizedBox(height: 5),
Transform.rotate(
angle: -3.14,
child: const Icon(Icons.arrow_outward))
]),
),
ButtonSegment<Alignment>(
value: Alignment.bottomRight,
label: Text('comic-settings.rightLeft'.i18n),
label: Column(children: [
Text('comic-settings.bottomRight'.i18n),
const SizedBox(height: 5),
Transform.rotate(
angle: 1.57, child: const Icon(Icons.arrow_outward))
]),
),
ButtonSegment<Alignment>(
value: Alignment.topLeft,
label: Text('comic-settings.topLeft'.i18n),
label: Column(children: [
Text('comic-settings.topLeft'.i18n),
const SizedBox(height: 5),
Transform.rotate(
angle: -1.57,
child: const Icon(Icons.arrow_outward))
]),
),
ButtonSegment<Alignment>(
value: Alignment.topRight,
label: Text('comic-settings.topRight'.i18n),
label: Column(children: [
Text('comic-settings.topRight'.i18n),
const SizedBox(height: 5),
const Icon(Icons.arrow_outward)
]),
)
],
selected: <Alignment>{_c.alignMode.value},
Expand Down

0 comments on commit 933b40b

Please sign in to comment.