stable

Clone or download

Read-only

refactor: Read locale from body with default

part of request #35496 Drop moment.js from places using tlp-relative-date No functional change expected. Why? This enables to group together at @tuleap/gettext the name of the data attribute used and where to read it. Libraries using synchronous gettext do not need to know how to find the locale string. The initial goal was to move getLocaleOrThrow from @tuleap/date-helper to @tuleap/gettext, but it turns out adding this dependency adds too much to the weight of the date-helper lib (from 2.02 kB à 7.28 kB just by adding the dep). Furthermore, the logic is different: we do not want to throw in libs, because we cannot predict where they will be used in Tuleap. Some pages probably still don't have the data-attribute. It is safer to default to English in those cases. Change-Id: Ib7325c1a2c182464db0b8eb192e1b369574e96ed

Modified Files

Name
M lib/frontend/chart-builder/src/time-scale-labels-formatter.js +6 −3 Go to diff View file
M lib/frontend/commonmark-popover/src/gettext-provider.ts +2 −2 Go to diff View file
M lib/frontend/gettext/README.md +2 −2 Go to diff View file
M lib/frontend/gettext/package.json +7 −6 Go to diff View file
M lib/frontend/gettext/pnpm-lock.yaml +7 −0 Go to diff View file
A lib/frontend/gettext/src/dom.test-d.ts +33 −0 Go to diff View file
A lib/frontend/gettext/src/dom.test.ts +38 −0 Go to diff View file
A lib/frontend/gettext/src/dom.ts +33 −0 Go to diff View file
R lib/frontend/gettext/src/index.ts Go to diff View file
M lib/frontend/gettext/tsconfig.json +3 −0 Go to diff View file
M lib/frontend/gettext/vite.config.ts +2 −2 Go to diff View file
M lib/frontend/webauthn/package.json +5 −5 Go to diff View file
M lib/frontend/webauthn/pnpm-lock.yaml +4 −3 Go to diff View file
M lib/frontend/webauthn/src/main.ts +2 −3 Go to diff View file
M plugins/pullrequest/scripts/lib/pullrequest-comments/src/gettext-provider.ts +2 −2 Go to diff View file
M plugins/timetracking/scripts/lib/predefined-time-periods/src/gettext-provider.ts +2 −2 Go to diff View file