Skip to content

Commit f057195

Browse files
committed
中文版本obs_blade
1 parent 2d3c4c4 commit f057195

File tree

98 files changed

+1228
-427
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

98 files changed

+1228
-427
lines changed

devtools_options.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
extensions:

lib/shared/dialogs/input.dart

+2-2
Original file line numberDiff line numberDiff line change
@@ -76,10 +76,10 @@ class _InputDialogState extends State<InputDialog> {
7676
actions: [
7777
DialogActionConfig(
7878
isDestructiveAction: true,
79-
child: const Text('Cancel'),
79+
child: const Text('取消'),
8080
),
8181
DialogActionConfig(
82-
child: const Text('Save'),
82+
child: const Text('保存'),
8383
popOnAction: false,
8484
onPressed: (_) {
8585
bool valid = true;

lib/shared/general/base/adaptive_dialog/adaptive_dialog.dart

+1-1
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ class _BaseAdaptiveDialogState extends State<BaseAdaptiveDialog> {
8585
type: MaterialType.transparency,
8686
child: BaseCheckbox(
8787
value: _isDontShowChecked,
88-
text: 'Don\'t show this again',
88+
text: '不要再显示此内容',
8989
smallText: true,
9090
materialTapTargetSize: MaterialTapTargetSize.shrinkWrap,
9191
onChanged: (checked) =>

lib/shared/general/connect_host_input.dart

+4-4
Original file line numberDiff line numberDiff line change
@@ -130,9 +130,9 @@ class _ConnectHostInputState extends State<ConnectHostInput> {
130130
)
131131
: null,
132132
labelText:
133-
!this.widget.domainMode ? 'IP Address (internal)' : 'Hostname',
133+
!this.widget.domainMode ? 'IP 地址(内网)' : '域名',
134134
placeholder:
135-
!this.widget.domainMode ? '192.168.178.10' : 'obs-stream.com',
135+
!this.widget.domainMode ? '192.168.1.10' : 'obs-stream.com',
136136
bottom: this.widget.manual
137137
? Row(
138138
children: [
@@ -141,7 +141,7 @@ class _ConnectHostInputState extends State<ConnectHostInput> {
141141
groupValue: this.widget.domainMode,
142142
children: const {
143143
false: Text('IP'),
144-
true: Text('Domain'),
144+
true: Text('域名'),
145145
},
146146
onValueChanged: (domainMode) {
147147
FocusManager.instance.primaryFocus?.unfocus();
@@ -156,7 +156,7 @@ class _ConnectHostInputState extends State<ConnectHostInput> {
156156
const SizedBox(width: 12.0),
157157
const QuestionMarkTooltip(
158158
message:
159-
'IP mode expects an IP address and is using "ws://" as the protocol scheme (standard way to connect to a local OBS instance), while Domain mode does not have any input validation and you can select the protocol scheme yourself.\n\n"-" means I provide no protocol scheme and you have to add it yourself. I highly recommend making use of "ws://" or "wss://" though since it\'s usually what WebSockets use.',
159+
'IP 模式需要 IP 地址,并使用“ws://”作为协议方案(连接到本地 OBS 实例的标准方式),而域名模式没有任何输入验证,您可以自己选择协议方案。\n\n“-”表示我没有提供协议方案,你必须自己添加。 我强烈建议使用“ws://”或“wss://”,因为 WebSocket 通常使用它。',
160160
),
161161
],
162162
// const SizedBox(width: 12.0),

lib/shared/general/social_block.dart

+3-3
Original file line numberDiff line numberDiff line change
@@ -68,16 +68,16 @@ class SocialBlock extends StatelessWidget {
6868
);
6969
}
7070
} else {
71-
throw 'Could not launch ${social.link}';
71+
throw '无法启动 ${social.link}';
7272
}
7373
} catch (_) {
7474
ModalHandler.showBaseDialog(
7575
context: context,
7676
barrierDismissible: true,
7777
dialogWidget: InfoDialog(
78-
title: 'Couldn\'t open link',
78+
title: '无法打开链接',
7979
body:
80-
'Couldn\'t open the following link on this device:\n\n${social.link}',
80+
'无法在此设备上打开以下链接:\n\n${social.link}',
8181
),
8282
);
8383
}

lib/stores/shared/network.dart

+3-3
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ abstract class _NetworkStore with Store {
8989
}
9090
} catch (e) {
9191
GeneralHelper.advLog(
92-
'Not possible to connect to ${connection.host}${connection.port != null ? (":${connection.port}") : ""}: $e',
92+
'无法连接到 ${connection.host}${connection.port != null ? (":${connection.port}") : ""}: $e',
9393
level: LogLevel.Error,
9494
includeInLogs: true,
9595
);
@@ -133,7 +133,7 @@ abstract class _NetworkStore with Store {
133133
},
134134
onDone: () {
135135
GeneralHelper.advLog(
136-
'Initial WebSocket connection done, close code: ${this.activeSession!.socket.closeCode}, {WebSocketCloseCode.values.firstWhere((closeCode) => closeCode.identifier == this.activeSession!.socket.closeCode, orElse: () => WebSocketCloseCode.UnknownReason).message}',
136+
'初始 WebSocket 连接完成,关闭代码: ${this.activeSession!.socket.closeCode}, {WebSocketCloseCode.values.firstWhere((closeCode) => closeCode.identifier == this.activeSession!.socket.closeCode, orElse: () => WebSocketCloseCode.UnknownReason).message}',
137137
);
138138

139139
authCompleter.complete(
@@ -145,7 +145,7 @@ abstract class _NetworkStore with Store {
145145
);
146146
},
147147
onError: (error) => GeneralHelper.advLog(
148-
'Error initial WebSocket connection (stores/shared/network.dart) | $error',
148+
'初始 WebSocket 连接出错 (stores/shared/network.dart) | $error',
149149
includeInLogs: true,
150150
),
151151
);

lib/stores/views/dashboard.dart

+11
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,13 @@ abstract class _DashboardStore with Store {
131131
/// are on top level and a custom [SceneItem.displayGroup] propertry
132132
/// toggles whether they will be displayed or not, but this makes
133133
/// searching and updating scene items easier
134+
/// WebSocket API 将返回所有顶级场景项
135+
/// 必须请求当前场景和组元素
136+
/// 单独。 为了更好地维护和使用场景项目,我
137+
/// 展平这些所有场景项目,甚至是组的子项目
138+
/// 位于顶层和自定义 [SceneItem.displayGroup] 属性
139+
/// 切换它们是否显示,但这使得
140+
/// 搜索和更新场景项更容易
134141
@observable
135142
ObservableList<SceneItem> currentSceneItems = ObservableList();
136143

@@ -374,6 +381,10 @@ abstract class _DashboardStore with Store {
374381
/// of the batch request capabilities every second since we don't receive
375382
/// a status event every 2 seconds (as it was prior OBS WebSocket 4.9.1 and
376383
/// below)
384+
/// 通过使用定期轮询 OBS、流和记录统计信息
385+
/// 每秒的批量请求能力,因为我们没有收到
386+
/// 每 2 秒一个状态事件(因为这是之前的 OBS WebSocket 4.9.1 和
387+
/// 以下)
377388
void _periodicStatsRequest() {
378389
_getStatsTimer?.cancel();
379390
_getStatsTimer = Timer.periodic(

lib/stores/views/home.dart

+3-3
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ enum ConnectMode {
1212
Manual;
1313

1414
String get text => {
15-
ConnectMode.Autodiscover: 'Autodiscover',
16-
ConnectMode.QR: 'Quick Connect',
17-
ConnectMode.Manual: 'Manual',
15+
ConnectMode.Autodiscover: '自动查找',
16+
ConnectMode.QR: '扫描二维码',
17+
ConnectMode.Manual: '手动输入',
1818
}[this]!;
1919
}
2020

lib/types/enums/order.dart

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ enum Order {
55

66
extension FilterOrderFunctions on Order {
77
String get text => const {
8-
Order.Ascending: 'Asc.',
9-
Order.Descending: 'Desc.',
8+
Order.Ascending: '升序.',
9+
Order.Descending: '倒序.',
1010
}[this]!;
1111
}

lib/utils/routing_helper.dart

+3-3
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,9 @@ enum Tabs {
5050
/// current and new tabs will automatically generated / changed
5151
extension TabsFunctions on Tabs {
5252
String get name => const {
53-
Tabs.Home: 'Home',
54-
Tabs.Statistics: 'Statistics',
55-
Tabs.Settings: 'Settings',
53+
Tabs.Home: '主页',
54+
Tabs.Statistics: '统计数据',
55+
Tabs.Settings: '设置',
5656
}[this]!;
5757

5858
IconData get icon => const {

lib/utils/validation_helper.dart

+5-5
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,16 @@ class ValidationHelper {
66
static String? minLengthValidator(String? text, [int minLength = 1]) =>
77
text == null || text.length < minLength
88
? (minLength == 1
9-
? 'Input may not be empty!'
10-
: 'Input needs at least $minLength characters!')
9+
? '输入不能为空!'
10+
: '输入至少需要 $minLength !')
1111
: null;
1212

1313
static String? portValidator(String? text) {
1414
int? port = int.tryParse(text ?? '');
1515
if (port != null && port > 0 && port <= 65535) {
1616
return null;
1717
}
18-
return 'Invalid port';
18+
return '端口无效';
1919
}
2020

2121
static String? ipValidator(String? text) {
@@ -29,7 +29,7 @@ class ValidationHelper {
2929
int.parse(part) <= 255)) {
3030
return null;
3131
}
32-
return 'Not an IP address!';
32+
return '不是 IP 地址!';
3333
}
3434

3535
static String? colorHexValidator(String? text, {bool useAlpha = false}) {
@@ -38,7 +38,7 @@ class ValidationHelper {
3838
(RegExp(r'^[a-fA-F0-9]+$').allMatches(text).isNotEmpty)) {
3939
return null;
4040
}
41-
return 'Not a valid color hex code!';
41+
return '颜色十六进制代码无效!';
4242
}
4343

4444
static String? colorTypeValidator(String? text, ColorType type) {

lib/views/dashboard/widgets/dashboard_content/dashboard_content.dart

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ class DashboardContent extends StatelessWidget {
2323
padding: const EdgeInsets.only(left: 8.0),
2424
alignment: Alignment.centerLeft,
2525
child: Text(
26-
'Widgets',
26+
'小部件',
2727
style: Theme.of(context).textTheme.headlineMedium,
2828
),
2929
),

lib/views/dashboard/widgets/dialogs/save_edit_connection.dart

+4-4
Original file line numberDiff line numberDiff line change
@@ -23,20 +23,20 @@ class SaveEditConnectionDialog extends StatelessWidget {
2323

2424
Box<Connection> box = Hive.box<Connection>(HiveKeys.SavedConnections.name);
2525
return InputDialog(
26-
title: '${this.newConnection ? 'Save' : 'Edit'} Connection',
26+
title: '${this.newConnection ? '保存' : '取消'} Connection',
2727
body:
28-
'Please choose a name for the connection so you can recognize it later on',
28+
'请为连接设置一个名称,以便您以后识别',
2929
inputText: networkStore.activeSession!.connection.name,
3030
inputPlaceholder: 'Name of the connection',
3131
inputCheck: (name) {
3232
name = name?.trim();
3333
if (name?.isEmpty ?? false) {
34-
return 'Please provide a name!';
34+
return '请提供名称!';
3535
}
3636
if (box.values.any((connection) =>
3737
name != networkStore.activeSession!.connection.name &&
3838
connection.name == name)) {
39-
return 'Name already used!';
39+
return '名称已被使用!';
4040
}
4141
return null;
4242
},

lib/views/dashboard/widgets/obs_widgets/obs_widgets.dart

+4-4
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ class OBSWidgets extends StatelessWidget {
1313
crossAxisAlignment: CrossAxisAlignment.start,
1414
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
1515
children: [
16-
Flexible(
16+
/* Flexible(
1717
child: BaseCard(
18-
title: 'Chat',
18+
title: '聊天',
1919
rightPadding: 12.0,
2020
paddingChild: EdgeInsets.all(0),
2121
child: SizedBox(
@@ -25,10 +25,10 @@ class OBSWidgets extends StatelessWidget {
2525
),
2626
),
2727
),
28-
),
28+
), */
2929
Flexible(
3030
child: BaseCard(
31-
title: 'Stats',
31+
title: '统计数据',
3232
leftPadding: 12.0,
3333
paddingChild: EdgeInsets.all(0),
3434
child: SizedBox(

lib/views/dashboard/widgets/obs_widgets/obs_widgets_mobile.dart

+2-2
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,10 @@ class OBSWidgetsMobile extends StatelessWidget {
2323
child: const TabBar(
2424
tabs: [
2525
Tab(
26-
child: Text('Chat'),
26+
child: Text('聊天'),
2727
),
2828
Tab(
29-
child: Text('Stats'),
29+
child: Text('统计数据'),
3030
)
3131
],
3232
),

0 commit comments

Comments
 (0)