Skip to content

Wrong display in case of more than one titles / subtitles in various languages #809

Description

@pronguen

Bug description

  • The displayed title is not always the first of the array.
  • The title in another language is not displayed.

Current behavior

A document title is title[], where each entry has mainTitle[] and
subtitle[], each item being {value, language}.

Both UIs display a single title, filtered by the UI language:

  • Public UI: title_format (sonar/modules/documents/views.py:105) takes
    title[0] and returns the mainTitle/subtitle value matching the UI
    language, falling back to the first item.
  • Pro/admin UI (sonar-ui): document/detail/detail.component.html renders
    title[0].mainTitle | languageValue and title[0].subtitle | languageValue
    (same single-language behavior); the brief view
    (document.component.html) does the same.

So titles in other languages are never shown, and the chosen value depends on
the UI language rather than the array order.

Scope

Fix the display only — keep the current data structure. (The deeper
structure simplification, moving language to the first level, is tracked
separately and is out of scope here.)

Expected behavior

Per the mockup (mockup.pdf):

  • Primary title: the first entry of title[0].mainTitle (array order,
    independent of the UI language). Append, if present, the title[0].subtitle
    whose language matches that main title's language.
  • Other-language title(s): below the primary title, display the remaining
    mainTitle entries (other languages), each with its matching-language
    subtitle if present.

This applies to both UIs:

  • Public UI: update title_format.
  • Pro/admin UI (sonar-ui): update the detail view title rendering (and the
    brief view as relevant).

Acceptance criteria

  • The primary title shown is mainTitle[0] (first array element),
    regardless of the UI language
  • The subtitle shown next to a title is the one whose language matches
    that title (when it exists)
  • Titles in other languages are displayed below the primary title with
    their matching subtitles
  • Documents with a single title/language are unaffected
  • Consistent behavior between public UI and pro/admin UI

Server: test (sonar.test.rero.ch) — v1.6.0

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

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions