Uh oh!
There was an error while loading. Please reload this page.
feat(i18n): include missing Spanish entries - #869
Conversation
The latest updates on your projects. Learn more about Vercel for GitHub.
2 Skipped Deployments
|
Lunaria Status Overview🌕 This pull request will trigger status changes. Learn moreBy default, every PR changing files present in the Lunaria configuration's You can change this by adding one of the keywords present in the Tracked Files
Warnings reference
|
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
📝 WalkthroughWalkthroughThis pull request adds and updates Spanish localization strings across multiple locale files. The es-419.json file receives two new top-level keys. The es.json file is expanded with 169 new lines and 20 removed lines, introducing a comprehensive new "compare" feature with selector and facets sections, additional navigation items, package metadata fields, contributor-related strings, and plural form variants for count-based messages. The lunaria/files versions for both es-419 and es-ES follow the same expansion pattern, standardising Spanish translation coverage across Latin American and European Spanish locales with identical new keys and structures for the compare functionality and metadata enhancements. 🚥 Pre-merge checks | ✅ 1✅ Passed checks (1 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches🧪 Generate unit tests (beta)
Comment |
| "clear_accent": "Limpiar color de acento", | ||
| "translation_progress": "Progreso de traducción" | ||
| "translation_progress": "Progreso de traducción", | ||
| "background_themes": "Tono de fondo" |
There was a problem hiding this comment.
Tema de fondo (sino, fuera background_tint, cierto?)
| "no_description": "Sin descripción", | ||
| "file_counts": { | ||
| "scripts": "{count} script | {count} scripts", | ||
| "refs": "{count} ref | {count} refs", |
There was a problem hiding this comment.
creo que es un diminutivo de referencias (igual no entra en pantalla)
| "file_counts": { | ||
| "scripts": "{count} script | {count} scripts", | ||
| "refs": "{count} ref | {count} refs", | ||
| "assets": "{count} activo | {count} activos" |
| "description": "Tamaño total de instalación incluyendo todas las dependencias" | ||
| }, | ||
| "dependencies": { | ||
| "label": "Deps Directas", |
There was a problem hiding this comment.
creo que es un diminutivo de direct dependencies, no veo el usage de esto en la ui ni en ts (igual no entraba en pantalla)
| "description": "Número de dependencias directas" | ||
| }, | ||
| "totalDependencies": { | ||
| "label": "Deps Totales", |
There was a problem hiding this comment.
creo que es un diminutivo de dependencies, no veo el usage de esto en la ui ni en ts (igual no entraba en pantalla)
| "version": "Versión", | ||
| "built_at": "construido {0}", | ||
| "alt_logo": "logotipo de npmx", |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bashset -euo pipefail
# Locate base locale (en.json or en-US.json) under i18n/locales
BASE=$(fd -a -I -e json 'en(-US)?\.json$' i18n/locales 2>/dev/null | head -n 1)if [ -z"$BASE" ];thenecho"Base locale not found under i18n/locales (expected en.json or en-US.json)."# Try alternative paths
BASE=$(fd -a -I -e json 'en(-US)?\.json$'2>/dev/null | head -n 1)if [ -z"$BASE" ];thenecho"Could not locate base locale file anywhere."exit 1
fifiecho"Found base locale: $BASE"
TARGETS="lunaria/files/es-ES.json;i18n/locales/es.json;lunaria/files/es-419.json"
BASE="$BASE" TARGETS="$TARGETS" python3 <<'PY'import json, os, refrom pathlib import Pathdef flatten(obj, prefix=""): out = {} if isinstance(obj, dict): for k, v in obj.items(): key = f"{prefix}.{k}" if prefix else k out.update(flatten(v, key)) else: out[prefix] = obj return outdef placeholders(s): return set(re.findall(r"\{[^}]+\}", s))base_path = os.environ["BASE"]print(f"Base locale file: {base_path}")base = Path(base_path)if not base.exists(): print(f"Base locale not found at {base}") exit(1)base_content = base.read_text(encoding="utf-8")base_flat = flatten(json.loads(base_content))print(f"Flattened base locale keys: {len(base_flat)}\n")for target in os.environ["TARGETS"].split(";"): t = Path(target) if not t.exists(): print(f"Missing target: {t}") continue tgt_content = t.read_text(encoding="utf-8") tgt_flat = flatten(json.loads(tgt_content)) mismatches = [] for k, v in tgt_flat.items(): if k in base_flat and isinstance(v, str) and isinstance(base_flat[k], str): if placeholders(v) != placeholders(base_flat[k]): mismatches.append((k, placeholders(base_flat[k]), placeholders(v))) if mismatches: print(f"\nPlaceholder mismatches for {t}:") for k, b, tv in mismatches[:50]: print(f"- {k}: base={sorted(b)} target={sorted(tv)}") if len(mismatches) > 50: print(f"... and {len(mismatches)-50} more") else: print(f"\n{t}: OK (no placeholder mismatches)")PYRepository: npmx-dev/npmx.dev
Length of output: 385
🏁 Script executed:
#!/bin/bash# Check base locale fileecho"=== Checking base locale file ==="if [ -f"i18n/locales/en-US.json" ];thenecho"File size:"
wc -l "i18n/locales/en-US.json"echo -e "\nFirst 30 lines:"
head -30 "i18n/locales/en-US.json"elseecho"File not found at i18n/locales/en-US.json"fiecho -e "\n=== Checking es-ES.json file ==="if [ -f"lunaria/files/es-ES.json" ];thenecho"File size:"
wc -l "lunaria/files/es-ES.json"echo -e "\nLines 1-20:"
head -20 "lunaria/files/es-ES.json"elseecho"File not found at lunaria/files/es-ES.json"fi# Check if files are valid JSONecho -e "\n=== Validating JSON ==="
python3 <<'PY'import jsonfrom pathlib import Pathfiles = [ "i18n/locales/en-US.json", "lunaria/files/es-ES.json"]for f in files: p = Path(f) if p.exists(): try: with open(p, 'r') as file: data = json.load(file) print(f"{f}: Valid JSON, top-level type: {type(data).__name__}, keys/length: {len(data) if isinstance(data, dict) else 'N/A'}") except Exception as e: print(f"{f}: Invalid JSON - {e}") else: print(f"{f}: File not found")PYRepository: npmx-dev/npmx.dev
Length of output: 1112
🏁 Script executed:
#!/bin/bash# Find all locale/i18n related JSON filesecho"=== Searching for locale files with content ==="
fd -e json -type f '(en|locale)'| head -20
echo -e "\n=== Checking directory structure ==="
fd -type d 'locale|i18n'| head -20
# Look for any English locale filesecho -e "\n=== Checking all JSON files in i18n ==="if [ -d"i18n" ];then
find i18n -name "*.json" -type f -exec sh -c 'echo "{}:"; wc -l "{}"'\;fi# Look in other common locationsecho -e "\n=== Checking common locale directories ==="fordirin locales translations i18n messages strings;doif [ -d"$dir" ];thenecho"Found directory: $dir"
ls -la "$dir"| head -20
fidoneRepository: npmx-dev/npmx.dev
Length of output: 2090
🏁 Script executed:
#!/bin/bashset -euo pipefail
BASE="i18n/locales/en.json"
TARGETS="i18n/locales/es.json;lunaria/files/es-ES.json;lunaria/files/es-419.json"
BASE="$BASE" TARGETS="$TARGETS" python3 <<'PY'import json, os, refrom pathlib import Pathdef flatten(obj, prefix=""): out = {} if isinstance(obj, dict): for k, v in obj.items(): key = f"{prefix}.{k}" if prefix else k out.update(flatten(v, key)) else: out[prefix] = obj return outdef placeholders(s): return set(re.findall(r"\{[^}]+\}", s))base_path = os.environ["BASE"]print(f"Base locale file: {base_path}")base = Path(base_path)if not base.exists(): print(f"Base locale not found at {base}") exit(1)base_content = base.read_text(encoding="utf-8")base_flat = flatten(json.loads(base_content))print(f"Flattened base locale keys: {len(base_flat)}\n")for target in os.environ["TARGETS"].split(";"): t = Path(target) if not t.exists(): print(f"Missing target: {t}") continue tgt_content = t.read_text(encoding="utf-8") tgt_flat = flatten(json.loads(tgt_content)) mismatches = [] for k, v in tgt_flat.items(): if k in base_flat and isinstance(v, str) and isinstance(base_flat[k], str): if placeholders(v) != placeholders(base_flat[k]): mismatches.append((k, placeholders(base_flat[k]), placeholders(v))) if mismatches: print(f"\nPlaceholder mismatches for {t}:") for k, b, tv in mismatches[:50]: print(f"- {k}: base={sorted(b)} target={sorted(tv)}") if len(mismatches) > 50: print(f"... and {len(mismatches)-50} more") else: print(f"{t}: OK (no placeholder mismatches)")PYRepository: npmx-dev/npmx.dev
Length of output: 519
Fix placeholder mismatch in Spanish translations.
Placeholder parity check reveals a mismatch in connector.status.connected_as across all Spanish locales: the base English template expects {user}, but Spanish translations include an additional {'@'} placeholder that does not exist in the source. This will cause interpolation failures at runtime. Correct the Spanish strings to match the base template's placeholder set.
Uh oh!
There was an error while loading. Please reload this page.
/cc @mrcego