feat(apps): 重构 UI 架构为 presentation 层并新增 l10n 国际化支持
This commit is contained in:
@@ -2,7 +2,8 @@ import 'dart:typed_data';
|
||||
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:image_picker/image_picker.dart';
|
||||
import 'package:social_app/core/api/i_api_client.dart';
|
||||
import 'package:social_app/core/network/i_api_client.dart';
|
||||
import 'package:social_app/core/l10n/l10n.dart';
|
||||
|
||||
import '../../data/models/ag_ui_event.dart';
|
||||
import '../../data/models/chat_list_item.dart';
|
||||
@@ -130,7 +131,9 @@ class ChatBloc extends Cubit<ChatState> {
|
||||
).copyWith(
|
||||
items: _markActiveToolCallsFailed(
|
||||
state.items,
|
||||
reason: isCanceledByUser ? '本次运行已取消' : '本次运行已失败',
|
||||
reason: isCanceledByUser
|
||||
? L10n.current.chatRunCanceled
|
||||
: L10n.current.chatRunFailed,
|
||||
),
|
||||
),
|
||||
);
|
||||
@@ -428,7 +431,9 @@ class ChatBloc extends Cubit<ChatState> {
|
||||
isCancelling: false,
|
||||
currentStage: null,
|
||||
error: sseClosedBeforeTerminal
|
||||
? (recoveredFromHistory ? null : '连接中断,请重试')
|
||||
? (recoveredFromHistory
|
||||
? null
|
||||
: L10n.current.chatSseInterruptedRetry)
|
||||
: error.toString(),
|
||||
),
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user