@@ -3,7 +3,6 @@ import { callAdminForthApi } from '@/utils';
33import { type AdminForthResourceFrontend } from '../types/Common' ;
44import { useAdminforth } from '@/adminforth' ;
55import { showErrorTost } from '@/composables/useFrontendApi'
6- import { useI18n } from 'vue-i18n' ;
76
87let getResourceDataLastAbortController : AbortController | null = null ;
98export async function getList ( resource : AdminForthResourceFrontend , isPageLoaded : boolean , page : number | null , pageSize : number , sort : any , checkboxes :{ value : any [ ] } , filters : any = [ ] ) {
@@ -55,15 +54,14 @@ export async function getList(resource: AdminForthResourceFrontend, isPageLoaded
5554
5655
5756export async function startBulkAction ( actionId : string , resource : AdminForthResourceFrontend , checkboxes : { value : any [ ] } ,
58- bulkActionLoadingStates : { value : Record < string , boolean > } , getListInner : ( ) => Promise < any > ) {
57+ bulkActionLoadingStates : { value : Record < string , boolean > } , getListInner : ( ) => Promise < any > , t : ( key : string , vars ?: Record < string , any > ) => string ) {
5958 const action = resource ?. options ?. bulkActions ?. find ( a => a . id === actionId ) ;
6059 const { confirm, alert } = useAdminforth ( ) ;
61- const { t } = useI18n ( ) ;
6260
6361 if ( action ?. confirm ) {
6462 const confirmed = await confirm ( {
6563 title : action . confirm ,
66- message : t ( ` Deleting ${ checkboxes . value . length } ${ checkboxes . value . length === 1 ? 'item' : 'items' } . This process is irreversible.` ) ,
64+ message : ` ${ t ( ' Deleting' ) } ${ checkboxes . value . length } ${ checkboxes . value . length === 1 ? t ( 'item' ) : t ( 'items' ) } . ${ t ( ' This process is irreversible.' ) } ` ,
6765 } ) ;
6866 if ( ! confirmed ) {
6967 return ;
0 commit comments