Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 9 additions & 5 deletions app/locale.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,15 @@ function makeBundle(locale, ftl) {
export async function getTranslator(locale) {
const bundles = [];
const { default: en } = await import('../public/locales/en-US/send.ftl');
if (locale !== 'en-US') {
const { default: ftl } = await import(
`../public/locales/${locale}/send.ftl`
);
bundles.push(makeBundle(locale, ftl));
try {
if (locale !== 'en-US') {
const { default: ftl } = await import(
`../public/locales/${locale}/send.ftl`
);
bundles.push(makeBundle(locale, ftl));
}
} catch {
console.warn(`Locale ${locale} not found. Using en-US as fallback.`);
}
bundles.push(makeBundle('en-US', en));
return function(id, data) {
Expand Down