added i18n for backend errors

This commit is contained in:
2026-01-28 19:31:14 +01:00
parent f029a322c4
commit 81d9624c9e
15 changed files with 316 additions and 162 deletions

View File

@@ -41,8 +41,10 @@ import { updateSettings } from '../api/account'
import { updateLocalUser } from '../store'
import type { User } from '../types'
import { useFluent } from 'fluent-vue';
import { useErrorTranslator } from '../errors';
const { $t } = useFluent();
const { translateError } = useErrorTranslator();
const props = defineProps<{ user: User | null }>()
const emit = defineEmits(['close', 'updated'])
@@ -84,7 +86,7 @@ async function submit() {
emit('updated')
emit('close')
} catch (err: any) {
errorMessage.value = err?.message || $t('settings-error-failed')
errorMessage.value = translateError(err);
} finally {
isSubmitting.value = false
}