Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/bean/card/bangumi_history_card.dart
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ class _BangumiHistoryCardVState extends State<BangumiHistoryCardV> {
),
const SizedBox(width: 4),
Flexible(
child: Text(
child: TranslatedText(
episodeText,
style: theme.textTheme.bodySmall?.copyWith(
color: colorScheme.onSurfaceVariant,
Expand Down
7 changes: 4 additions & 3 deletions lib/bean/card/character_card.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import 'package:flutter/material.dart';
import 'package:kazumi/bean/widget/translated_text.dart';
import 'package:kazumi/modules/characters/character_item.dart';
import 'package:kazumi/pages/info/character_page.dart';
import 'package:kazumi/utils/device.dart';
Expand All @@ -19,15 +20,15 @@ class CharacterCard extends StatelessWidget {
? NetworkImage('https://bangumi.tv/img/info_only.png')
: NetworkImage(characterItem.avator.grid),
),
title: Text(
title: TranslatedText(
characterItem.name,
overflow: TextOverflow.ellipsis,
maxLines: 1,
),
subtitle: characterItem.actorList.isNotEmpty
? Text(characterItem.actorList[0].name)
? TranslatedText(characterItem.actorList[0].name)
: null,
trailing: Text(characterItem.relation),
trailing: TranslatedText(characterItem.relation),
onTap: () {
showModalBottomSheet(
isScrollControlled: true,
Expand Down
3 changes: 2 additions & 1 deletion lib/bean/card/comments_card.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import 'package:flutter/material.dart';
import 'package:kazumi/bean/widget/translated_text.dart';
import 'package:kazumi/modules/comments/comment_item.dart';
import 'package:flutter_rating_bar/flutter_rating_bar.dart';
import 'package:skeletonizer/skeletonizer.dart';
Expand Down Expand Up @@ -110,7 +111,7 @@ class CommentsCard extends StatelessWidget {
],
),
const SizedBox(height: 8),
Text(commentItem!.comment.comment),
TranslatedText(commentItem!.comment.comment),
],
),
),
Expand Down
7 changes: 4 additions & 3 deletions lib/bean/card/staff_card.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import 'package:flutter/material.dart';
import 'package:kazumi/bean/widget/translated_text.dart';
import 'package:kazumi/modules/staff/staff_item.dart';

class StaffCard extends StatelessWidget {
Expand All @@ -17,15 +18,15 @@ class StaffCard extends StatelessWidget {
? NetworkImage('https://bangumi.tv/img/info_only.png')
: NetworkImage(staffFullItem.staff.images!.grid),
),
title: Text(
title: TranslatedText(
staffFullItem.staff.name,
overflow: TextOverflow.ellipsis,
maxLines: 1,
),
subtitle: staffFullItem.staff.nameCN.isNotEmpty
? Text(staffFullItem.staff.nameCN)
? TranslatedText(staffFullItem.staff.nameCN)
: null,
trailing: Text(staffFullItem.positions.isNotEmpty
trailing: TranslatedText(staffFullItem.positions.isNotEmpty
? (staffFullItem.positions[0].type.cn)
: ''),
);
Expand Down
3 changes: 2 additions & 1 deletion lib/pages/download/download_episode_sheet.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import 'package:flutter/material.dart';
import 'package:flutter_modular/flutter_modular.dart';
import 'package:kazumi/bean/dialog/dialog_helper.dart';
import 'package:kazumi/bean/widget/translated_text.dart';
import 'package:kazumi/modules/download/download_module.dart';
import 'package:kazumi/modules/roads/road_module.dart';
import 'package:kazumi/pages/download/download_controller.dart';
Expand Down Expand Up @@ -152,7 +153,7 @@ class _DownloadEpisodeSheetState extends State<DownloadEpisodeSheet> {
child: Padding(
padding:
const EdgeInsets.symmetric(horizontal: 8),
child: Text(
child: TranslatedText(
identifier,
maxLines: 2,
overflow: TextOverflow.ellipsis,
Expand Down
5 changes: 3 additions & 2 deletions lib/pages/download/download_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import 'package:flutter_mobx/flutter_mobx.dart';
import 'package:flutter_modular/flutter_modular.dart';
import 'package:kazumi/bean/appbar/sys_app_bar.dart';
import 'package:kazumi/bean/dialog/dialog_helper.dart';
import 'package:kazumi/bean/widget/translated_text.dart';
import 'package:kazumi/modules/download/download_module.dart';
import 'package:kazumi/modules/bangumi/bangumi_item.dart';
import 'package:kazumi/pages/download/download_controller.dart';
Expand Down Expand Up @@ -101,7 +102,7 @@ class _DownloadPageState extends State<DownloadPage> {
),
),
),
title: Text(
title: TranslatedText(
record.bangumiName,
maxLines: 1,
overflow: TextOverflow.ellipsis,
Expand Down Expand Up @@ -158,7 +159,7 @@ class _DownloadPageState extends State<DownloadPage> {
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
TranslatedText(
episode.episodeName.isNotEmpty
? episode.episodeName
: 'Ep ${episode.episodeNumber}',
Expand Down
9 changes: 5 additions & 4 deletions lib/pages/info/character_page.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import 'dart:ui';
import 'package:flutter/material.dart';
import 'package:kazumi/bean/widget/translated_text.dart';
import 'package:kazumi/modules/character/character_full_item.dart';
import 'package:kazumi/modules/comments/comment_item.dart';
import 'package:kazumi/request/apis/bangumi_api.dart';
Expand Down Expand Up @@ -153,7 +154,7 @@ class _CharacterPageState extends State<CharacterPage> {
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Text(
TranslatedText(
characterFullItem.name,
style: Theme.of(context)
.textTheme
Expand All @@ -170,7 +171,7 @@ class _CharacterPageState extends State<CharacterPage> {
Padding(
padding: const EdgeInsets.only(
top: 4.0, bottom: 12.0),
child: Text(
child: TranslatedText(
characterFullItem.nameCN,
style: Theme.of(context)
.textTheme
Expand All @@ -194,7 +195,7 @@ class _CharacterPageState extends State<CharacterPage> {
),
),
),
Text(
TranslatedText(
characterFullItem.info,
style: Theme.of(context)
.textTheme
Expand All @@ -215,7 +216,7 @@ class _CharacterPageState extends State<CharacterPage> {
),
),
),
Text(
TranslatedText(
characterFullItem.summary,
style: Theme.of(context)
.textTheme
Expand Down
3 changes: 2 additions & 1 deletion lib/pages/info/info_tabview.dart
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import 'package:kazumi/modules/characters/character_item.dart';
import 'package:kazumi/modules/staff/staff_item.dart';
import 'package:kazumi/utils/device.dart';
import 'package:kazumi/services/translation/translation_service.dart';
import 'package:kazumi/bean/widget/translated_text.dart';

class InfoTabView extends StatefulWidget {
const InfoTabView({
Expand Down Expand Up @@ -192,7 +193,7 @@ class _InfoTabViewState extends State<InfoTabView>
label: Row(
mainAxisSize: MainAxisSize.min,
children: [
Text('${widget.bangumiItem.tags[index].name} '),
TranslatedText('${widget.bangumiItem.tags[index].name} '),
Text(
'${widget.bangumiItem.tags[index].count}',
style: TextStyle(
Expand Down
5 changes: 3 additions & 2 deletions lib/pages/info/source_sheet.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import 'package:flutter/material.dart';
import 'package:flutter_mobx/flutter_mobx.dart';
import 'package:flutter_modular/flutter_modular.dart';
import 'package:kazumi/bean/widget/translated_text.dart';
import 'package:kazumi/pages/info/info_controller.dart';
import 'package:kazumi/services/logging/logger.dart';
import 'package:kazumi/bean/dialog/dialog_helper.dart';
Expand Down Expand Up @@ -591,7 +592,7 @@ class _SourceSheetState extends State<SourceSheet>
},
child: Padding(
padding: const EdgeInsets.all(20),
child: Text(searchItem.name),
child: TranslatedText(searchItem.name),
),
),
),
Expand Down Expand Up @@ -814,7 +815,7 @@ class _AliasDialogState extends State<_AliasDialog> {
final index = entry.key;
final alias = entry.value;
return ListTile(
title: Text(alias),
title: TranslatedText(alias),
trailing: IconButton(
onPressed: () {
KazumiDialog.show(
Expand Down
7 changes: 4 additions & 3 deletions lib/pages/player/episode_comments_sheet.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import 'package:flutter_modular/flutter_modular.dart';
import 'package:kazumi/bean/dialog/dialog_helper.dart';
import 'package:kazumi/bean/card/episode_comments_card.dart';
import 'package:kazumi/bean/widget/error_widget.dart';
import 'package:kazumi/bean/widget/translated_text.dart';
import 'package:kazumi/modules/bangumi/episode_item.dart';
import 'package:kazumi/pages/video/video_controller.dart';
import 'package:kazumi/request/apis/bangumi_api.dart';
Expand Down Expand Up @@ -159,13 +160,13 @@ class _EpisodeCommentsSheetState extends State<EpisodeCommentsSheet> {
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
TranslatedText(
'${videoPageController.episodeInfo.readType()}.${videoPageController.episodeInfo.episode} ${videoPageController.episodeInfo.name}',
overflow: TextOverflow.ellipsis,
style: TextStyle(
fontSize: 12,
color: Theme.of(context).colorScheme.outline)),
Text(
TranslatedText(
(videoPageController.episodeInfo.nameCn != '')
? '${videoPageController.episodeInfo.readType()}.${videoPageController.episodeInfo.episode} ${videoPageController.episodeInfo.nameCn}'
: '${videoPageController.episodeInfo.readType()}.${videoPageController.episodeInfo.episode} ${videoPageController.episodeInfo.name}',
Expand Down Expand Up @@ -256,7 +257,7 @@ class _EpisodeCommentsSheetState extends State<EpisodeCommentsSheet> {
final bool selected = index + 1 == selectedEpisode;
return ListTile(
selected: selected,
title: Text(
title: TranslatedText(
episodeTitle.isEmpty
? episodeText
: '$episodeText $episodeTitle',
Expand Down
3 changes: 2 additions & 1 deletion lib/pages/search/image_search_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import 'package:image_picker/image_picker.dart';
import 'package:kazumi/bean/appbar/sys_app_bar.dart';
import 'package:kazumi/bean/card/network_img_layer.dart';
import 'package:kazumi/bean/dialog/dialog_helper.dart';
import 'package:kazumi/bean/widget/translated_text.dart';
import 'package:kazumi/modules/search/image_search_module.dart';
import 'package:kazumi/pages/search/search_controller.dart';
import 'package:kazumi/utils/constants.dart';
Expand Down Expand Up @@ -638,7 +639,7 @@ class _ImageSearchPageState extends State<ImageSearchPage> {
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
TranslatedText(
_formatTraceResultTitle(result),
maxLines: 1,
overflow: TextOverflow.ellipsis,
Expand Down
5 changes: 3 additions & 2 deletions lib/pages/video/video_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import 'dart:async';
import 'package:canvas_danmaku/models/danmaku_content_item.dart';
import 'package:flutter/material.dart';
import 'package:flutter_modular/flutter_modular.dart';
import 'package:kazumi/bean/widget/translated_text.dart';
import 'package:kazumi/pages/player/player_controller.dart';
import 'package:kazumi/pages/video/video_controller.dart';
import 'package:kazumi/pages/history/history_controller.dart';
Expand Down Expand Up @@ -905,7 +906,7 @@ class _VideoPageState extends State<VideoPage>
children: [
const Text(' Collection '),
Expanded(
child: Text(
child: TranslatedText(
videoPageController.title,
overflow: TextOverflow.ellipsis,
style: TextStyle(
Expand Down Expand Up @@ -1075,7 +1076,7 @@ class _VideoPageState extends State<VideoPage>
const SizedBox(width: 6)
],
Expanded(
child: Text(
child: TranslatedText(
road.identifier[count0 - 1],
maxLines: 2,
overflow: TextOverflow.ellipsis,
Expand Down
Loading