sergiodxa/remix-i18next

PreloadTranslations should use resolvedLanguage

jamesarosen opened this issue · 0 comments

Describe the bug

I have remix-i18next (and i18next) configured with

{
  supportedLngs: ["en", "fr"],
  fallbackLng: "en",
  lng: "de"
}

Given this, <PreloadTranslations> emits (for example)

<link rel="preload" href="/locales/de/common.json" />

But there's no public/locales/de/ in my app because that's not a supported language. I believe it should instead preload based onresolvedLanguage, which would be "en" here.

Your Example Website or App

n/a

Steps to Reproduce the Bug or Issue

see above

Expected behavior

The server should emit preload links that match what the client actually loads.

Screenshots or Videos

No response

Platform

  • Version: 5.0.0

Additional context

No response