@@ -302,7 +302,7 @@ async function getRecords() {
302302 } catch (error ) {
303303 console .error (' Failed to get records:' , error );
304304 isError .value = true ;
305- errorMessage .value = ` Failed to fetch records. Please, try to re-run the action. ` ;
305+ errorMessage .value = t ( ` Failed to fetch records. Please, try to re-run the action. ` ) ;
306306 }
307307}
308308
@@ -319,7 +319,7 @@ async function getImages() {
319319 } catch (error ) {
320320 console .error (' Failed to get images:' , error );
321321 isError .value = true ;
322- errorMessage .value = ` Failed to fetch images. Please, try to re-run the action. ` ;
322+ errorMessage .value = t ( ` Failed to fetch images. Please, try to re-run the action. ` ) ;
323323 }
324324}
325325
@@ -375,7 +375,7 @@ async function convertImages(fieldName, img) {
375375
376376async function saveData() {
377377 if (! selected .value ?.length ) {
378- adminforth .alert ({ message: ' No items selected' , variant: ' warning' });
378+ adminforth .alert ({ message: t ( ' No items selected' ) , variant: ' warning' });
379379 return ;
380380 }
381381 try {
@@ -420,16 +420,16 @@ async function saveData() {
420420 timeout: ' unlimited' ,
421421 });
422422 isError .value = true ;
423- errorMessage .value = ` Failed to save data. You are not allowed to save. ` ;
423+ errorMessage .value = t ( ` Failed to save data. You are not allowed to save. ` ) ;
424424 } else {
425425 console .error (' Error saving data:' , res );
426426 isError .value = true ;
427- errorMessage .value = ` Failed to save data. Please, try to re-run the action. ` ;
427+ errorMessage .value = t ( ` Failed to save data. Please, try to re-run the action. ` ) ;
428428 }
429429 } catch (error ) {
430430 console .error (' Error saving data:' , error );
431431 isError .value = true ;
432- errorMessage .value = ` Failed to save data. Please, try to re-run the action. ` ;
432+ errorMessage .value = t ( ` Failed to save data. Please, try to re-run the action. ` ) ;
433433 } finally {
434434 isLoading .value = false ;
435435 }
@@ -474,15 +474,15 @@ async function runAiAction({
474474 if (rateLimitRes ?.error ) {
475475 isRateLimitExceeded = true ;
476476 adminforth .alert ({
477- message: ` Rate limit exceeded for "${actionType .replace (' _' , ' ' )}" action. Please try again later. ` ,
477+ message: t ( ` Rate limit exceeded for "${actionType .replace (' _' , ' ' )}" action. Please try again later. ` ) ,
478478 variant: ' danger' ,
479479 timeout: ' unlimited' ,
480480 });
481481 return ;
482482 }
483483 } catch (e ) {
484484 adminforth .alert ({
485- message: ` Error checking rate limit for "${actionType .replace (' _' , ' ' )}" action. ` ,
485+ message: t ( ` Error checking rate limit for "${actionType .replace (' _' , ' ' )}" action. ` ) ,
486486 variant: ' danger' ,
487487 timeout: ' unlimited' ,
488488 });
@@ -516,7 +516,7 @@ async function runAiAction({
516516 } catch (e ) {
517517 console .error (` Error during ${actionType } for item ${i }: ` , e );
518518 hasError = true ;
519- errorMessage = ` Failed to ${actionType .replace (' _' , ' ' )}. Please, try to re-run the action. ` ;
519+ errorMessage = t ( ` Failed to ${actionType .replace (' _' , ' ' )}. Please, try to re-run the action. ` ) ;
520520 return { success: false , index: i , error: e };
521521 }
522522 });
@@ -591,7 +591,7 @@ async function runAiAction({
591591 }
592592 isAtLeastOneInProgress = true ;
593593 adminforth .alert ({
594- message: ` Generation action "${actionType .replace (' _' , ' ' )}" failed for record: ${recordId }. Error: ${jobResponse .job ?.error || ' Unknown error' } ` ,
594+ message: t ( ` Generation action "${actionType .replace (' _' , ' ' )}" failed for record: ${recordId }. Error: ${jobResponse .job ?.error || ' Unknown error' } ` ) ,
595595 variant: ' danger' ,
596596 timeout: ' unlimited' ,
597597 });
0 commit comments