fix: translate formatted value when setting translation key (#12354)

* fix: translate formatted value when setting translation key

* linting
This commit is contained in:
Yasser Lahbibi
2022-03-25 18:11:13 +01:00
committed by GitHub
parent 3cb64c477a
commit ff4fc3b8a9

View File

@@ -143,7 +143,8 @@ export default defineComponent({
const displayValue = computed(() => {
if (computedFormat.value.text) {
return computedFormat.value.text;
const { text } = computedFormat.value;
return text.startsWith('$t:') ? t(text.slice(3)) : text;
}
if (isNil(props.value) || props.value === '') return null;