1
0
mirror of https://github.com/h3poteto/whalebird-desktop synced 2024-12-12 08:46:34 +01:00

Add Spanish translation

This commit is contained in:
AkiraFukushima 2024-06-12 23:32:34 +09:00
parent b89fc74035
commit 88d2bbea92
No known key found for this signature in database
GPG Key ID: B6E51BAC4DE1A957
2 changed files with 8 additions and 2 deletions

View File

@ -25,6 +25,10 @@ const languages = [
{
label: '繁体字',
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 pt_pt from '../../locales/pt_pt/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 { createContext, useState } from 'react'
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 = {
children: React.ReactNode
@ -23,7 +24,8 @@ export const IntlProviderWrapper: React.FC<Props> = props => {
{ locale: 'en', messages: flattenMessages(en) },
{ locale: 'ja', messages: flattenMessages(ja) },
{ 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])