feat: add Arabic localization parity checker - #6
Conversation
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: cfad225ac3
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| unit = localized.get("stringUnit", {}) | ||
| if isinstance(unit, dict): | ||
| value = str(unit.get("value", "")) |
There was a problem hiding this comment.
Parse plural xcstrings variants before flagging empty values
Handle localized entries that store text under variations (common for pluralized .xcstrings) instead of only stringUnit.value; the current parser leaves such entries as empty strings, so compare_entries raises Empty ar value even when valid Arabic plural translations exist. This produces false errors and can block parity checks on correctly localized catalogs.
Useful? React with 👍 / 👎.
| if key == "__parse_error__": | ||
| findings.append(Finding("error", source, key, target_value or base_value)) |
There was a problem hiding this comment.
Surface parse failures when only one locale fails to parse
Report parse errors directly even when only one side has __parse_error__; currently that sentinel is only handled in the shared-key loop, so a malformed target file is emitted as Missing ar key plus Extra ar key instead of a parse-failure error message. This obscures the real root cause and makes troubleshooting harder when a single locale file is invalid.
Useful? React with 👍 / 👎.
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 38c4766fbf
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| localizations = payload.get("localizations", {}) | ||
| if not isinstance(localizations, dict) or locale not in localizations: | ||
| continue |
There was a problem hiding this comment.
Read implicit source entries from string catalogs
When an .xcstrings file uses the standard sourceLanguage representation, source-language strings are stored as catalog keys and commonly have no localizations.en entry. Skipping every key without an explicit base localization makes the English side empty, so a broken Arabic translation is reported only as an extra-key warning and the checker exits successfully without comparing placeholders or values.
Useful? React with 👍 / 👎.
Summary
Verification