@payloadcms/translations
Advanced tools
Comparing version 3.0.0-alpha.69 to 3.0.0-alpha.70
@@ -30,3 +30,3 @@ import type { Locale } from 'date-fns'; | ||
export type I18nOptions = { | ||
fallbackLanguage?: string; | ||
fallbackLanguage?: AcceptedLanguages; | ||
supportedLanguages?: SupportedLanguages; | ||
@@ -48,3 +48,3 @@ translations?: Partial<{ | ||
context: 'api' | 'client'; | ||
language?: AcceptedLanguages; | ||
language: AcceptedLanguages; | ||
}) => Promise<I18n>; | ||
@@ -51,0 +51,0 @@ export type LanguagePreference = { |
@@ -116,3 +116,3 @@ import { importDateFNSLocale } from '../importDateFNSLocale.js'; | ||
} | ||
export const initI18n = memoize(async ({ config, context, language = 'en' }) => { | ||
export const initI18n = memoize(async ({ config, context, language = config.fallbackLanguage }) => { | ||
const translations = getTranslationsByContext(config.supportedLanguages[language], context); | ||
@@ -119,0 +119,0 @@ const { t, translations: mergedTranslations } = initTFunction({ |
{ | ||
"name": "@payloadcms/translations", | ||
"version": "3.0.0-alpha.69", | ||
"version": "3.0.0-alpha.70", | ||
"homepage": "https://payloadcms.com", | ||
@@ -5,0 +5,0 @@ "repository": { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
1067666