Quiz App Chinese Translation (#251)

* Quiz app zh-cn: Class 1 ~ 5

* Quiz app zh-cn: Class 6 ~ 10

* Quiz app zh-cn: Class 11 ~ 15

* Quiz app zh-cn: Class 16 ~ 20

* Quiz app zh-cn: Class 21 ~ 24

* Make course names same with https://github.com/microsoft/IoT-For-Beginners/blob/main/translations/README.zh-cn.md

* Quiz app zh-cn: Final check

* Quiz app zh-cn: Add zh-cn language to quiz app

* Quiz app en: Fix Typo

* Quiz app: Update package-lock.json

* Quiz app zh-cn: Improve.

* Quiz app zh-cn: Delete meaningless :

* Quiz app zh-cn: Fix typo
pull/270/head
Jks Liu 3 years ago committed by GitHub
parent d07e336876
commit fa7267cc4d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

File diff suppressed because it is too large Load Diff

@ -3,10 +3,10 @@
<nav> <nav>
<router-link class="navlink" to="/">Home</router-link> <router-link class="navlink" to="/">Home</router-link>
<label for="locale">locale</label> <label for="locale">locale</label>
<select v-model="locale"> <select v-model="native_name">
<option>ar</option> <option v-for="lan in iso_639_1_map_keys" :key="lan">
<option>bn</option> {{ lan }}
<option>en</option> </option>
</select> </select>
</nav> </nav>
<div id="app"> <div id="app">
@ -30,12 +30,26 @@ export default {
}, },
data() { data() {
return { return {
locale: "en", native_name: "English",
// Native names are from
// https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes
iso_639_1_map: {
"العربية": "ar",
"বাংলা": "bn",
"English": "en",
"中文 - 大陆简体": "zh-cn",
},
}; };
}, },
computed: {
iso_639_1_map_keys() {
return Object.keys(this.iso_639_1_map);
}
},
watch: { watch: {
locale(val) { native_name(val) {
this.$root.$i18n.locale = val; this.$root.$i18n.locale = this.iso_639_1_map[val];
}, },
}, },
created() { created() {

@ -413,7 +413,7 @@
"title": "Lesson 5 - Predict plant growth: Pre-Lecture Quiz", "title": "Lesson 5 - Predict plant growth: Pre-Lecture Quiz",
"quiz": [ "quiz": [
{ {
"questionText": "Iot devices can be used to support agriculture", "questionText": "IoT devices can be used to support agriculture",
"answerOptions": [ "answerOptions": [
{ {
"answerText": "True", "answerText": "True",
@ -515,7 +515,7 @@
"title": "Lesson 6 - Detect soil moisture: Pre-Lecture Quiz", "title": "Lesson 6 - Detect soil moisture: Pre-Lecture Quiz",
"quiz": [ "quiz": [
{ {
"questionText": "Iot devices can be used to detect ambient properties like soil moisture", "questionText": "IoT devices can be used to detect ambient properties like soil moisture",
"answerOptions": [ "answerOptions": [
{ {
"answerText": "True", "answerText": "True",
@ -621,7 +621,7 @@
"title": "Lesson 7 - Automated plant watering: Pre-Lecture Quiz", "title": "Lesson 7 - Automated plant watering: Pre-Lecture Quiz",
"quiz": [ "quiz": [
{ {
"questionText": "Iot devices are powerful enough to control water pumps", "questionText": "IoT devices are powerful enough to control water pumps",
"answerOptions": [ "answerOptions": [
{ {
"answerText": "True", "answerText": "True",
@ -2392,7 +2392,7 @@
"isCorrect": "false" "isCorrect": "false"
}, },
{ {
"answerText": "false", "answerText": "False",
"isCorrect": "true" "isCorrect": "true"
} }
] ]

@ -2,6 +2,7 @@
import ar from './ar.json'; import ar from './ar.json';
import bn from './bn.json'; import bn from './bn.json';
import en from './en.json'; import en from './en.json';
import zh_cn from './zh-cn.json';
//export const defaultLocale = 'en'; //export const defaultLocale = 'en';
@ -9,6 +10,7 @@ const messages = {
ar: ar[0], ar: ar[0],
bn: bn[0], bn: bn[0],
en: en[0], en: en[0],
"zh-cn": zh_cn[0],
}; };
export default messages; export default messages;

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save