Apply suggestions from code review

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
This commit is contained in:
zenobit
2026-04-01 00:28:18 +02:00
committed by openhands
parent a91f8c4d51
commit 89cb4bbb8c
3 changed files with 9 additions and 6 deletions

View File

@@ -115,6 +115,7 @@
"uuid": "^13.0.0",
"wreq-js": "^2.0.1",
"yazl": "^3.3.1",
"js-yaml": "^4.1.0",
"zod": "^4.3.6",
"zustand": "^5.0.10"
},

View File

@@ -209,9 +209,9 @@ async function runAutomatedChecks() {
let anchorLineRemoved = true;
let brAppendixRemoved = true;
// Check RTL languages (ar, ja) for legacy content
const rtlLanguages = ["ar", "ja"];
for (const code of rtlLanguages) {
// Check specific languages (ar, ja) for legacy content
const legacyCheckLocales = ["ar", "ja"];
for (const code of legacyCheckLocales) {
const readmePath = path.join(I18N_README_DIR, code, "README.md");
try {
const content = await fs.readFile(readmePath, "utf8");

View File

@@ -263,9 +263,11 @@ def find_placeholder_issues(source: Dict, trans: Dict) -> List[Tuple[str, str, s
# Only extract top-level placeholders: {name}, {count}, {day}, NOT {# X} inside ICU
import re
# Match {name} but NOT {# inside ICU plural
source_placeholders = set(re.findall(r'\{[a-zA-Z][^}]*\}', source_val))
trans_placeholders = set(re.findall(r'\{[a-zA-Z][^}]*\}', trans_val))
# Extract variable names from placeholders (e.g., 'name' from '{name}' or 'count' from '{count, plural, ...}')
# This avoids false positives on ICU strings where the internal text is translated.
placeholder_regex = r'\{\s*([a-zA-Z][a-zA-Z0-9_]*)'
source_placeholders = set(re.findall(placeholder_regex, source_val))
trans_placeholders = set(re.findall(placeholder_regex, trans_val))
# Check for missing placeholders
missing = source_placeholders - trans_placeholders