fix: translations

This commit is contained in:
2026-04-02 11:41:44 +02:00
parent a7f69c854a
commit 551b5ef77d
5 changed files with 157 additions and 232 deletions

View File

@@ -41,7 +41,7 @@
}" color="primary" class="text-white bg-(--accent-blue-light) dark:bg-(--accent-blue-dark) px-12!">
Cancel
</UButton>
<UButton color="primary" @click="saveDescription"
<UButton color="primary" @click="productStore.saveProductDescription(productID, toLangId)"
class="text-white bg-(--accent-blue-light) dark:bg-(--accent-blue-dark) px-12!">
Save
</UButton>

View File

@@ -1,34 +1,34 @@
<template>
<div class="flex flex-col">
<p class="text-sm">Country/Currency:</p>
<USelectMenu v-model="country" :items="countries"
class="w-44 bg-(--main-light) dark:bg-(--black) rounded-md hover:none! text-sm!" valueKey="id"
:searchInput="false">
<template #default="{ modelValue }">
<div class="flex items-center gap-1">
<span class="font-medium dark:text-white text-black whitespace-nowrap">{{ modelValue.name }} / {{
currentCountry?.ps_currency.iso_code }}</span>
</div>
</template>
<template #item-leading="{ item }">
<div class="flex items-center rounded-md cursor-pointer transition-colors">
<span class="ml-2 dark:text-white text-black font-medium">{{ item.name }}</span>
</div>
</template>
</USelectMenu>
</div>
<USelectMenu v-model="country" :items="countries" value-key="id"
class="w-48 bg-(--main-light) dark:bg-(--black) rounded-md shadow-sm" :searchInput="false">
<template #default>
<div class="flex flex-col items-start leading-tight">
<span class="text-xs text-gray-400">
Country/Currency
</span>
<span class="font-medium dark:text-white text-black">
{{ country?.name }} / {{ country?.ps_currency.iso_code }}
</span>
</div>
</template>
<template #item-leading="{ item }">
<div class="flex items-center gap-2 cursor-pointer">
<span class="text-lg">{{ item.flag }}</span>
<span class="font-medium dark:text-white text-black">
{{ item.name }}
</span>
</div>
</template>
</USelectMenu>
</template>
<script setup lang="ts">
import { countries, currentCountry, switchLocalization } from '@/router/langs'
import { useRouter, useRoute } from 'vue-router'
import { useCookie } from '@/composable/useCookie'
import { computed, watch } from 'vue'
const router = useRouter()
const route = useRoute()
const cookie = useCookie()
const country = computed({
get() {
return currentCountry.value

View File

@@ -1,24 +1,30 @@
<template>
<div class="flex flex-col">
<p class="text-sm">Language:</p>
<USelectMenu v-model="locale" :items="langs"
class="w-40 bg-(--main-light) dark:bg-(--black) rounded-md shadow-sm hover:none!" valueKey="iso_code"
:searchInput="false">
<template #default="{ modelValue }">
<div class="flex items-center gap-1">
<!-- <span class="text-md dark:text-white text-black">{{langs.find(x => x.iso_code == modelValue)?.flag}}</span> -->
<span class="font-medium dark:text-white text-black">{{langs.find(x => x.iso_code ==
modelValue)?.name}}</span>
<USelectMenu v-model="locale" :items="langs" value-key="iso_code"
class="w-48 bg-(--main-light) dark:bg-(--black) rounded-md shadow-sm" :searchInput="false">
<template #default>
<div class="flex items-center gap-2">
<!-- <span class="text-lg">{{ selectedLang?.flag }}</span> -->
<div class="flex flex-col leading-tight items-start">
<span class="text-xs text-gray-400">
Language
</span>
<span class="font-medium dark:text-white text-black">
{{ selectedLang?.name || 'Select language' }}
</span>
</div>
</template>
<template #item-leading="{ item }">
<div class="flex items-center rounded-md cursor-pointer transition-colors">
<!-- <span class="text-md ">{{ item.flag }}</span> -->
<span class="ml-2 dark:text-white text-black font-medium">{{ item.name }}</span>
</div>
</template>
</USelectMenu>
</div>
</div>
</template>
<template #item-leading="{ item }">
<div class="flex items-center gap-2">
<span class="text-lg">{{ item.flag }}</span>
<span class="font-medium dark:text-white text-black">
{{ item.name }}
</span>
</div>
</template>
</USelectMenu>
</template>
<script setup lang="ts">
@@ -31,6 +37,10 @@ import { i18n } from '@/plugins/02_i18n'
const router = useRouter()
const route = useRoute()
const selectedLang = computed(() =>
langs.find(item => item.iso_code === locale.value)
)
const cookie = useCookie()
const locale = computed({
get() {