l10n: Update

This commit is contained in:
2024-05-05 16:34:38 +08:00
parent a8e88983e2
commit 8d2b4983c0
19 changed files with 2446 additions and 389 deletions

View File

@ -47,13 +47,13 @@ class RsiLauncherEnhanceDialogUI extends HookConsumerWidget {
final assarState = useState<RSILauncherStateData?>(null);
Future<void> readState() async {
workingText.value = "读取启动器信息...";
workingText.value = S.current.tools_rsi_launcher_enhance_init_msg1;
assarState.value = await _readState(context).unwrap(context: context);
if (assarState.value == null) {
workingText.value = "";
return;
}
workingText.value = "正在从网络获取增强数据...";
workingText.value = S.current.tools_rsi_launcher_enhance_init_msg2;
if (!context.mounted) return;
await _loadEnhanceData(context, ref, assarState)
.unwrap(context: context)
@ -71,10 +71,10 @@ class RsiLauncherEnhanceDialogUI extends HookConsumerWidget {
return;
}
if (!context.mounted) return;
workingText.value = "生成补丁 ...";
workingText.value = S.current.tools_rsi_launcher_enhance_working_msg1;
final newScript =
await _genNewScript(assarState).unwrap(context: context);
workingText.value = "安装补丁,这需要一点时间,取决于您的计算机性能 ...";
workingText.value = S.current.tools_rsi_launcher_enhance_working_msg2;
if (!context.mounted) return;
await assarState.value?.data
.writeMainJs(content: utf8.encode(newScript))
@ -99,7 +99,7 @@ class RsiLauncherEnhanceDialogUI extends HookConsumerWidget {
onPressed:
workingText.value.isEmpty ? Navigator.of(context).pop : null),
const SizedBox(width: 12),
const Text("RSI 启动器增强"),
Text(S.current.tools_rsi_launcher_enhance_title),
]),
content: AnimatedSize(
duration: const Duration(milliseconds: 130),
@ -126,14 +126,18 @@ class RsiLauncherEnhanceDialogUI extends HookConsumerWidget {
children: [
Expanded(
child: Text(
"启动器内部版本信息:${assarState.value?.version}",
S.current.tools_rsi_launcher_enhance_msg_version(
assarState.value?.version ?? ""),
style: TextStyle(
color: Colors.white.withOpacity(.6),
),
),
),
Text(
"补丁状态:${(assarState.value?.isPatchInstalled ?? false) ? "已安装" : "未安装"}",
S.current.tools_rsi_launcher_enhance_msg_patch_status(
(assarState.value?.isPatchInstalled ?? false)
? S.current.localization_info_installed
: S.current.tools_action_info_not_installed),
style: TextStyle(
color: Colors.white.withOpacity(.6),
),
@ -141,7 +145,7 @@ class RsiLauncherEnhanceDialogUI extends HookConsumerWidget {
],
),
if (assarState.value?.serverData.isEmpty ?? true) ...[
const Text("获取增强数据失败,可能是网络问题或当前版本不支持"),
Text(S.current.tools_rsi_launcher_enhance_msg_error),
] else ...[
const SizedBox(height: 24),
if (assarState.value?.enabledLocalization != null)
@ -158,10 +162,12 @@ class RsiLauncherEnhanceDialogUI extends HookConsumerWidget {
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
const Text("RSI 启动器本地化"),
Text(S.current
.tools_rsi_launcher_enhance_title_localization),
const SizedBox(height: 3),
Text(
"为 RSI 启动器增加多语言支持。",
S.current
.tools_rsi_launcher_enhance_subtitle_localization,
style: TextStyle(
fontSize: 13,
color: Colors.white.withOpacity(.6),
@ -198,10 +204,12 @@ class RsiLauncherEnhanceDialogUI extends HookConsumerWidget {
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
const Text("RSI 启动器下载增强"),
Text(S.current
.tools_rsi_launcher_enhance_title_download_booster),
const SizedBox(height: 3),
Text(
"下载游戏时可使用更多线程以提升下载速度,启用后请在启动器设置修改线程数。",
S.current
.tools_rsi_launcher_enhance_subtitle_download_booster,
style: TextStyle(
fontSize: 13,
color: Colors.white.withOpacity(.6),
@ -222,15 +230,16 @@ class RsiLauncherEnhanceDialogUI extends HookConsumerWidget {
Center(
child: FilledButton(
onPressed: doInstall,
child: const Padding(
padding:
EdgeInsets.symmetric(vertical: 4, horizontal: 6),
child: Text("安装增强补丁"),
child: Padding(
padding: const EdgeInsets.symmetric(
vertical: 4, horizontal: 6),
child: Text(S.current
.tools_rsi_launcher_enhance_action_install),
))),
],
const SizedBox(height: 16),
Text(
"* 如需卸载增强补丁,请覆盖安装 RSI 启动器。",
S.current.tools_rsi_launcher_enhance_msg_uninstall,
style: TextStyle(
color: Colors.white.withOpacity(.6), fontSize: 13),
),
@ -245,7 +254,8 @@ class RsiLauncherEnhanceDialogUI extends HookConsumerWidget {
final lPath = await SystemHelper.getRSILauncherPath(skipEXE: true);
if (lPath.isEmpty) {
if (!context.mounted) return null;
showToast(context, "未找到 RSI 启动器");
showToast(context,
S.current.tools_rsi_launcher_enhance_msg_error_launcher_notfound);
return null;
}
dPrint("[RsiLauncherEnhanceDialogUI] rsiLauncherPath ==== $lPath");
@ -259,7 +269,10 @@ class RsiLauncherEnhanceDialogUI extends HookConsumerWidget {
RegExp(r"main\.(\w+)\.js").firstMatch(data.mainJsPath)?.group(1);
if (version == null) {
if (!context.mounted) return null;
showToast(context, "读取启动器信息失败!");
showToast(
context,
S.current
.tools_rsi_launcher_enhance_msg_error_get_launcher_info_error);
return null;
}
dPrint(
@ -280,7 +293,8 @@ class RsiLauncherEnhanceDialogUI extends HookConsumerWidget {
);
} catch (e) {
if (!context.mounted) return null;
showToast(context, "读取启动器信息失败:$e");
showToast(context,
S.current.tools_rsi_launcher_enhance_msg_error_get_launcher_info_error_with_args(e));
return null;
}
}
@ -390,4 +404,4 @@ class RsiLauncherEnhanceDialogUI extends HookConsumerWidget {
}
return scriptBuffer.toString();
}
}
}

View File

@ -93,8 +93,8 @@ class ToolsUIModel extends _$ToolsUIModel {
),
ToolsItemData(
"rsilauncher_enhance_mod",
"RSI 启动器增强",
"启动器汉化,下载线程增强",
S.current.tools_rsi_launcher_enhance_title,
S.current.tools_action_rsi_launcher_enhance_info,
const Icon(FluentIcons.c_plus_plus, size: 24),
onTap: () => rsiEnhance(context),
),
@ -114,8 +114,8 @@ class ToolsUIModel extends _$ToolsUIModel {
),
ToolsItemData(
"unp4kc",
"P4K 查看器",
"解包星际公民 p4k 文件",
"${S.current.tools_action_unp4k}",
"${S.current.tools_action_unp4k_info}",
const Icon(FontAwesomeIcons.fileZipper, size: 24),
onTap: () => _unp4kc(context),
),
@ -596,15 +596,11 @@ class ToolsUIModel extends _$ToolsUIModel {
static rsiEnhance(BuildContext context) async {
final userOK = await showConfirmDialogs(
context,
"RSI 启动器增强使用须知",
const Column(
S.current.tools_rsi_launcher_enhance_note_title,
Column(
mainAxisSize: MainAxisSize.min,
children: [
Text(
"RSI 启动器增强是一项社区功能,它会在您的电脑上解包 \"RSI Launcher\" 并加入额外的增强功能,具体使用哪些功能由您决定。"
"\n\n目前官方CIG仅许可我们进行多语言操作启动器下载增强是我们认为有用的额外功能违反cig用户协议https://robertsspaceindustries.com/eula可能导致账号被封禁等严重后果是否启用由您自己决定我们不对可能产生的后果游戏损坏账号封禁等承担任何责任。"
"\n\n对于启动器的修改内容我们开源于https://github.com/StarCitizenToolBox/RSILauncherEnhance如有需要您可自行查阅。"
"\n\n如果您因为任何原因需要取消此增强补丁,请直接覆盖安装官方启动器。"),
Text(S.current.tools_rsi_launcher_enhance_note_msg),
],
),
constraints:
@ -623,4 +619,4 @@ class ToolsUIModel extends _$ToolsUIModel {
context: context,
builder: (BuildContext context) => const RsiLauncherEnhanceDialogUI());
}
}
}

View File

@ -20,7 +20,7 @@ class UnP4kcUI extends HookConsumerWidget {
final files = model.getFiles();
final paths = state.curPath.trim().split("\\");
return makeDefaultPage(context,
title: "P4K 查看器 -> ${model.getGamePath()}",
title: S.current.tools_unp4k_title(model.getGamePath()),
useBodyContainer: false,
content: state.files == null
? Column(
@ -187,8 +187,9 @@ class UnP4kcUI extends HookConsumerWidget {
Expanded(
child: Container(
child: state.tempOpenFile == null
? const Center(
child: Text("单击文件以预览"),
? Center(
child:
Text(S.current.tools_unp4k_view_file),
)
: state.tempOpenFile?.key == "loading"
? makeLoading(context)
@ -207,14 +208,19 @@ class UnP4kcUI extends HookConsumerWidget {
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
Text(
"未知文件类型\n${state.tempOpenFile?.value}"),
Text(S.current
.tools_unp4k_msg_unknown_file_type(
state.tempOpenFile
?.value ??
"")),
const SizedBox(height: 32),
FilledButton(
child: const Padding(
child: Padding(
padding:
EdgeInsets.all(4),
child: Text("打开文件夹"),
const EdgeInsets
.all(4),
child: Text(S.current
.action_open_folder),
),
onPressed: () {
SystemHelper.openDir(