Popravljeno prevajanje za pojme

pull/57/head
Jurij Podgoršek 2024-04-01 21:20:07 +02:00
parent cac81af886
commit 63d609a08f
6 changed files with 32 additions and 24 deletions

View File

@ -66,6 +66,7 @@ nastavitveStore.izberiJezik($i18n.locale.value)
} }
a.gumb { a.gumb {
text-transform: uppercase;
text-decoration: underline; text-decoration: underline;
font-size: 3rem; font-size: 3rem;
position: relative; position: relative;

View File

@ -45,13 +45,14 @@ const oddajPredlog = async data => {
// @TODO tole raje v pojmi.vue oz nov_pojem.vue - page! // @TODO tole raje v pojmi.vue oz nov_pojem.vue - page!
const etherNalozen = ev => { const etherNalozen = ev => {
if (props.pojem.nov) { if (props.pojem.nov) {
navigateTo('/manifest/dodaj/' + props.revisionId, { navigateTo(localePath({ name: 'pojem_dodaj', params: { guid: revisionId }}), {
replace: true replace: true
}) })
} else { } else {
navigateTo('/manifest/' + encodeURIComponent(props.pojem.naslov) + '/uredi/' + props.revisionId, { navigateTo(localePath({ name: 'pojem_uredi', params: {
replace: true naslov: encodeURIComponent(props.pojem.naslov),
}) guid: props.revisionId
}}), { replace: true })
} }
//window.location.hash = props.revisionId //window.location.hash = props.revisionId
} }

View File

@ -0,0 +1,21 @@
import { defineNuxtModule } from '@nuxt/kit'
export default defineNuxtModule({
setup(moduleOptions, nuxt) {
nuxt.hook('pages:extend', pages => {
pages.push({
name: 'pojem_poglej',
path: '/manifest/:naslov',
file: '~/pages/manifest/pojem.vue'
}, {
name: 'pojem_uredi',
path: '/manifest/:naslov/uredi/:guid',
file: '~/pages/manifest/pojem.vue'
}, {
name: 'pojem_dodaj',
path: '/manifest/dodaj/:guid',
file: '~/pages/manifest/dodaj.vue'
})
})
}
})

View File

@ -20,6 +20,7 @@ export default defineNuxtConfig({
}, },
modules: [ modules: [
['@pinia/nuxt', { autoImports: ['defineStore', 'acceptHMRUpdate']}], ['@pinia/nuxt', { autoImports: ['defineStore', 'acceptHMRUpdate']}],
'./modules/yufu-strani/module',
'@nuxtjs/i18n' '@nuxtjs/i18n'
//'nuxt-proxy' //'nuxt-proxy'
], ],
@ -39,23 +40,6 @@ export default defineNuxtConfig({
etherpadPrefix: process.env.ETHERPAD_PREFIX etherpadPrefix: process.env.ETHERPAD_PREFIX
} }
}, },
hooks: {
'pages:extend' (pages) {
pages.push({
name: 'pojem_poglej',
path: '/manifest/:naslov',
file: '~/pages/manifest/pojem.vue'
}, {
name: 'pojem_uredi',
path: '/manifest/:naslov/uredi/:guid',
file: '~/pages/manifest/pojem.vue'
}, {
name: 'pojem_dodaj',
path: '/manifest/dodaj/:guid',
file: '~/pages/manifest/dodaj.vue'
})
}
},
i18n: { i18n: {
locales: [{ locales: [{
code: 'sl', code: 'sl',

View File

@ -18,7 +18,7 @@ const resp = await etherFetch('/createPad', {
text: '' text: ''
}) })
const onZapri = () => { navigateTo('/manifest#skrol') } const onZapri = () => { navigateTo(localePath('manifest') + '#skrol') }
onMounted(() => { onMounted(() => {
poskrolaj(obrazec.value) poskrolaj(obrazec.value)

View File

@ -3,6 +3,7 @@
const store = usePojmiStore() const store = usePojmiStore()
const { poskrolaj } = useUi() const { poskrolaj } = useUi()
const { getRandomUUID } = useCrypto()
await store.naloziPojme() await store.naloziPojme()
@ -18,13 +19,13 @@ onMounted(() => {
<template> <template>
<h3 class="navodila" ref="navodila">{{ $t('Vsak lahko prispeva k vsebinam manifesta. Predlaga lahko nov pojem ali ureja, dopolni ali predela obstoječe.') }}</h3> <h3 class="navodila" ref="navodila">{{ $t('Vsak lahko prispeva k vsebinam manifesta. Predlaga lahko nov pojem ali ureja, dopolni ali predela obstoječe.') }}</h3>
<NuxtLink class="gumb" :to="localePath('pojem_dodaj')"> <NuxtLink class="gumb" :to="localePath({ name: 'pojem_dodaj', params: { guid: getRandomUUID() }})">
{{ $t('Dodaj nov pojem') }} {{ $t('Dodaj nov pojem') }}
</NuxtLink> </NuxtLink>
<NuxtLink <NuxtLink
v-for="pojem in Object.keys(store.pojmi)" v-for="pojem in Object.keys(store.pojmi)"
:naslov="pojem" :naslov="pojem"
:to="localePath('poglej_pojem', encodeURIComponent(pojem))" :to="localePath({ name: 'pojem_poglej', params: { naslov: encodeURIComponent(pojem) }})"
class="okvir"> class="okvir">
<h2>{{ pojem }}</h2> <h2>{{ pojem }}</h2>
</NuxtLink> </NuxtLink>