{"id":29082014,"url":"https://github.com/romanticencounter/localizable_strings_checker","last_synced_at":"2025-06-27T20:03:10.399Z","repository":{"id":297153275,"uuid":"995799551","full_name":"RomanticEncounter/localizable_strings_checker","owner":"RomanticEncounter","description":"一个用于检查Localizable.strings文件内容的python命令行工具","archived":false,"fork":false,"pushed_at":"2025-06-26T09:27:24.000Z","size":20,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-06-26T09:36:20.465Z","etag":null,"topics":["ios","iterm2","localizable-strings","objective-c","swift","xcode"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/RomanticEncounter.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-06-04T02:59:25.000Z","updated_at":"2025-06-26T09:27:27.000Z","dependencies_parsed_at":"2025-06-04T10:31:06.700Z","dependency_job_id":"bed9e281-a5c4-4635-8113-a31bf06cfd40","html_url":"https://github.com/RomanticEncounter/localizable_strings_checker","commit_stats":null,"previous_names":["romanticencounter/check_localizable_strings_file"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/RomanticEncounter/localizable_strings_checker","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RomanticEncounter%2Flocalizable_strings_checker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RomanticEncounter%2Flocalizable_strings_checker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RomanticEncounter%2Flocalizable_strings_checker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RomanticEncounter%2Flocalizable_strings_checker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/RomanticEncounter","download_url":"https://codeload.github.com/RomanticEncounter/localizable_strings_checker/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RomanticEncounter%2Flocalizable_strings_checker/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262324906,"owners_count":23293749,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ios","iterm2","localizable-strings","objective-c","swift","xcode"],"created_at":"2025-06-27T20:01:46.021Z","updated_at":"2025-06-27T20:03:10.277Z","avatar_url":"https://github.com/RomanticEncounter.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# localizable_strings_checker\n\n\u003e 基于 AI 生成的用于检查`Localizable.strings`的工具\n\n[Qwen对话过程](https://chat.qwen.ai/s/e2a1ec86-244e-42b1-a336-09f6d9ee3440?fev=0.0.107)\n\n![iTerm Screenshot](https://github.com/user-attachments/assets/331126b8-73df-4cf4-95fd-7a8125183a79)\n\n\n## 一、工具概述\n\n本工具专为解决 `iOS` 开发者在 `Xcode` 开发者工具中，无法精准检查`Localizable.strings`文件内具体报错问题的痛点而开发。基于 `Qwen3-235B-A22B` 大模型技术编写，它能快速且细致地对文件进行全面检查，涵盖分号结尾、单行注释、多行注释等多项关键内容，助力开发者高效提升多语言本地化工作的质量与效率。\n\n#### 项目结构如下：\n\n```text\nlocalizable_strings_checker/\n├── setup.py\n├── README.md\n└── src/\n    └── csf/\n        ├── __init__.py\n        └── cli.py\n```\n\n## 二、使用方法\n\n~~打开终端，`cd`到此工具文件路径下，输入以下命令~~\n```diff\n- python3 check_localizable_strings_file.py xxxxx/en.lproj/Localizable.strings\n\n+ cd path/localizable_strings_checker\n```\n\n#### **步骤 1：创建虚拟环境**\n\n```bash\npython3 -m venv venv #创建虚拟环境\n```\n#### **步骤 2：激活虚拟环境**\n\n```bash\nsource venv/bin/activate #激活虚拟环境\n```\n激活后，终端提示符会显示 (venv)，表示已进入虚拟环境。\n\n#### **步骤 3：在虚拟环境中安装依赖**\n\n```bash\npip install setuptools #安装工具依赖\npip install -e .  #安装你的工具到虚拟环境中\n\ncsf test_localizable.strings #测试工具运行\n```\n\n此时安装的包仅对当前虚拟环境生效，不会影响系统环境。\n\n#### **步骤 4：退出虚拟环境（可选）**\n\n```bash\ndeactivate\n```\n\n## 三、检查内容详情\n\n1. 语法错误检查\n- 分号结尾检查：验证每个键值对结尾是否正确添加分号，缺少分号将触发报错提示，并标注具体行号。\n- 引号成对检查：检查字符串中的引号是否成对出现，单引号或双引号缺失、多余都会被标记，同时提示错误位置。\n- 键值对格式检查：确保键值对采用`\"key\" = \"value\";`的标准格式，格式错误（如等号缺失、键值未用引号包裹）会被精准定位并提示。\n- 值中的未转义双引号检查：扫描值中的双引号，若未使用反斜杠进行转义，工具会指出该问题，避免字符串解析错误。\n\n2. 注释相关检查\n- 单行注释检查：识别以`//`开头的单行注释，若注释格式错误（如注释符号后无空格、注释内容包含非法字符），将在报告中列出。\n- 多行注释检查：检查以`/*`开头、`*/`结尾的多行注释，检测是否存在未闭合的多行注释情况，一旦发现，立即标注注释起始和可能缺失结尾的位置。\n\n3. 逻辑错误检查\n- 键或值为空检查：遍历所有键值对，若键或值为空字符串，工具会记录并提示，避免无效的本地化配置。\n- 键重复检查：查找文件中重复的键名，重复的键会导致本地化取值混乱，工具将详细列出重复键及其所在行号。\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fromanticencounter%2Flocalizable_strings_checker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fromanticencounter%2Flocalizable_strings_checker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fromanticencounter%2Flocalizable_strings_checker/lists"}