Skip to content

Support localised screenshots #81

@aral

Description

@aral

Problem

If localised screenshots exist in the Flatpak metadata, they should be supported.

Currently, the first <image/> of the last <screenshot/> in the <screenshots> section is displayed.

e.g., see https://appcenter.elementary.io/org.small_tech.comet/ where the Dutch screenshot is shown on the English page.

The relevant metadata markup is:

<screenshots>
    <screenshot type="default">
      <image xml:lang="nl">https://raw.githubusercontent.com/small-tech/comet-screenshots/main/nl/comet-basic-usage.png</image>
      <image xml:lang="tr">https://raw.githubusercontent.com/small-tech/comet-screenshots/main/tr/comet-basic-usage.png</image>
      <image>https://raw.githubusercontent.com/small-tech/comet-screenshots/main/en/comet-basic-usage.png</image>
    </screenshot>
    <screenshot>
      <image xml:lang="nl">https://raw.githubusercontent.com/small-tech/comet-screenshots/main/nl/comet-spell-check.png</image>
      <image xml:lang="tr">https://raw.githubusercontent.com/small-tech/comet-screenshots/main/tr/comet-spell-check.png</image>
      <image>https://raw.githubusercontent.com/small-tech/comet-screenshots/main/en/comet-spell-check.png</image>
    </screenshot>
    <screenshot>
      <image xml:lang="nl">https://raw.githubusercontent.com/small-tech/comet-screenshots/main/nl/comet-emoji.png</image>
      <image xml:lang="tr">https://raw.githubusercontent.com/small-tech/comet-screenshots/main/tr/comet-emoji.png</image>
      <image>https://raw.githubusercontent.com/small-tech/comet-screenshots/main/en/comet-emoji.png</image>
    </screenshot>
    <screenshot>
      <image xml:lang="nl">https://raw.githubusercontent.com/small-tech/comet-screenshots/main/nl/comet-settings.png</image>
      <image xml:lang="tr">https://raw.githubusercontent.com/small-tech/comet-screenshots/main/tr/comet-settings.png</image>
      <image>https://raw.githubusercontent.com/small-tech/comet-screenshots/main/en/comet-settings.png</image>
    </screenshot>
    <screenshot>
      <image xml:lang="nl">https://raw.githubusercontent.com/small-tech/comet-screenshots/main/nl/comet-welcome.png</image>
      <image xml:lang="tr">https://raw.githubusercontent.com/small-tech/comet-screenshots/main/tr/comet-welcome.png</image>
      <image>https://raw.githubusercontent.com/small-tech/comet-screenshots/main/en/comet-welcome.png</image>
    </screenshot>
  </screenshots>

Proposal

Initial workaround (easy)

Grab the first <image/> from the <screenshot type="default" /> in the <screenshots> section if it exists. If it doesn’t take the first image from the first screenshot (not the last), in the assumption that the author would likely have put the default first even if they didn’t mark it.

Full implementation (hard)

Actually create localised pages and serve them.

Prior Art (Optional)

The elementary OS AppCenter itself correctly displays localised pages and screenshots.

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