mirror of
https://github.com/diegosouzapw/OmniRoute.git
synced 2026-07-31 04:12:10 +03:00
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:
@@ -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"
|
||||
},
|
||||
|
||||
@@ -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");
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user