diff --git a/assets/i18n/en.json b/assets/i18n/en.json index 4cb1d3db..db222fcb 100644 --- a/assets/i18n/en.json +++ b/assets/i18n/en.json @@ -41,7 +41,8 @@ "continue-watching": "Continue", "favorite": "Favorite", "no-record": "No favorites or viewing records", - "watched": "Watched {ep}" + "watched": "Watched {ep}", + "favorite-all": "All {type} favourites" }, "search": { "hint-text": "Please use search wisely!~", diff --git a/assets/i18n/zh.json b/assets/i18n/zh.json index f59438eb..8d8fbc2b 100644 --- a/assets/i18n/zh.json +++ b/assets/i18n/zh.json @@ -29,7 +29,8 @@ "continue-watching": "继续观看", "favorite": "收藏", "no-record": "暂无收藏和观看记录", - "watched": "看到 {ep}" + "watched": "看到 {ep}", + "favorite-all": "所有{type}收藏" }, "search": { "hint-text": "请善用搜索哦!~", diff --git a/lib/views/pages/favorites_page.dart b/lib/views/pages/favorites_page.dart index fc5cc363..32b461d4 100644 --- a/lib/views/pages/favorites_page.dart +++ b/lib/views/pages/favorites_page.dart @@ -1,5 +1,6 @@ import 'package:fluent_ui/fluent_ui.dart' as fluent; import 'package:flutter/material.dart'; +import 'package:flutter_i18n/flutter_i18n.dart'; import 'package:miru_app/models/index.dart'; import 'package:miru_app/data/services/database_service.dart'; import 'package:miru_app/utils/extension.dart'; @@ -20,9 +21,16 @@ class _FavoritesPageState extends fluent.State { Widget _buildAndroid(BuildContext context) { return Scaffold( appBar: AppBar( - title: Text( - "${ExtensionUtils.typeToString(widget.type)}${"home.favorite".i18n}", - )), + title: Text( + FlutterI18n.translate( + context, + "home.favorite-all", + translationParams: { + "type": ExtensionUtils.typeToString(widget.type).toLowerCase(), + }, + ), + ), + ), body: FutureBuilder( future: DatabaseService.getFavoritesByType(type: widget.type), builder: ((context, snapshot) { @@ -84,7 +92,14 @@ class _FavoritesPageState extends fluent.State { Expanded( flex: 2, child: Text( - "${ExtensionUtils.typeToString(widget.type)}${"home.favorite".i18n}", + FlutterI18n.translate( + context, + "home.favorite-all", + translationParams: { + "type": ExtensionUtils.typeToString(widget.type) + .toLowerCase(), + }, + ), style: fluent.FluentTheme.of(context).typography.subtitle, ), ),