Can anyone help me here please?
so at the moment, this works for language 'en', but what about 'fr and 'es' and 'de'
this.coursesuite = courseResponse.data.en.config.coursesuite;
this.coursename = courseResponse.data.en.config.coursename;
this.courseid = courseResponse.data.en.config.courseid;
this.lms = courseResponse.data.en.config.lms;
this.defaultlang = courseResponse.data.en.config.defaultlang;
I want to replace 'en' with: this.$route.params.lang;
when I select a course in Spanish, ES is passed into the query params but I would like to use that in my object to show ES, not EN
async fetchCourses() {
const courseResponse = await axios.get(
`http://127.0.0.1:8000/api/course/${this.$route.params.lang}/${this.$route.params.course}`
);
let courselang = courseResponse.data + this.$route.params.lang;
console.log("courselang: " + courselang);
this.coursesuite = courseResponse.data.en.config.coursesuite;
this.coursename = courseResponse.data.en.config.coursename;
this.courseid = courseResponse.data.en.config.courseid;
this.lms = courseResponse.data.en.config.lms;
this.defaultlang = courseResponse.data.en.config.defaultlang;
console.log("HERE I AM: ", courseResponse.data.en.config.coursesuite);
},
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community