mirror of
https://github.com/dbeaver/cloudbeaver.git
synced 2026-09-24 16:04:36 +08:00
fix(core-localization): useTranslate hooks ordering
This commit is contained in:
@@ -16,11 +16,11 @@ import { TLocalizationToken } from './TLocalizationToken';
|
||||
export function useTranslate(): (token: TLocalizationToken) => string;
|
||||
export function useTranslate(token: TLocalizationToken): string;
|
||||
export function useTranslate(token?: TLocalizationToken): string | ((token: TLocalizationToken) => string) {
|
||||
if (!token) {
|
||||
return useService(LocalizationService).translate;
|
||||
}
|
||||
|
||||
const localizationService = useService(LocalizationService);
|
||||
|
||||
if (!token) {
|
||||
return localizationService.translate;
|
||||
}
|
||||
|
||||
return useObserver(() => localizationService.translate(token));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user