-
-
Notifications
You must be signed in to change notification settings - Fork 186
feat(i18n): include missing Spanish entries #869
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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 |
lunaria/files/es-419.json
Outdated
| "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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tema de fondo (sino, fuera background_tint, cierto?)
lunaria/files/es-419.json
Outdated
| "no_description": "Sin descripción", | ||
| "file_counts": { | ||
| "scripts": "{count} script | {count} scripts", | ||
| "refs": "{count} ref | {count} refs", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
referencia / referencias
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
creo que es un diminutivo de referencias (igual no entra en pantalla)
lunaria/files/es-419.json
Outdated
| "file_counts": { | ||
| "scripts": "{count} script | {count} scripts", | ||
| "refs": "{count} ref | {count} refs", | ||
| "assets": "{count} activo | {count} activos" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
recurso / recursos
lunaria/files/es-419.json
Outdated
| "description": "Tamaño total de instalación incluyendo todas las dependencias" | ||
| }, | ||
| "dependencies": { | ||
| "label": "Deps Directas", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dependencias directas
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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)
lunaria/files/es-419.json
Outdated
| "description": "Número de dependencias directas" | ||
| }, | ||
| "totalDependencies": { | ||
| "label": "Deps Totales", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dependencias totales
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
creo que es un diminutivo de dependencies, no veo el usage de esto en la ui ni en ts (igual no entraba en pantalla)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
| "version": "Versión", | ||
| "built_at": "construido {0}", | ||
| "alt_logo": "logotipo de npmx", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
set -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" ]; then
echo "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" ]; then
echo "Could not locate base locale file anywhere."
exit 1
fi
fi
echo "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, re
from pathlib import Path
def 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 out
def 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 file
echo "=== Checking base locale file ==="
if [ -f "i18n/locales/en-US.json" ]; then
echo "File size:"
wc -l "i18n/locales/en-US.json"
echo -e "\nFirst 30 lines:"
head -30 "i18n/locales/en-US.json"
else
echo "File not found at i18n/locales/en-US.json"
fi
echo -e "\n=== Checking es-ES.json file ==="
if [ -f "lunaria/files/es-ES.json" ]; then
echo "File size:"
wc -l "lunaria/files/es-ES.json"
echo -e "\nLines 1-20:"
head -20 "lunaria/files/es-ES.json"
else
echo "File not found at lunaria/files/es-ES.json"
fi
# Check if files are valid JSON
echo -e "\n=== Validating JSON ==="
python3 <<'PY'
import json
from pathlib import Path
files = [
"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 files
echo "=== 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 files
echo -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 locations
echo -e "\n=== Checking common locale directories ==="
for dir in locales translations i18n messages strings; do
if [ -d "$dir" ]; then
echo "Found directory: $dir"
ls -la "$dir" | head -20
fi
doneRepository: npmx-dev/npmx.dev
Length of output: 2090
🏁 Script executed:
#!/bin/bash
set -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, re
from pathlib import Path
def 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 out
def 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.
/cc @mrcego