Feat/i18n restructure (#2529)

This commit is contained in:
crazywoola 2024-02-23 14:31:06 +08:00 • committed by GitHub
commit 9574730050
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
140 changed files with 448 additions and 659 deletions

View file

@ -2,11 +2,10 @@ import { useState } from 'react'
import { useContext } from 'use-context-selector'
import I18n from '@/context/i18n'
import { X } from '@/app/components/base/icons/src/vender/line/general'
import { NOTICE_I18N, getModelRuntimeSupported } from '@/utils/language'
import { NOTICE_I18N } from '@/i18n/language'
const MaintenanceNotice = () => {
const { locale } = useContext(I18n)
const language = getModelRuntimeSupported(locale)
const [showNotice, setShowNotice] = useState(localStorage.getItem('hide-maintenance-notice') !== '1')
const handleJumpNotice = () => {
@ -26,11 +25,11 @@ const MaintenanceNotice = () => {
return (
<div className='shrink-0 flex items-center px-4 h-[38px] bg-[#FFFAEB] border-b border-[0.5px] border-b-[#FEF0C7] z-20'>
<div className='shrink-0 flex items-center mr-2 px-2 h-[22px] bg-[#F79009] text-white text-[11px] font-medium rounded-xl'>{titleByLocale[language]}</div>
<div className='shrink-0 flex items-center mr-2 px-2 h-[22px] bg-[#F79009] text-white text-[11px] font-medium rounded-xl'>{titleByLocale[locale]}</div>
{
(NOTICE_I18N.href && NOTICE_I18N.href !== '#')
? <div className='grow text-xs font-medium text-gray-700 cursor-pointer' onClick={handleJumpNotice}>{descByLocale[language]}</div>
: <div className='grow text-xs font-medium text-gray-700'>{descByLocale[language]}</div>
? <div className='grow text-xs font-medium text-gray-700 cursor-pointer' onClick={handleJumpNotice}>{descByLocale[locale]}</div>
: <div className='grow text-xs font-medium text-gray-700'>{descByLocale[locale]}</div>
}
<X className='shrink-0 w-4 h-4 text-gray-500 cursor-pointer' onClick={handleCloseNotice} />
</div>