From e17ba84505e92d0fd174b54219345108c540c76d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jurij=20Podgor=C5=A1ek?= Date: Mon, 1 Apr 2024 15:25:09 +0200 Subject: [PATCH] Jeziki, WIP izbor jezika, store za stanje strani --- nuxt/components/IzborJezika.vue | 41 ++++++++++++++++++++++++++++++++ nuxt/lang/en-US.json | 4 ++++ nuxt/lang/en.json | 4 ++++ nuxt/lang/hr.json | 3 +++ nuxt/lang/si.json | 3 +++ nuxt/public/images/jezik_en.png | Bin 0 -> 460 bytes nuxt/public/images/jezik_hr.png | Bin 0 -> 571 bytes nuxt/public/images/jezik_si.png | Bin 0 -> 514 bytes nuxt/stores/nastavitve.js | 19 +++++++++++++++ 9 files changed, 74 insertions(+) create mode 100644 nuxt/components/IzborJezika.vue create mode 100644 nuxt/lang/en-US.json create mode 100644 nuxt/lang/en.json create mode 100644 nuxt/lang/hr.json create mode 100644 nuxt/lang/si.json create mode 100644 nuxt/public/images/jezik_en.png create mode 100644 nuxt/public/images/jezik_hr.png create mode 100644 nuxt/public/images/jezik_si.png create mode 100644 nuxt/stores/nastavitve.js diff --git a/nuxt/components/IzborJezika.vue b/nuxt/components/IzborJezika.vue new file mode 100644 index 0000000..83554c2 --- /dev/null +++ b/nuxt/components/IzborJezika.vue @@ -0,0 +1,41 @@ + + + + + diff --git a/nuxt/lang/en-US.json b/nuxt/lang/en-US.json new file mode 100644 index 0000000..1010d29 --- /dev/null +++ b/nuxt/lang/en-US.json @@ -0,0 +1,4 @@ +{ + "domov": "home", + "jugofuturizem": "yugofuturism" +} diff --git a/nuxt/lang/en.json b/nuxt/lang/en.json new file mode 100644 index 0000000..1010d29 --- /dev/null +++ b/nuxt/lang/en.json @@ -0,0 +1,4 @@ +{ + "domov": "home", + "jugofuturizem": "yugofuturism" +} diff --git a/nuxt/lang/hr.json b/nuxt/lang/hr.json new file mode 100644 index 0000000..172c61a --- /dev/null +++ b/nuxt/lang/hr.json @@ -0,0 +1,3 @@ +{ + "jugofuturizem": "jugofuturizem" +} diff --git a/nuxt/lang/si.json b/nuxt/lang/si.json new file mode 100644 index 0000000..172c61a --- /dev/null +++ b/nuxt/lang/si.json @@ -0,0 +1,3 @@ +{ + "jugofuturizem": "jugofuturizem" +} diff --git a/nuxt/public/images/jezik_en.png b/nuxt/public/images/jezik_en.png new file mode 100644 index 0000000000000000000000000000000000000000..a52a3ea51b895ba966c7fb4b60f3e5dd0fc84d1d GIT binary patch literal 460 zcmV;-0Wk`3BUkf17uo`6#?m0*LU8zdW~6C@+BLAVp+z6S)622h*Y zpY$XI^8fqUemo2Ga6se$YNmlPAY2XY-s)HWlv3;|))X5dMAD@pI)q6~Elc5ZDubV_ zD8e=)c`5!e%b|8{;ypZ5?6lVNUIP;Mb0DTi2Y-jhL}cQ(8k93ffd3OTGm)iuwDT(>M;u-39L;Mog^CzxkUSvWGoaSD6Ptt%bRR+b6X9p zBIyJrut!Q6=mhrIO9lM}du-^K4r172Er;+@Y6@GJXT|-YI7I^43(78K3f2nwp)eTY zEuqa0VUD`H)pc-(MVy;4Vexuj&kF4xi-0omaNTn87>~q*=F5vp=1e5A5#1m@@q4xu zqvp&{h`vz=yt}~7L;+J#{uG_+R*_V}H58L@XU5-}RBu4^P)7`8#0o+rZ0p_`jjd~G7 z6o3iVu64mGl97S2ojfDsFZ{65LHkY}o{ZDyKCd_kN(~5J?EuI0=s;i8M;tZ7>uRon z<2aSgiHi{bkX@aJRhf(jE_t!Dv1i+oR)2W-zAVtMGhY`3jkV#$CNYKAR|}a0Bf;}cg4_w)wXAR?c)v-A zGErhc5szTNeFCV666vFlNCSS!eW0tk;4vaU~=`isb&U za;jj35GVZ7!-l;4pC8XQQGqm3h!`P05G#Z>5u4w7h$gv;Uor-|WXwu~%&KAs^K4c9 zLi4edqYB1$jB?GxFziK9q{l&^&j9J$=1rK#3^)@cPJ810eR$pjb5h_$N}2=#)ew8l zcp`Z9LWosf)?l}z!FEeE6!}uhE&#WAPrn)sEJ4t9l2AqM8Sn%^^H@e*h#v&O6r(Ik zssmxbxJ+V2Na(p_SJ_=$L63jv6!qD~yf zmcN5gMcegnN>xzFiy(RxJTuqDH#s!hmQ{&DT*7?q^EVWsP{sb(l~G1kB}16cdE%!D zfGhzKRT`d!;F^BCNs|A=>t_=HSpf0_$Q7NqK60eA*2DMB=HO=V?JQHt8>SIJ7gRzp zUSPOWO3m$OqUc3#K8AZl$H3A}u!iXx<0oPYV|C2q7p}f3-Sm!k4*&oF07*qoM6N<$ Ef?wm){{R30 literal 0 HcmV?d00001 diff --git a/nuxt/stores/nastavitve.js b/nuxt/stores/nastavitve.js new file mode 100644 index 0000000..c51f42b --- /dev/null +++ b/nuxt/stores/nastavitve.js @@ -0,0 +1,19 @@ +export const useNastavitveStore = defineStore('nastavitve', { + state: () => ({ + izbraniJezik: 'hr', + mozniJeziki: { + si: 'Slovensko', + hr: 'Hrvatski', + en: 'English' + } + }), + actions: { + izberiJezik(jezik) { + if (Object.keys(this.mozniJeziki).indexOf(jezik) >= 0) { + this.izbraniJezik = jezik + console.log(useNuxtApp().$i18n.availableLocales) + //useNuxtApp().$i18n.setLocale(jezik) + } + } + } +})