mirror of
https://gitee.com/nocobase/nocobase.git
synced 2025-05-09 15:39:24 +08:00
* feat(plugin-custom-request): support better custom-request * feat: re implement custom request * feat: complete configuration * feat: support request in server * feat: improve usage * feat: support request * feat: remove customRequests when action is deleted * feat: avoid override * fix: the data is not latest * feat: should autoSize in url * feat: support title and acl * fix: i18n * feat: support display title * feat: i18n supports * refactor: acl check * feat: better method * fix: style * fix: remove unused code * fix: acl * docs: update * fix: upgrade * feat: hidden skip validator option and display should display data * feat: support root access all custom-request * chore: update deps * fix: limit height of modal body, Close T-1682 * fix: parse incorrect, Close T-1686 * fix: i18n, Close T-1684 * fix: linkage rules incorrect, Close T-1719 * fix: missing pass appends, Close T-1720 * fix: should update initialValues when it changed * feat: update better message * fix: permission incorrect * test: setup * refactor: fix locale * chore: update deps * feat: move to @nocobase * fix: dir * fix: ui.* * feat: add listByCurrentRole action, add decorator instead of acl * fix: remove title field * feat: compatible pervious version * feat: support passing x-* headers to custom-request * feat: support list all keys * fix: support baseURL, close T-2090 * fix: remove unused code * fix: sqlite, Close T-2092 * fix: close T-2089 * feat: alert error when request settings doesn't configure, Close T-2101 * feat: improve message * chore: fix eslint error * fix: fix version of plugin-custom-request * fix: build error --------- Co-authored-by: chenos <chenlinxh@gmail.com> Co-authored-by: Rain <958414905@qq.com>
19 lines
440 B
TypeScript
19 lines
440 B
TypeScript
import { i18n } from '@nocobase/client';
|
|
import { useTranslation as useT } from 'react-i18next';
|
|
|
|
export const NAMESPACE = 'custom-request';
|
|
|
|
export function lang(key: string) {
|
|
return i18n.t(key, { ns: NAMESPACE });
|
|
}
|
|
|
|
export function generateNTemplate(key: string) {
|
|
return `{{t('${key}', { ns: '${NAMESPACE}', nsMode: 'fallback' })}}`;
|
|
}
|
|
|
|
export function useTranslation() {
|
|
return useT(NAMESPACE, {
|
|
nsMode: 'fallback',
|
|
});
|
|
}
|