Skip to content

Consolidate label rendering on per-vocab templates, retire $ldt:lang#323

Open
namedgraph wants to merge 3 commits into
developfrom
fix-lang-negotiation
Open

Consolidate label rendering on per-vocab templates, retire $ldt:lang#323
namedgraph wants to merge 3 commits into
developfrom
fix-lang-negotiation

Conversation

@namedgraph

Copy link
Copy Markdown
Member

Summary

Fixes duplicate bilingual widget headings (e.g. BacklinksBacklinks, Related resultsResultados relacionados) and makes the browser's ordered language preference govern label selection. Companion PR: AtomGraph/Web-Client#89 (requires client 5.0.3-SNAPSHOT).

  • client.xsl imports the Web-Client per-vocab stylesheets (same order as internal-layout.xsl, so CSR label precedence = SSR by construction) and drops the monolithic ac:label/ac:description override, whose unfiltered fallback emitted every language variant when the browser language matched neither @en nor @es.
  • $ac:langs is overridden client-side from navigator.languages (SaxonJS marshals it as an XDM sequence); server-side the Web-Client writer passes the request's Accept-Language. Label selection is no longer capped by the supportedLanguages config — a @lt label wins for an lt-preferring user while Content-Language still negotiates against en,es.
  • Property-value suppression in bs2:PropertyList negotiates per property over $ac:langs (two split templates with cheap match patterns): the best accepted language wins; values in unaccepted languages stay hidden as before.
  • sh.xsl label/description templates migrated; all xsl:sort collations use $ac:lang; dual use-when sort pairs collapsed.
  • Client-side ac:uuid() override added (window.generateUUID), completing the removal of ixsl from Web-Client.
  • $ldt:lang is fully retired from this repo (0 references); it remains the SSR Content-Language carrier in Web-Client.

Test plan

Verified in the browser against three preference configurations, all rendering single-language labels with SSR/CSR parity:

Accept-Language UI chrome Data labels
es,lt;q=0.9,en-US;q=0.8,en;q=0.7 Spanish (Registrarse, Resultados relacionados) Lithuanian
lt,en-US;q=0.9,en;q=0.8 English Lithuanian
en-US,en;q=0.9 English English where available, first-available fallback otherwise

🤖 Generated with Claude Code

namedgraph and others added 3 commits July 21, 2026 14:45
- client.xsl imports the Web-Client per-vocab stylesheets (same order as
  internal-layout.xsl, so CSR label precedence = SSR) and drops the
  monolithic ac:label/ac:description override — fixes duplicate bilingual
  widget headings (e.g. BacklinksBacklinks) rendered when the browser
  language matched neither @en nor @es
- Property-value suppression in bs2:PropertyList negotiates over $ac:langs
  (two split templates): the best accepted language per property wins;
  values in unaccepted languages stay hidden as before
- sh.xsl label/description templates migrated to $ac:langs
- All xsl:sort collations use $ac:lang; dual use-when sort pairs collapsed
- Depend on client 5.0.3-SNAPSHOT

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
CSR override in client.xsl (import precedence over the Web-Client
$ldt:lang-derived default). SaxonJS marshals navigator.languages as an
XDM sequence, so it is iterated directly.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Implements the Web-Client stub via window.generateUUID in the CSR
functions module, mirroring the $ac:langs override pattern.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.

1 participant