Skip to content

Only the first analysis language's glosses are ever visible #291

Description

@imnasnainaec

A project with several analysis languages renders glosses in analysisLanguages[0] only. Every
other language's glosses are stored but unreachable, and there is no UI to switch the displayed
language.

The store's language is a mount-time seed, taken from the first tag in the list:

  • src/components/InterlinearizerLoader.tsx:299 — draft view: draft?.analysisLanguages[0] ?? platformLanguage
  • src/components/InterlinearizerLoader.tsx:1135 — PT9 import view: activeProject.analysisLanguages[0] ?? platformLanguage

Those are the only two writers of analysisLanguage in the app. Everything downstream reads that
one tag — selectPhraseGloss / selectSegmentFreeTranslation (src/store/analysisSlice.ts:1184,
:1199), the gloss writes, and the analysis catalog rows — so a gloss map holding {en, fr, tpi}
renders en and nothing else.

Why now

Latent since the New dialog started accepting a comma-separated list, but until the Paratext 9
import there was always a user who typed the order and knew what they'd get. The import derives the
list from the source files — first appearance of glossLanguage in data.books, deduped first-wins
(src/converters/pt9/convertPt9Project.ts:82-104, :158-161) — so [0] is whatever the
platformScripture.Pt9Interlinear provider enumerated first. It also tells the user the hidden data
exists: the import report lists every language it converted
(src/components/modals/Pt9ImportModal.tsx:199-206), so the view visibly contradicts the report.
Copying out doesn't help either — createEditableCopy carries analysisLanguages verbatim
(src/services/projectStorage.ts:550).

Observed on a real multi-language PT9 project (PIA); it will affect any source with more than one
gloss language.

Scope

Two decisions, worth settling before implementation:

  1. Where the language selector lives — the view-options dropdown, the toolbar, or per-project
    state that persists. Add a user-questions.md entry for this.
  2. Whether the import view gets the same control as the draft view. The import is read-only, but
    switching the displayed language is a read, not an edit, so it should.

Implementation note: analysisLanguage is a non-reactive seed on AnalysisStoreProvider. Changing
it needs the tag folded into the provider key (src/components/InterlinearizerLoader.tsx:1133,
:1153) so the store remounts, or a reactive path into analysisSlice. Note that remounting drops
in-flight gloss edits and the catalog's scroll position, so the reactive path is probably the right
one.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions