Implemented email verification
This commit is contained in:
23
components/translate-client-fragment.tsx
Normal file
23
components/translate-client-fragment.tsx
Normal file
@@ -0,0 +1,23 @@
|
||||
import { useI18n } from '@/locales/client'
|
||||
|
||||
export const __ = (key: any, params?: any): React.ReactNode => {
|
||||
const t = useI18n()
|
||||
|
||||
if (key.startsWith('["')) {
|
||||
const data = JSON.parse(key)
|
||||
|
||||
if (data.length > 1) {
|
||||
key = data.shift()
|
||||
// @ts-ignore
|
||||
return t(key, ...data)
|
||||
}
|
||||
}
|
||||
|
||||
return t(key, params)
|
||||
}
|
||||
|
||||
const TranslateClientFragment = ({ message, args }: { message: any, args?: any }) => {
|
||||
return <>{__(message, args)}</>
|
||||
}
|
||||
|
||||
export default TranslateClientFragment
|
||||
Reference in New Issue
Block a user