From 6702904ad65d88c33c26cbdeff47de84f3e15b7b Mon Sep 17 00:00:00 2001 From: Natsu <natsume@natsume.io> Date: Mon, 1 Jul 2024 13:45:48 +0700 Subject: [PATCH] =?UTF-8?q?feat(about=5Fcontributors=5Fzh=5Fcn.json):=20ad?= =?UTF-8?q?d=20about=5Fcontributors=5Fzh=5Fcn.json=20file=20with=20plugin?= =?UTF-8?q?=20repository=20and=20main=20contributors=20information=20fix(A?= =?UTF-8?q?ctivityExtends.kt):=20change=20toast=20message=20from=20"?= =?UTF-8?q?=E6=A3=80=E6=B5=8B=E5=88=B0=E7=AC=AC=E4=B8=80=E6=AC=A1=E5=90=AF?= =?UTF-8?q?=E5=8A=A8=EF=BC=8C=E5=88=9D=E5=A7=8B=E5=8C=96=E9=85=8D=E7=BD=AE?= =?UTF-8?q?=E6=96=87=E4=BB=B6..."=20to=20"Initializing=20configuration=20f?= =?UTF-8?q?iles..."=20fix(FileHotUpdater.kt):=20change=20log=20message=20f?= =?UTF-8?q?rom=20"getZipResourcePath=20failed."=20to=20"getZipResourcePath?= =?UTF-8?q?=20failed"=20fix(FileHotUpdater.kt):=20change=20toast=20message?= =?UTF-8?q?=20from=20"Update=20success."=20to=20"Update=20Success"=20feat(?= =?UTF-8?q?strings.xml):=20add=20strings.xml=20file=20with=20Chinese=20tra?= =?UTF-8?q?nslations=20for=20various=20strings?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/assets/about_contributors_zh_cn.json | 29 +++++++ .../gakumas/localify/ActivityExtends.kt | 2 +- .../localify/hookUtils/FileHotUpdater.kt | 6 +- app/src/main/res/values-zh-rCN/strings.xml | 78 +++++++++++++++++++ 4 files changed, 111 insertions(+), 4 deletions(-) create mode 100644 app/src/main/assets/about_contributors_zh_cn.json create mode 100644 app/src/main/res/values-zh-rCN/strings.xml diff --git a/app/src/main/assets/about_contributors_zh_cn.json b/app/src/main/assets/about_contributors_zh_cn.json new file mode 100644 index 0000000..d825d11 --- /dev/null +++ b/app/src/main/assets/about_contributors_zh_cn.json @@ -0,0 +1,29 @@ +{ + "plugin_repo": "https://github.com/chinosk6/gakuen-imas-localify", + "main_contributors": [ + { + "name": "chinosk(插件本体)", + "links": [ + {"name": "Github", "link": "https://github.com/chinosk6"}, + {"name": "Bilibili", "link": "https://space.bilibili.com/287061163"} + ] + }, + { + "name": "DarwinTree(译文工作流)", + "links": [ + {"name": "Github", "link": "https://github.com/darwintree"}, + {"name": "Bilibili", "link": "https://space.bilibili.com/6069705"} + ] + }, + { + "name": "以及其他所有翻译贡献者", + "links": [ + {"name": "Github", "link": "https://github.com/chinosk6/GakumasTranslationData/graphs/contributors"} + ] + } + ], + "contrib_img": { + "plugin": "https://contrib.rocks/image?repo=chinosk6/gakuen-imas-localify", + "translation": "https://contrib.rocks/image?repo=chinosk6/GakumasTranslationData" + } +} \ No newline at end of file diff --git a/app/src/main/java/io/github/chinosk/gakumas/localify/ActivityExtends.kt b/app/src/main/java/io/github/chinosk/gakumas/localify/ActivityExtends.kt index 55c5c37..64512bc 100644 --- a/app/src/main/java/io/github/chinosk/gakumas/localify/ActivityExtends.kt +++ b/app/src/main/java/io/github/chinosk/gakumas/localify/ActivityExtends.kt @@ -27,7 +27,7 @@ fun <T> T.getConfigContent(): String where T : Activity { return if (configFile.exists()) { configFile.readText() } else { - Toast.makeText(this, "检测到第一次启动,初始化配置文件...", Toast.LENGTH_SHORT).show() + Toast.makeText(this, "Initializing configuration files...", Toast.LENGTH_SHORT).show() configFile.writeText("{}") "{}" } diff --git a/app/src/main/java/io/github/chinosk/gakumas/localify/hookUtils/FileHotUpdater.kt b/app/src/main/java/io/github/chinosk/gakumas/localify/hookUtils/FileHotUpdater.kt index b96dc99..1eb802d 100644 --- a/app/src/main/java/io/github/chinosk/gakumas/localify/hookUtils/FileHotUpdater.kt +++ b/app/src/main/java/io/github/chinosk/gakumas/localify/hookUtils/FileHotUpdater.kt @@ -144,7 +144,7 @@ object FileHotUpdater { activity.contentResolver.openInputStream(zipFileUri).use { basePath = it?.let { getZipResourcePath(it) } if (basePath == null) { - Log.e(TAG, "getZipResourcePath failed.") + Log.e(TAG, "getZipResourcePath failed") return@updateFilesFromZip } } @@ -163,14 +163,14 @@ object FileHotUpdater { if (deleteAfterUpdate) { activity.contentResolver.delete(zipFileUri, null, null) } - GakumasHookMain.showToast("Update success.") + GakumasHookMain.showToast("Update Success") } } } catch (e: java.io.FileNotFoundException) { Log.i(TAG, "updateFilesFromZip - file not found: $e") - GakumasHookMain.showToast("Update file not found.") + GakumasHookMain.showToast("Update file not found") } catch (e: Exception) { Log.e(TAG, "updateFilesFromZip failed: $e") diff --git a/app/src/main/res/values-zh-rCN/strings.xml b/app/src/main/res/values-zh-rCN/strings.xml new file mode 100644 index 0000000..9d845c1 --- /dev/null +++ b/app/src/main/res/values-zh-rCN/strings.xml @@ -0,0 +1,78 @@ +<resources> + <string name="app_name">Gakumas Localify</string> + <string name="gakumas_localify">Gakumas Localify</string> + <string name="enable_plugin">启用插件 (不可热重载)</string> + <string name="enable_free_camera">启用自由视角(可热重载; 需使用实体键盘)</string> + <string name="start_game">以上述配置启动游戏/重载配置</string> + <string name="setFpsTitle">最大 FPS (0 为保持游戏原设置)</string> + <string name="unlockAllLive">解锁所有 Live</string> + <string name="liveUseCustomeDress">Live 使用自定义角色</string> + <string name="live_costume_head_id">Live 自定义头部 ID (例: costume_head_hski-cstm-0002)</string> + <string name="live_custome_dress_id">Live 自定义服装 ID (例: hski-cstm-0002)</string> + <string name="useCustomeGraphicSettings">使用自定义画质设置</string> + <string name="renderscale">RenderScale (0.5/0.59/0.67/0.77/1.0)</string> + <string name="text_hook_test_mode">文本 hook 测试模式</string> + <string name="export_text">导出文本</string> + <string name="force_export_resource">启动后强制导出资源</string> + <string name="max_high">极高</string> + <string name="very_high">超高</string> + <string name="hign">高</string> + <string name="middle">中</string> + <string name="low">低</string> + <string name="orientation_orig">原版</string> + <string name="orientation_portrait">竖屏</string> + <string name="orientation_landscape">横屏</string> + <string name="orientation_lock">方向锁定</string> + <string name="enable_breast_param">启用胸部参数</string> + <string name="damping">阻尼 (Damping)</string> + <string name="stiffness">刚度 (Stiffness)</string> + <string name="spring">弹簧系数 (Spring)</string> + <string name="pendulum">钟摆系数 (Pendulum)</string> + <string name="pendulumrange">钟摆范围 (PendulumRange)</string> + <string name="average">Average</string> + <string name="rootweight">RootWeight</string> + <string name="uselimit_0_1">范围限制倍率 (0 为不限制, 1 为原版)</string> + <string name="usearmcorrection">使用手臂矫正</string> + <string name="isdirty">IsDirty</string> + <string name="usescale">应用缩放</string> + <string name="breast_scale">胸部缩放倍率</string> + <string name="uselimitmultiplier">启用范围限制倍率</string> + <string name="axisx_x">axisX.x</string> + <string name="axisy_x">axisY.x</string> + <string name="axisz_x">axisZ.x</string> + <string name="axisx_y">axisX.y</string> + <string name="axisy_y">axisY.y</string> + <string name="axisz_y">axisZ.y</string> + <string name="basic_settings">基础设置</string> + <string name="graphic_settings">画面设置</string> + <string name="camera_settings">摄像机设置</string> + <string name="test_mode_live">测试模式 - LIVE</string> + <string name="debug_settings">调试设置</string> + <string name="breast_param">胸部参数</string> + <string name="about">关于</string> + <string name="home">主页</string> + <string name="advanced_settings">高级设置</string> + <string name="about_warn_title">使用前警告</string> + <string name="about_warn_p1">本插件仅供学习和交流使用。</string> + <string name="about_warn_p2">使用外部插件属于违反游戏条款的行为。若使用插件后账号被封禁,造成的后果由用户自行承担。</string> + <string name="about_about_title">关于本插件</string> + <string name="about_about_p1">本插件完全免费。若您付费购买了本插件,请举报店家。</string> + <string name="about_about_p2">插件交流群: 975854705</string> + <string name="project_contribution">项目贡献</string> + <string name="plugin_code">插件本体</string> + <string name="contributors">贡献者列表</string> + <string name="translation_repository">译文仓库</string> + <string name="resource_settings">资源设置</string> + <string name="check_built_in_resource">检查内置数据更新</string> + <string name="delete_plugin_resource">清除游戏目录内的插件资源</string> + <string name="use_remote_zip_resource">使用远程 ZIP 数据</string> + <string name="resource_url">资源地址</string> + <string name="download">下载</string> + <string name="invalid_zip_file">文件解析失败</string> + <string name="invalid_zip_file_warn">此文件不是一个有效的 ZIP 翻译资源包</string> + <string name="cancel">取消</string> + <string name="downloaded_resource_version">已下载资源版本</string> + <string name="del_remote_after_update">替换文件后删除下载缓存</string> + + <string name="about_contributors_asset_file">about_contributors_zh_cn.json</string> +</resources> \ No newline at end of file