Skip to content

Commit 1ef6041

Browse files
committed
made language adding thing dynami
1 parent 9804f10 commit 1ef6041

File tree

1 file changed

+27
-16
lines changed

1 file changed

+27
-16
lines changed

src/views/Practise.vue

Lines changed: 27 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,9 @@
248248
249249
import { KalaamKeywords } from "kalaam";
250250
251+
const langs = Object.keys(KalaamKeywords)
252+
console.log("SDFsfsdfsf",langs)
253+
251254
//CodeMirror is an npm package whcih provides rich code editors
252255
import { codemirror } from "vue-codemirror";
253256
@@ -284,7 +287,7 @@ import "codemirror/addon/fold/xml-fold.js";
284287
// import Compile from '../lib/Compiler/main';
285288
286289
import { Compile } from "kalaam";
287-
290+
console.log("ankitedfg",Compile)
288291
// //Central data storage of Kalaam
289292
// import { mapState } from "vuex";
290293
@@ -360,7 +363,8 @@ export default {
360363
361364
model: null,
362365
363-
options: ["Hindi", "Marathi","Bengali","Telugu"],
366+
// options: ["Hindi", "Marathi","Bengali","Telugu"],
367+
options: langs,
364368
};
365369
},
366370
@@ -374,24 +378,31 @@ export default {
374378
computed: {},
375379
watch: {
376380
ActiveLanguage: function (newval, oldval) {
377-
if (this.ActiveLanguage == "Hindi") {
378-
localStorage.setItem("ActiveLangugae", this.ActiveLanguage);
381+
if(this.ActiveLanguage && langs.includes(this.ActiveLanguage)){
382+
localStorage.setItem("ActiveLangugae", this.ActiveLanguage)
383+
this.Keyword = KalaamKeywords[this.ActiveLanguage];
384+
}else{
385+
localStorage.setItem("ActiveLangugae", "Hindi")
386+
this.Keyword = KalaamKeywords["Hindi"];
387+
}
388+
// if (this.ActiveLanguage == "Hindi") {
389+
// localStorage.setItem("ActiveLangugae", this.ActiveLanguage);
379390
380-
this.Keyword = KalaamKeywords.Hindi;
381-
} else if (this.ActiveLanguage == "Marathi") {
382-
localStorage.setItem("ActiveLangugae", this.ActiveLanguage);
391+
// this.Keyword = KalaamKeywords.Hindi;
392+
// } else if (this.ActiveLanguage == "Marathi") {
393+
// localStorage.setItem("ActiveLangugae", this.ActiveLanguage);
383394
384-
this.Keyword = KalaamKeywords.Marathi;
385-
}
386-
else if (this.ActiveLanguage == "Bengali") {
387-
localStorage.setItem("ActiveLangugae", this.ActiveLanguage);
395+
// this.Keyword = KalaamKeywords.Marathi;
396+
// }
397+
// else if (this.ActiveLanguage == "Bengali") {
398+
// localStorage.setItem("ActiveLangugae", this.ActiveLanguage);
388399
389-
this.Keyword = KalaamKeywords.Bengali;
390-
} else if (this.ActiveLanguage == "Telugu") {
391-
localStorage.setItem("ActiveLangugae", this.ActiveLanguage);
400+
// this.Keyword = KalaamKeywords.Bengali;
401+
// } else if (this.ActiveLanguage == "Telugu") {
402+
// localStorage.setItem("ActiveLangugae", this.ActiveLanguage);
392403
393-
this.Keyword = KalaamKeywords.Telugu;
394-
}
404+
// this.Keyword = KalaamKeywords.Telugu;
405+
// }
395406
},
396407
},
397408

0 commit comments

Comments
 (0)