feat: improved locale selection (made button, use i18n)
This commit is contained in:
parent
bf4ed43f50
commit
e98a80666f
9 changed files with 291 additions and 44 deletions
20
app/i18n.ts
Normal file
20
app/i18n.ts
Normal file
|
@ -0,0 +1,20 @@
|
|||
import i18n from 'i18next'
|
||||
import { initReactI18next } from 'react-i18next'
|
||||
import LanguageDetector from 'i18next-browser-languagedetector'
|
||||
|
||||
i18n
|
||||
.use(LanguageDetector)
|
||||
.use(initReactI18next)
|
||||
.init({
|
||||
resources: {
|
||||
'en-US': {
|
||||
translation: require('../public/locales/en-US.json')
|
||||
}
|
||||
},
|
||||
fallbackLng: 'en-US',
|
||||
interpolation: {
|
||||
escapeValue: false
|
||||
}
|
||||
});
|
||||
|
||||
export default i18n
|
|
@ -1,10 +1,11 @@
|
|||
"use client"
|
||||
|
||||
import React, { useEffect } from 'react';
|
||||
import React, { useEffect } from 'react'
|
||||
import './globals.css'
|
||||
import '@fortawesome/fontawesome-svg-core/styles.css'
|
||||
import { config } from '@fortawesome/fontawesome-svg-core'
|
||||
import { GeistSans } from 'geist/font/sans';
|
||||
import { GeistSans } from 'geist/font/sans'
|
||||
import '../i18n'
|
||||
|
||||
config.autoAddCss = false
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue