Skip to content

fix: include multilingual designations in index summary#25

Merged
ronaldtse merged 1 commit into
mainfrom
fix/index-multilingual-designations
Jun 21, 2026
Merged

fix: include multilingual designations in index summary#25
ronaldtse merged 1 commit into
mainfrom
fix/index-multilingual-designations

Conversation

@ronaldtse

Copy link
Copy Markdown
Member

Problem

The graph panel's "designation" node label mode shows identifiers instead of term names for non-English languages. This is because the index summary (index.json) only stored the English term (eng field), discarding the full designations map.

The DatasetAdapter.normalizeIndex() creates graph nodes from the index data. Without a designations map, it falls back to designations: { eng: c.eng } — losing all other languages.

Fix

Include the full designations map in the index summary, with HTML stripped from each term. The adapter already handles the new format via its if (c.designations && typeof c.designations === 'object') branch.

Testing

Built the VIML glossary (135 concepts, eng+fra) and verified:

  • index.json now includes {"id":"0.01","designations":{"eng":"metrology","fra":"métrologie"},"eng":"metrology","status":"valid"}
  • Graph panel shows French designations when language is switched to French

Comment thread scripts/generate-data.mjs Fixed
ronaldtse added a commit that referenced this pull request Jun 12, 2026
The HTML stripping regex appeared 3 times inline. Extracted to a
single stripHtml() function and applied it to all designation values
in the index summary (previously only eng was stripped).

This also incorporates the intent of PR #25 (multilingual designations
in index) — the designations map in index.json is now fully
HTML-stripped.
The fix from cb41d2d (multilingual designations in index summary) had
no regression test — every fixture in dataset-adapter.test.ts used
English-only designations, so reverting the fix would have passed CI
silently.

Add a fixture with eng+fra+deu designations and assert:
  - getIndexEntry() returns the full designations map (not just eng)
  - lookupByDesignation() resolves non-English terms to the right concept

If normalizeIndex() ever falls back to { eng: c.eng } again, the new
test fails.
@ronaldtse ronaldtse force-pushed the fix/index-multilingual-designations branch from 12ab764 to ac42f50 Compare June 21, 2026 09:50
@ronaldtse ronaldtse merged commit c8b9c2a into main Jun 21, 2026
4 checks passed
@ronaldtse ronaldtse deleted the fix/index-multilingual-designations branch June 21, 2026 09:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants