Repository navigation
Conversation
Since the core bundle moved to Vite, `moment` resolves to its ES build while `moment/min/locales.js` registers on the CommonJS build, so OC.Util.formatDate() ignored the user's locale. Load only the user's locale from `moment/dist/locale` instead of bundling all of them. Assisted-by: ClaudeCode:claude-opus-5-5 Signed-off-by: John Molakvoæ <14975046+skjnldsv@users.noreply.github.com>
skjnldsv
requested review from
pringelmann and
susnux
and removed request for
a team
November 28, 2026 18:45
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Since the core bundle moved to Vite (4a4ba35),
OC.Util.formatDate()andOC.Util.relativeModifiedDate()ignore the user's locale.momentresolves to its ES build, whilemoment/min/locales.jsregisters its locales on the CommonJS build, somoment.locale('de')silently stays English. All 130+ locales still load with core-main on every page.Now only the user's locale is loaded from
moment/dist/locale, which registers on the same instance. It runs ininitCore()because the chunk URL is resolved throughOC.filePath.German user,
OC.Util.formatDate(…, 'LLLL'):Every page loads 74 KB gzipped less. Until the locale chunk arrives, these deprecated helpers answer in English. The unit test covers the loader: vitest resolves both moment entries to one instance, so the mismatch itself only shows in the Vite build, which I checked in the browser.
Relates to nextcloud/standards#17
Checklist
3. to review, feature component)stable32)AI (if applicable)
👾 This pull request was assisted by Claude Code, commits carry an
Assisted-bytrailer.