Skip to content

feat: Complete Chinese (zh-CN) translation & fix SDK 37 crash - #278

Closed
power690 wants to merge 1 commit into
AndroidCSOfficial:devfrom
power690:feat/chinese-translation-sdk37-fix
Closed

power690 wants to merge 1 commit into
AndroidCSOfficial:devfrom
power690:feat/chinese-translation-sdk37-fix

Conversation

@power690

Copy link
Copy Markdown

-为Kotlin/Java代码中的硬编码字符串增加了100多个中文字符串资源
-修复SDK37版本格式的ApiVersionsParser.kt:.toInt()->.toDouble().toInt()
-修复了IDESyncIssue.kt:删除了对已删除StringOption.AAPT2_FROM_MAVEN_OVERRIDE的依赖关系
-修复了logwire JVM目标不匹配问题(Java11->17)
-添加了缺少的生成逻辑源文件(BuildConfig、SigningConfig、PropertiesParser)
-新增遗失的动作类别(ProjectSyncAction、QuickRunWithCancellationAction、RunTasksAction)
-修复了缺少R导入的模板文件
-修复了各种可空上下文和未解决的引用问题

- Added 100+ Chinese string resources for hardcoded strings in Kotlin/Java code
- Fixed ApiVersionsParser.kt: .toInt() -> .toDouble().toInt() for SDK 37 version format
- Fixed IDESyncIssue.kt: removed dependency on removed StringOption.AAPT2_FROM_MAVEN_OVERRIDE
- Fixed logwire JVM target mismatch (Java 11 -> 17)
- Added missing build-logic source files (BuildConfig, SigningConfig, PropertiesParser)
- Added missing action classes (ProjectSyncAction, QuickRunWithCancellationAction, RunTasksAction)
- Fixed template files missing R import
- Fixed various nullable context and unresolved reference issues
@power690 power690 closed this by deleting the head repository Jun 9, 2026
706412584 added a commit to 706412584/android-code-studio that referenced this pull request Oct 15, 2026
新版 SDK 把 api-versions.xml 的 since/deprecated/removed 写成 major.minor
(android-36.1 有 438 处、android-37.2 有 2801 处,如 since="37.2")。
原实现 `.toInt()` 直接抛 NumberFormatException,沿
AndroidModule.getApiVersions() → readResources() → ProjectManagerImpl 的 async
向上传播,整个项目同步失败。

改动:
- 解析拆出 major/minor 两段,`ApiVersion` 新增 sinceMinor/deprecatedMinor/removedMinor
- 缓存 key 从打包 int((since shl 16) or ...)换成 data class——打包 int 容不下
  次版本号,37.0 与 37.2 会碰撞
- 顺手加固 `<api version>` 属性(同一类 `.toInt()`,未来 version="4.1" 会重演)
- 显示层 `%d`→`%s` 并新增 formatSince/formatDeprecatedIn/formatRemovedIn,
  13 个 locale 同步(`37.0` 显示为 `37`,`37.2` 显示为 `37.2`)

修复思路参考已关闭的 PR AndroidCSOfficial#278,但其 `.toDouble().toInt()` 只防崩溃、会丢失次版本
信息(37.2 塌成 37),故改为保留 minor 的完整方案。

测试:ApiVersionsParserTest 15 条 + RealSdkApiVersionsTest 5 条
(后者含仓库内真实数据夹具,任何机器可跑;本机另验证 9 个真实 SDK 平台全解析)。
706412584 added a commit to 706412584/android-code-studio that referenced this pull request Oct 15, 2026
移植上游 fork 的三项缺陷修复 + 一项 Git 分支修复 + 一份 targetSdk 约束分析:

- fix(editor): 短行注释解析越界崩溃(KashDaYash/android-code-studio)
- fix(build): AAPT2 架构不匹配永不重拷 + ELF 架构校验(同上)
- fix(xml): api-versions 小数版本号解析崩溃(PR AndroidCSOfficial#278 思路,改为保留次版本)
- fix(git): 克隆后只显示一个分支 + 无法切换到远程分支(PR AndroidCSOfficial#393,补其遗漏)
- docs: targetSdk=28 约束分析——机制、实测证据与升级路径

测试:core/common 22 + xml/utils 20 + core/app 561(含新增 GitManagerBranchTest 10)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant