This repository was archived by the owner on Jan 10, 2025. It is now read-only.
Incorrect fallback behavior in @shopify/react-i18n
causing timezone to reset to default
#2817
Labels
Type: Bug 🐛
Something isn't working
Overview
I initialize the I18nManager with the client's locale and ianaTimezone values. If the client data hasn't been loaded yet, default values of
en-US
andAmerica/New_York
are used:Within AppLangProvider, I connect my translations:
Issue
When the client's locale (
en-US
) matches one of my translations, everything works correctly, and the i18n object maintains the client's ianaTimezone (e.g., i18n.defaultTimezone ===Asia/Tbilisi
).However, if the client selects a language for which I don't have a translation (e.g., Polish
pl-PL
), the fallback locale (en
) is applied correctly, but the defaultTimezone within the i18n object resets to the default (i18n.defaultTimezone ===America/New_York
) instead of retaining the client's ianaTimezone (Asia/Tbilisi
).Expected behavior
The i18nManager should maintain the ianaTimezone provided in my useMemo regardless of the fallback locale being applied. The timezone should not reset to the default value when the fallback translations are used.
The text was updated successfully, but these errors were encountered: