* feat(plugin-map): add MapBlock * feat: improve implementation to better support multiple fields * feat: support click overlay * fix: the width of select is not 100% * fix: repeat MapBlock * fix: loss initializer * feat: support selected marker in map * feat: support select point use box * fix: fixedBlock not work * fix: template not work * feat: improve ui * feat: improve selecting * feat: update ui * feat: improve map readpretty * feat: support marker field
22 lines
530 B
TypeScript
22 lines
530 B
TypeScript
import { i18n } from '@nocobase/client';
|
|
import { useTranslation } from 'react-i18next';
|
|
import enUS from './en-US';
|
|
import zhCN from './zh-CN';
|
|
|
|
export const NAMESPACE = 'map';
|
|
|
|
i18n.addResources('zh-CN', NAMESPACE, zhCN);
|
|
i18n.addResources('en-US', NAMESPACE, enUS);
|
|
|
|
export function lang(key: string) {
|
|
return i18n.t(key, { ns: NAMESPACE });
|
|
}
|
|
|
|
export function generateNTemplate(key: string) {
|
|
return `{{t('${key}', { ns: '${NAMESPACE}' })}}`;
|
|
}
|
|
|
|
export function useMapTranslation() {
|
|
return useTranslation(NAMESPACE);
|
|
}
|