Skip to content

Commit

Permalink
update i18n
Browse files Browse the repository at this point in the history
  • Loading branch information
frylock34 committed Dec 16, 2021
1 parent 8023cc8 commit d317d27
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 14 deletions.
2 changes: 1 addition & 1 deletion nuxt.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ const config: NuxtConfig = {
'@nuxtjs/apollo',
'@nuxtjs/recaptcha',
//'@nuxt/content',
'nuxt-i18n'
'@nuxtjs/i18n'
],
content: {
markdown: {
Expand Down
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
"@nuxtjs/axios": "^5.10.3",
"@nuxtjs/feed": "^1.1.0",
"@nuxtjs/google-analytics": "^2.2.0",
"@nuxtjs/i18n": "^7.2.0",
"@nuxtjs/pwa": "^3.0.0-beta.19",
"@nuxtjs/recaptcha": "^0.6.2",
"@nuxtjs/robots": "^2.4.2",
Expand All @@ -40,12 +41,10 @@
"micro": "^9.3.4",
"node-html-parser": "^1.2.11",
"nuxt": "^2.14.6",
"nuxt-i18n": "^6.15.1",
"ts-node": "^8.3.0",
"typeface-roboto": "0.0.75",
"v-mask": "^2.0.2",
"vue": "^2.6.12",
"vue-i18n": "^8.21.1",
"vue-inputmask": "^0.2.1",
"vue-property-decorator": "^8.3.0",
"vue-the-mask": "^0.11.1",
Expand Down
20 changes: 10 additions & 10 deletions store/printParameters.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { ActionTree, MutationTree, GetterTree, ActionContext } from 'vuex'
import { PrintParameter } from '~/types/printParameters';
import { RootState } from '.';
import { RootState } from '.';

export interface PrintParametersState{
export interface PrintParametersState {
printParameters: PrintParameter[]
loaded: boolean
}
Expand All @@ -13,7 +13,7 @@ export const state = (): PrintParametersState => ({
})

export const mutations: MutationTree<PrintParametersState> = {
setPrintParameters (state, data: any){
setPrintParameters (state, data: any) {
state.printParameters = data
}
}
Expand All @@ -22,25 +22,25 @@ export const getters: GetterTree<PrintParametersState, RootState> = {
allPrintParameters (state): PrintParameter[] {
return state.printParameters
},
printParametersBySku (state): (sku: string) => PrintParameter[]{
return(sku: string)=>{
printParametersBySku (state): (sku: string) => PrintParameter[] {
return (sku: string) => {
return state.printParameters.filter(m => m.sku.startsWith(sku))
}
}
}

export const actions: ActionTree<PrintParametersState, RootState> = {
async loadPrintParameters ({commit}){
let data: {entries: PrintParameter[]}
async loadPrintParameters ({ commit }) {
let data: { entries: PrintParameter[] }
let response = await fetch(`https://api2.stereotech.org/api/collections/get/printingParameters?token=${process.env.COCKPIT_TOKEN}`, {
method: 'post',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
lang: this.$i18n.locale
})
lang: this
})
})
data = await response.json()
const printParameters:PrintParameter[] = data.entries
const printParameters: PrintParameter[] = data.entries
commit('setPrintParameters', printParameters)
}
}
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@
"types": [
"@types/node",
"@nuxt/types",
"@nuxtjs/i18n",
"@nuxt/vue-app",
"vuetify",
"vue-apollo/types",
"nuxt-i18n",
"@nuxtjs/axios",
"@nuxt/content"
]
Expand Down

0 comments on commit d317d27

Please sign in to comment.