lemmy-ui/src/server
matc-pub e832cd2729
Lazy load translations and date-fns, server side support for "Browser Default" language (#2380)
* Lazy load i18n translations.

* Lazy load date-fns

* Fix inconsistent DOMContentLoaded event.

Only when no translations and date-fns have to be dynamically loaded
(e.g. for en-US) the NavBar `componentDidMount` is early enough to
listen for "DOMContentLoaded".

Removes one redundant `requestNotificationPermission()` call.

* Rename interface language code "pt_BR" to "pt-BR".

Browsers ask for "pt-BR", but the "interface_language" saved in the
settings dialog asks for "pt_BR". This change will make the settings
dialog ask for "pt-BR" instead of "pt_BR". For users that already (or
still) have "pt_BR" configured, "pt-BR" will be used, but the settings
dialog will present it as unspecified.

* Use Accept-Language request header

* Prefetch translation and date-fns

---------

Co-authored-by: SleeplessOne1917 <28871516+SleeplessOne1917@users.noreply.github.com>
2024-03-13 16:39:45 -04:00
..
handlers Lazy load translations and date-fns, server side support for "Browser Default" language (#2380) 2024-03-13 16:39:45 -04:00
utils Lazy load translations and date-fns, server side support for "Browser Default" language (#2380) 2024-03-13 16:39:45 -04:00
index.tsx Lazy load translations and date-fns, server side support for "Browser Default" language (#2380) 2024-03-13 16:39:45 -04:00
middleware.ts Move lemmyClient generation into fetchInitialData functions. Fixes #2243 (#2260) 2023-12-05 03:07:36 +00:00