Skip to content

Commit

Permalink
(intl) Translate viewer message
Browse files Browse the repository at this point in the history
  • Loading branch information
violet-dev committed Jul 15, 2020
1 parent 4a4f10c commit 816ba20
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 5 deletions.
4 changes: 3 additions & 1 deletion assets/locale/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -155,5 +155,7 @@
"noauth": "You do not have permission to run it.",
"noselectedb": "No database selected.",
"importbookmark": "Bookmark Imported!",
"exportbookmark": "Bookmark Exported!"
"exportbookmark": "Bookmark Exported!",
"record": "Record",
"recordmessage": "There is a record that you have read up to %s page before. Do you want to continue reading?"
}
4 changes: 3 additions & 1 deletion assets/locale/ja.json
Original file line number Diff line number Diff line change
Expand Up @@ -153,5 +153,7 @@
"noauth": "権限がなくて実行できません。",
"noselectedb": "選択されたデータベースがありません。",
"importbookmark": "ブックマークをインポートしました!",
"exportbookmark": "ブックマークをエクスポートしました!"
"exportbookmark": "ブックマークをエクスポートしました!",,
"record": "記録",
"recordmessage": "これまでに%sページまで読んだことがあるレコードがあります。 読み続けますか?"
}
4 changes: 3 additions & 1 deletion assets/locale/ko.json
Original file line number Diff line number Diff line change
Expand Up @@ -154,5 +154,7 @@
"noauth": "권한이 없어서 실행할 수 없습니다.",
"noselectedb": "선택된 데이터베이스가 없습니다.",
"importbookmark": "북마크를 가져왔습니다!",
"exportbookmark": "북마크를 내보냈습니다!"
"exportbookmark": "북마크를 내보냈습니다!",
"record": "기록",
"recordmessage": "이전에 %s페이지까지 읽었던 기록이 있습니다. 이어서 읽을까요?"
}
9 changes: 7 additions & 2 deletions lib/pages/viewer/viewer_widget.dart
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import 'package:violet/dialogs.dart';
import 'package:violet/settings.dart';
import 'package:violet/database/user/user.dart';
import 'package:visibility_detector/visibility_detector.dart';
import 'package:violet/locale.dart';

class ViewerWidget extends StatelessWidget {
final List<String> urls;
Expand Down Expand Up @@ -116,8 +117,12 @@ class ViewerWidget extends StatelessWidget {
.difference(DateTime.now())
.inDays <
7) {
if (await Dialogs.yesnoDialog(context,
'이전에 ${e.lastPage()}페이지까지 읽었던 기록이 있습니다. 이어서 읽을까요?', '기록')) {
if (await Dialogs.yesnoDialog(
context,
Translations.of(context)
.trans('recordmessage')
.replaceAll('%s', e.lastPage().toString()),
Translations.of(context).trans('record'))) {
scroll.jumpTo(page2Offset(e.lastPage() - 1));
}
}
Expand Down

0 comments on commit 816ba20

Please sign in to comment.