a .value locale can pass every check and resolve no key at runtime

Open
#685 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
68/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Active
Tech stack
python
Domain
localization

Research direction

Start with ovos_workshop/resource_files.py and NamedValueFile._load_line, then run the fa-IR reproduction using tools/gapfill_skill.sh. Inspect the validation layer beside the repetition and parity checks and the translation step that selects language columns. Done means loader-shaped .value, .entity, and .rx resources are checked for valid rows, reference-identical keys, ASCII separators, missing keys, compilable regexes, and matching named groups.

Written by the indexing model from the issue text.

Description

Auto-generated by Claude, reviewed by a maintainer before posting.

A drafted locale can pass every check the app runs and still be dead when the
skill loads it. Nothing in the chain reads a loader-shaped resource the way
the runtime loader does.

Observed

ovos-skill-pokepedia, fa-IR and pl-PL, merged in #60. verify_locales.py
reported repetition lines and nothing else. Measured with the loader's own
rule, line.split(",") with a two-field unpack
(ovos_workshop/resource_files.py, NamedValueFile._load_line):

locale rows loaded parse failures en-US keys resolved
en-US 29 0 29 of 29
pl-PL 25 4 0 of 29
fa-IR 0 28 0 of 29

Two causes, both invisible to the app:

  1. The draft translated the KEY column. A .value key is an internal label
    the skill code passes to its lookup (very_strong, fire, rock), not
    language. A translated key never matches, and the lookup returns the bare
    key, so the skill speaks the English identifier.
  2. fa-IR wrote the Persian comma ،. The loader splits on the ASCII comma
    only, so every row raised and the mapping was empty.

A third row shape, key, value, value, gives three fields and raises too.

Expected

The draft must not translate a key column, and a check must read every
loader-shaped file the way its loader does, then report:

  • a row that does not split into exactly two fields;
  • a key column that is not byte-identical to the reference;
  • a separator that is not the ASCII comma;
  • any key the reference carries that the locale does not resolve.

The same treatment is wanted for the other loader-shaped resources a draft
touches, .entity and .rx: a .rx must compile, and must keep the named
groups the reference declares.

Reproduce

tools/gapfill_skill.sh ovos-skill-pokepedia fa-IR
python - <<'PY'
ok = {}
for line in open("locale/fa-IR/dialog/phrases.value", encoding="utf-8"):
    line = line.strip()
    if not line:
        continue
    try:
        k, v = line.split(",")
    except ValueError:
        continue
    ok[k.strip()] = v.strip()
print(len(ok))        # 0
PY

Where

The validation layer, beside the repetition and parity checks, and the
translation step that decides which columns of a resource are language.

Dominant language
Python
Stars
8
Forks
4
PR merge metrics
No merged PRs in 30d

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from OpenVoiceOS/ovos-localize

All issues in OpenVoiceOS/ovos-localize

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.