mirror of
				https://github.com/mokuappio/serverless-invoices.git
				synced 2025-10-31 09:51:08 -04:00 
			
		
		
		
	Use i18n-http-backend to load translatiosn from json files.
This commit is contained in:
		| @ -1,21 +1,21 @@ | ||||
| import Vue from 'vue'; | ||||
| import i18next from 'i18next'; | ||||
| import VueI18Next from '@panter/vue-i18next'; | ||||
| import Backend from 'i18next-http-backend'; | ||||
| import LanguageDetector from 'i18next-browser-languagedetector'; | ||||
| import app from '@/main'; | ||||
| import enJson from '../../public/locales/en'; | ||||
| import estJson from '../../public/locales/est'; | ||||
|  | ||||
| Vue.use(VueI18Next); | ||||
|  | ||||
| i18next.use(LanguageDetector); | ||||
| i18next | ||||
|   .use(LanguageDetector) | ||||
|   .use(Backend); | ||||
|  | ||||
| const initialized = i18next.init({ | ||||
|   fallbackLng: 'en', | ||||
|   whitelist: ['en', 'est'], | ||||
|   resources: { | ||||
|     en: enJson, | ||||
|     est: estJson, | ||||
|   whitelist: ['en', 'et'], | ||||
|   backend: { | ||||
|     loadPath: 'locales/{{lng}}/{{ns}}.json', | ||||
|   }, | ||||
|   detection: { | ||||
|     order: ['querystring', 'path', 'localStorage', 'navigator'], | ||||
|  | ||||
		Reference in New Issue
	
	Block a user