mirror of
				https://github.com/mealie-recipes/mealie.git
				synced 2025-10-31 10:13:32 -04:00 
			
		
		
		
	Fix en-US language not being loaded (#574)
VueI18n defaults to en-US when no language is specified, which prevented en-US messages from being loaded
This commit is contained in:
		| @@ -20,16 +20,8 @@ function setI18nLanguage (lang) { | |||||||
| } | } | ||||||
|  |  | ||||||
| export function loadLanguageAsync(lang) { | export function loadLanguageAsync(lang) { | ||||||
|     // If the same language |  | ||||||
|   if (i18n.locale === lang) { |  | ||||||
|     return Promise.resolve(setI18nLanguage(lang)) |  | ||||||
|   } |  | ||||||
|  |  | ||||||
|   // If the language was already loaded |  | ||||||
|   if (loadedLanguages.includes(lang)) { |  | ||||||
|     return Promise.resolve(setI18nLanguage(lang)) |  | ||||||
|   } |  | ||||||
|  |  | ||||||
|  |   if ( ! loadedLanguages.includes(lang)) { | ||||||
|     const messages = import(`./locales/messages/${lang}.json`); |     const messages = import(`./locales/messages/${lang}.json`); | ||||||
|     const dateTimeFormats = import(`./locales/dateTimeFormats/${lang}.json`); |     const dateTimeFormats = import(`./locales/dateTimeFormats/${lang}.json`); | ||||||
|      |      | ||||||
| @@ -42,3 +34,5 @@ export function loadLanguageAsync(lang) { | |||||||
|       } |       } | ||||||
|     ) |     ) | ||||||
|   } |   } | ||||||
|  |   return Promise.resolve(setI18nLanguage(lang)) | ||||||
|  | } | ||||||
		Reference in New Issue
	
	Block a user