Skip to content

feat: english and french on the session language, subscriptions included - #25

Merged
BatLeDev merged 12 commits into
mainfrom
i18n-events
Nov 16, 2026
Merged

BatLeDev merged 12 commits into
mainfrom
i18n-events

Conversation

@BatLeDev

@BatLeDev BatLeDev commented Nov 12, 2026 •

Copy link
Copy Markdown
Member

Align events on the fr/en conventions of the stack.

  • Subscriptions: a subscription posted without locale takes the session language of the request (2 letters code only), an update without locale keeps the stored one, and a subscription made by an admin for another user never takes the admin's language (subscriptionLocale in subscriptions/operations.ts, unit tested). locale accepts any 2 letters code instead of the fr/en enum with a misleading default: 'fr'; a notification in another language gets the texts of the default locale and is declared in it.
  • Default language: stays fr, now also used as the session language without an i18n_lang cookie (I18N_DEFAULT_LOCALE is honored). The events text index keeps a fixed default_language: 'fr' so a config change never rebuilds it.
  • API: errors of the subscriptions router and schema titles in English; the push confirmations ("new device", "test") follow the session language.
  • UI: the document lang follows the session (en fallback, RGAA 8.3); vue-i18n in composition mode with fallbackLocale: 'en'; <i18n> blocks reordered English first, no text changed; the dev integrations page shows topic titles and log times in the session language.
  • Deps: lib-utils 1.15.0, lib-common-types 1.28.1, lib-vuetify 2.5.4 (the lib side of the fr/en pass, feat(i18n): localized field dates, english schema bases, i18n skill rules lib#70). Notification['locale'] is now any two letters code in lib-common-types, which matches the subscriptions.

Why: data-fair subscribes server side without a locale (new publication site), so those subscriptions were always notified in French.

Heads-up:

  • The locale is still frozen at subscription time; existing subscriptions are not migrated. One stored without locale takes the session language of whoever edits it next.
  • Switching the service default to English was tried and reverted: the UIs still default to fr (lib-vue) and existing subscriptions and webhooks would have switched at deploy. That needs a platform-wide decision.

…messages

index.html kept a frozen lang="en" whatever the session language: it now
defaults to fr (the session default) and App.vue follows session.lang.
createI18n uses the composition mode with an english fallbackLocale.
A service subscribing server side (data-fair on a new publication site)
sends no locale, its subscriptions were always in the default locale.
The forwarded session language is used instead, and an update without
locale keeps the stored one.
@BatLeDev
BatLeDev marked this pull request as ready for review November 12, 2026 16:02
…english

- The locale of a subscription accepts any 2 letters language code instead of
  the fr/en enum, and loses its misleading default 'fr'. Event texts are open
  records and a missing language falls back on the default locale, so a 'de'
  session no longer gets a 400 from the subscribe embed. The session language
  is no longer filtered by I18N_LOCALES, which only sets the languages indexed
  for search.
- Notifications are declared in the language their texts were resolved in:
  the lib notification type only knows fr and en.
- The document lang of the UI is the language actually displayed (session
  language when translated, else english, as vue-i18n fallbackLocale).
- API errors of the subscriptions router in english; the push confirmations
  sent to a new or tested device follow the session language.
@github-actions github-actions Bot added feature and removed feature labels Nov 13, 2026
BatLeDev and others added 5 commits November 13, 2026 16:29
…ters code

The session language comes from the i18n_lang cookie, which the body schema does not check:
a 'fr-FR' stored made every later save of the subscription fail its validation,
and a 'constructor' resolved to a function as the notification title.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Titles of the subscription, webhook, webhook subscription, device registration and push
subscription schemas were in French, like the generated type names (LangueDeLaSouscription).
No code imports the renamed types.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ions

- i18n.defaultLocale is 'en': texts missing in a subscription's language, mails, webhooks
- the session language without an i18n_lang cookie is this default, not lib-node's 'fr'
  (a subscription created server side without a locale now stores 'en')
- the text index keeps default_language 'fr': each _search entry carries its language,
  and a change would drop and rebuild the index at the next start
- the API doc keeps its 'fr' default: data-fair merges the docs of every service
  without forwarding Accept-Language

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ritten on a subscription

- i18n.defaultLocale back to 'fr' (I18N_DEFAULT_LOCALE): the UIs still default to 'fr'
  (lib-vue), and existing subscriptions without a locale and webhooks would have switched
  to english at deploy; english by default needs a platform-wide decision
- the session default language stays the configured one
- a subscription created or updated for another user (admin mode) takes the language of
  the body or the stored one, never the admin's session language
….5.4

The lib releases of the fr/en pass: dates in the session language for non French locales,
English byte units, English schema bases, translated search-address and date-match-filter.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions github-actions Bot added feature and removed feature labels Nov 16, 2026
…gain

The default locale stays fr (I18N_DEFAULT_LOCALE), so fixing the index language changed
nothing; back to config.i18n.defaultLocale as on main.
@BatLeDev
BatLeDev merged commit c14c642 into main Nov 16, 2026
3 checks passed
@BatLeDev
BatLeDev deleted the i18n-events branch November 16, 2026 13:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant