refactor: 使用 Localizable.strings 存储 category 的译名#208
Open
AnemoFlower wants to merge 2 commits into
Open
Conversation
There was a problem hiding this comment.
Pull request overview
该 PR 将 ProjectListItemModel 中对 Modrinth category/tag 的硬编码中文映射迁移到 Localizable.strings,并通过构建设置支持本地化字符串的提取/维护,从而降低后续补翻译与扩展的成本。
Changes:
- 新增
Resources/zh-Hans.lproj/Localizable.strings,集中存放 Modrinth categories/features/performance/resolutions 的中文译名。 ProjectListItemModel使用NSLocalizedString动态本地化 tag,并移除原先的tagMap。- Xcode 工程补充
knownRegions与SWIFT_EMIT_LOC_STRINGS相关配置。
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| Resources/zh-Hans.lproj/Localizable.strings | 新增 zh-Hans 本地化字符串表,用于提供 Modrinth tag/category 的中文译名。 |
| PCL.Mac/Models/ResourceDisplayModel.swift | tag 显示改为走 ProjectListItemModel.localizeTag 的本地化结果。 |
| PCL.Mac/Models/ProjectListItemModel.swift | 移除硬编码 tagMap,改为 NSLocalizedString 从 .strings 获取译名。 |
| PCL.Mac.xcodeproj/project.pbxproj | 更新已知语言区域并启用 Swift 本地化字符串导出相关设置。 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
本 PR 将
ProjectListItemModel中硬编码的中文译名移至外部.strings文件,并补充了部分缺失的翻译。