Merge pull request #4965 from h3poteto/iss-4958

Add Spanish translation
This commit is contained in:
AkiraFukushima 2024-06-12 23:59:43 +09:00 committed by GitHub
commit b9a351a6a8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 8 additions and 2 deletions

View File

@ -25,6 +25,10 @@ const languages = [
{ {
label: '繁体字', label: '繁体字',
value: 'zh-TW' value: 'zh-TW'
},
{
label: 'español',
value: 'es-ES'
} }
] ]

View File

@ -2,11 +2,12 @@ import en from '../../locales/en/translation.json'
import ja from '../../locales/ja/translation.json' import ja from '../../locales/ja/translation.json'
import pt_pt from '../../locales/pt_pt/translation.json' import pt_pt from '../../locales/pt_pt/translation.json'
import zh_tw from '../../locales/zh_tw/translation.json' import zh_tw from '../../locales/zh_tw/translation.json'
import es_es from '../../locales/es_es/translation.json'
import { flattenMessages } from '../utils/flattenMessage' import { flattenMessages } from '../utils/flattenMessage'
import { createContext, useState } from 'react' import { createContext, useState } from 'react'
import { IntlProvider } from 'react-intl' import { IntlProvider } from 'react-intl'
export type localeType = 'en' | 'ja' | 'pt-PT' | 'zh-TW' export type localeType = 'en' | 'ja' | 'pt-PT' | 'zh-TW' | 'es-ES'
type Props = { type Props = {
children: React.ReactNode children: React.ReactNode
@ -23,7 +24,8 @@ export const IntlProviderWrapper: React.FC<Props> = props => {
{ locale: 'en', messages: flattenMessages(en) }, { locale: 'en', messages: flattenMessages(en) },
{ locale: 'ja', messages: flattenMessages(ja) }, { locale: 'ja', messages: flattenMessages(ja) },
{ locale: 'pt-PT', messages: flattenMessages(pt_pt) }, { locale: 'pt-PT', messages: flattenMessages(pt_pt) },
{ locale: 'zh-TW', messages: flattenMessages(zh_tw) } { locale: 'zh-TW', messages: flattenMessages(zh_tw) },
{ locale: 'es-ES', messages: flattenMessages(es_es) }
] ]
const [lang, setLang] = useState(langs[0]) const [lang, setLang] = useState(langs[0])