Unverified Commit 5bccef85 authored by Balázs Orbán's avatar Balázs Orbán Committed by GitHub

chore(examples): fall back to English dictionary in i18n example (#53207)

If an unknown locale is detected, we should fall back to English

Fixes #53201
Co-authored-by: 's avatarJJ Kasper <22380829+ijjk@users.noreply.github.com>
parent c7f9ffac
...@@ -9,4 +9,5 @@ const dictionaries = { ...@@ -9,4 +9,5 @@ const dictionaries = {
cs: () => import('./dictionaries/cs.json').then((module) => module.default), cs: () => import('./dictionaries/cs.json').then((module) => module.default),
} }
export const getDictionary = async (locale: Locale) => dictionaries[locale]() export const getDictionary = async (locale: Locale) =>
dictionaries[locale]?.() ?? dictionaries.en()
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment