Skip to content

refactor: 使用 Localizable.strings 存储 category 的译名#208

Open
AnemoFlower wants to merge 2 commits into
CylorineStudio:mainfrom
AnemoFlower:chore/update-categories
Open

refactor: 使用 Localizable.strings 存储 category 的译名#208
AnemoFlower wants to merge 2 commits into
CylorineStudio:mainfrom
AnemoFlower:chore/update-categories

Conversation

@AnemoFlower

Copy link
Copy Markdown
Member

本 PR 将 ProjectListItemModel 中硬编码的中文译名移至外部 .strings 文件,并补充了部分缺失的翻译。

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 工程补充 knownRegionsSWIFT_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 本地化字符串导出相关设置。

Comment thread PCL.Mac/Models/ProjectListItemModel.swift
Comment thread Resources/zh-Hans.lproj/Localizable.strings
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.

2 participants