Skip to content

Photos app shows blank page for en (US English) locale due to undefined translation lookup #3454

@afarrar89

Description

@afarrar89

When the user's locale is set to en (US English), the Photos app renders a completely blank page with no error shown to the user.

Steps to reproduce:

  1. Set your Nextcloud language to English (US English / en)
  2. Navigate to the Photos app in the browser

Expected behavior: Photos app loads normally.

Actual behavior: Blank page. The browser console shows:
Uncaught TypeError: Cannot read properties of undefined (reading 'translations')
at nd.addTranslations (gettext.mjs:23:39)
at rd.build (gettext.mjs:101:15)
at index.mjs:9:99

Root cause:

In the bundled index.mjs (chunk index-gbefElOV.chunk.mjs), the moment.js locale setup contains:

if (locale === "en" || locale in translations) {
const gt = getGettextBuilder()
.setLanguage(locale)
.addTranslation(locale, translations[locale]) // translations["en"] is undefined!
.build();

The translations object includes en_GB but not en. The condition correctly special-cases "en" to enter the block, but then translations["en"] is
undefined, causing the gettext builder to crash, which prevents the entire app from rendering.

Fix:

Change the condition to only enter the block when the locale actually exists in the translations object:

if (locale in translations) {

Or alternatively, add an "en" entry to the bundled translations object.

Environment:

  • Nextcloud version: 32.0.6
  • Photos app version: 5.0.0
  • Browser: Google Chrome 138.0.7204.184 (Official Build) (x86_64)
  • Locale: en (US English)

Metadata

Metadata

Assignees

No one assigned

    Labels

    0. Needs triagePending approval or rejection. This issue is pending approval.bugSomething isn't workingneeds infoNot enough information provided

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions