Skip to content

Recommended language can be set to a language with no content #73

Description

@Rikdekker

Bug

The Recommended language (primary/fallback) picker in admin settings lets you choose any Nextcloud language, including ones that have no content. So you can set the recommended language to e.g. Hungarian while your intranet only has content in NL/EN/DE/FR/ES.

This is contradictory:

  • The section text promises "Users see content in their own Nextcloud language; if there is none, they are shown the recommended language below." — but if the recommended language is empty, that promise can't be kept.
  • The remove-guard protects the recommended language from deletion "so users always have a fallback" — which is meaningless if the recommended language isn't even a content language.

Root cause

  • Frontend: the picker iterates allAvailableLanguages (all NC languages) instead of the languages-with-content set (src/components/AdminSettings.vue).
  • Backend: LanguageService::setPrimaryLanguage() only validates isLanguageAvailable() (is it a known NC language), not "does it have content".

Expected

The recommended language should be chosen from the languages that have content (plus English as the universal fallback, since it's the source language and always resolvable). Setting a recommended language without content should not be possible — via the UI or the API.

Also handle

  • If the admin removes the language that is currently recommended from the content set, the recommended language should fall back sensibly (e.g. to English).

Impact

Not a crash — the runtime fallback notice lists the languages-with-content and links to personal settings; it does not silently send users to the empty recommended language. So the impact is misleading admin UX + an illogical, unpreventable state rather than a broken end-user experience.

Fix will ship in 1.8.1.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions