From 6e90ddc37d02919517ca87f71d68c6c616ff3c14 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sedat=20=C3=96zt=C3=BCrk?= Date: Mon, 18 Aug 2025 22:13:26 +0300 Subject: [PATCH] =?UTF-8?q?Hata=20d=C3=BCzeltildi.=20ApiGenerateBackground?= =?UTF-8?q?Workers?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ui/src/services/UiEvalService.tsx | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/ui/src/services/UiEvalService.tsx b/ui/src/services/UiEvalService.tsx index 81e4ff5b..3ac645a3 100644 --- a/ui/src/services/UiEvalService.tsx +++ b/ui/src/services/UiEvalService.tsx @@ -1,6 +1,7 @@ import { Notification, toast } from '@/components/ui' import { generateBackgroundWorkers } from '@/services/background-worker.service' -import { useLocalization } from '@/utils/hooks/useLocalization' +import { getLocalization } from '@/services/localization.service' +import { store } from '@/store' export abstract class UiEvalService { static Init = () => { @@ -8,7 +9,22 @@ export abstract class UiEvalService { } static ApiGenerateBackgroundWorkers = () => { - const { translate } = useLocalization() + // Get store state directly instead of using hook + const state = store.getState() + const { texts, config } = state.abpConfig + + // Create translate function similar to useLocalization hook + const translate = (localizationKey: string, params?: Record, defaultResourceName?: string): string => { + if (!texts) { + return localizationKey + } + return getLocalization( + texts, + defaultResourceName ?? config?.localization?.defaultResourceName, + localizationKey, + params + ) + } const asyncCall = async () => { await generateBackgroundWorkers()