Skip to content

Commit c1dfef6

Browse files
committed
fix: fix transtaliton support
1 parent b55419f commit c1dfef6

File tree

4 files changed

+13
-11
lines changed

4 files changed

+13
-11
lines changed

custom/DisableButton.vue

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,14 @@
1313
<Dialog
1414
ref="confirmDialog"
1515
class="w-96"
16-
header="Deactivate user"
16+
:header="t('Deactivate user')"
1717
:buttons="[
18-
{ label: 'Confirm', onclick: (dialog) => { deactivateUser(); dialog.hide(); } },
19-
{ label: 'Cancel', onclick: (dialog) => dialog.hide() },
18+
{ label: t('Confirm'), onclick: (dialog) => { deactivateUser(); dialog.hide(); } },
19+
{ label: t('Cancel'), onclick: (dialog) => dialog.hide() },
2020
]"
2121
>
2222
<div class="space-y-4">
23-
<p>Are you sure you want to deactivate this user?</p>
23+
<p>{{ $t('Are you sure you want to deactivate this user?') }}</p>
2424
</div>
2525
</Dialog>
2626
</template>
@@ -32,7 +32,9 @@ import { AdminUser, type AdminForthResourceCommon } from '@/types';
3232
import adminforth from "@/adminforth"
3333
import { callAdminForthApi } from '@/utils';
3434
import { IconUserRemoveSolid } from '@iconify-prerendered/vue-flowbite';
35+
import { useI18n } from 'vue-i18n';
3536
37+
const { t } = useI18n();
3638
const confirmDialog = ref(null);
3739
3840
function openDialog() {
@@ -56,7 +58,7 @@ async function deactivateUser() {
5658
}
5759
props.updateRecords();
5860
} catch (e) {
59-
adminforth.alert({message: `Error deactivating user. ${e}`, variant: "warning"});
61+
adminforth.alert({message: t(`Error deactivating user. ${e}`), variant: "warning"});
6062
}
6163
}
6264

index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ export default class UserSoftDelete extends AdminForthPlugin {
135135
}
136136

137137
const newUser = { [this.options.activeFieldName]: false };
138-
138+
139139
await this.adminforth.updateResourceRecord({
140140
resource: this.resourceConfig,
141141
recordId: id,

package-lock.json

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
"typescript": "^5.7.3"
2222
},
2323
"dependencies": {
24-
"adminforth": "^2.4.0-next.227"
24+
"adminforth": "^2.4.0-next.254"
2525
},
2626
"release": {
2727
"plugins": [

0 commit comments

Comments
 (0)