feat: agregar traducción de descripciones y actualizar términos de kit a paq en varios componentes
This commit is contained in:
parent
fb37a2d62f
commit
2bb50c48c9
@ -12,6 +12,7 @@ const emit = defineEmits([
|
||||
/** Propiedades */
|
||||
const props = defineProps({
|
||||
event: Object,
|
||||
nameMap: { type: Object, default: () => ({}) },
|
||||
});
|
||||
|
||||
const icons = {
|
||||
@ -42,6 +43,14 @@ const borderColor = computed(() => {
|
||||
return `border-${colors[eventType.value]} dark:border-${colors[eventType.value]}-d`;
|
||||
});
|
||||
|
||||
const translatedDescription = computed(() => {
|
||||
let desc = props.event.description ?? '';
|
||||
for (const [key, value] of Object.entries(props.nameMap)) {
|
||||
desc = desc.replaceAll(`"${key}"`, `"${value}"`);
|
||||
}
|
||||
return desc;
|
||||
});
|
||||
|
||||
</script>
|
||||
|
||||
<template>
|
||||
@ -79,7 +88,7 @@ const borderColor = computed(() => {
|
||||
<div class="flex w-full flex-col justify-start space-y-2">
|
||||
<div>
|
||||
<h4 class="font-semibold">{{ $t('description') }}:</h4>
|
||||
<p>{{ event.description }}.</p>
|
||||
<p>{{ translatedDescription }}</p>
|
||||
</div>
|
||||
<div>
|
||||
<h4 class="font-semibold">{{ $t('author') }}:</h4>
|
||||
|
||||
@ -103,7 +103,7 @@ const remove = () => {
|
||||
v-if="item.is_bundle"
|
||||
class="shrink-0 px-1.5 py-0.5 text-xs font-bold rounded bg-purple-100 text-purple-700 dark:bg-purple-900/30 dark:text-purple-400"
|
||||
>
|
||||
KIT
|
||||
PAQ
|
||||
</span>
|
||||
<h4 class="text-sm font-semibold text-gray-800 dark:text-gray-200 line-clamp-2">
|
||||
{{ item.product_name }}
|
||||
|
||||
@ -35,6 +35,12 @@ const filters = reactive({
|
||||
user: ''
|
||||
});
|
||||
|
||||
const movements = {
|
||||
'entry': 'Entrada',
|
||||
'exit': 'Salida',
|
||||
'transfer': 'Transferencia'
|
||||
};
|
||||
|
||||
/** Métodos */
|
||||
const searcher = useSearcher({
|
||||
url: apiTo('index'),
|
||||
@ -133,6 +139,7 @@ onMounted(() => {
|
||||
<template v-for="event in items">
|
||||
<Item
|
||||
:event="event"
|
||||
:name-map="movements"
|
||||
@show="Modal.switchShowModal(event)"
|
||||
/>
|
||||
</template>
|
||||
|
||||
@ -133,7 +133,7 @@ watch(() => props.show, (val) => {
|
||||
<FormInput
|
||||
v-model="form.name"
|
||||
type="text"
|
||||
placeholder="Ej: Kit Gamer Pro"
|
||||
placeholder="Ej: Kit gols Pro"
|
||||
required
|
||||
/>
|
||||
<FormError :message="form.errors?.name" />
|
||||
|
||||
@ -149,7 +149,7 @@ watch(() => props.bundle, (bundle) => {
|
||||
<FormInput
|
||||
v-model="form.name"
|
||||
type="text"
|
||||
placeholder="Ej: Kit Gamer Pro"
|
||||
placeholder="Ej: Kit gols Pro"
|
||||
required
|
||||
/>
|
||||
<FormError :message="form.errors?.name" />
|
||||
|
||||
@ -121,7 +121,7 @@ onMounted(() => {
|
||||
? 'bg-green-100 text-green-800 dark:bg-green-900/30 dark:text-green-400'
|
||||
: 'bg-red-100 text-red-800 dark:bg-red-900/30 dark:text-red-400'"
|
||||
>
|
||||
{{ bundle.available_stock }} kits
|
||||
{{ bundle.available_stock }} paq.
|
||||
</span>
|
||||
</td>
|
||||
<td class="px-6 py-4 whitespace-nowrap text-center">
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user