fix: plugin template add locale (#4943)

This commit is contained in:
jack zhang 2024-07-28 15:44:50 +08:00 committed by GitHub
parent d2aedd01d0
commit e727581967
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 14 additions and 0 deletions

View File

@ -0,0 +1,12 @@
import { useTranslation } from 'react-i18next';
// @ts-ignore
import pkg from './../../package.json';
export function usePluginTranslation() {
return useTranslation([pkg.name, 'client'], { nsMode: 'fallback' });
}
export function generatePluginTranslationTemplate(key: string) {
return `{{t('${key}', { ns: ['${pkg.name}', 'client'], nsMode: 'fallback' })}}`;
}

View File

@ -0,0 +1 @@
{}

View File

@ -0,0 +1 @@
{}