Skip to content

Commit 277f58e

Browse files
committed
Add internationalization questions
1 parent c297bb7 commit 277f58e

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed

README.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,7 @@ List of 300 VueJS Interview Questions
212212
|203| [What are the drawbacks of dynamic directive arguments?](#what-are-the-drawbacks-of-dynamic-directive-arguments)|
213213
|204| [What is the special handling for null values in dynamic directive arguments?](#what-is-the-special-handling-for-null-values-in-dynamic-directive-arguments)|
214214
|205| [Can I use dynamic directive null value for slots?](#can-i-use-dynamic-directive-null-value-for-slots)|
215+
|206| [What is Vue I18n plugin?](#what-is-vue-i-8n--plugin)|
215216

216217
1. ### What is VueJS?
217218
**Vue.js** is an open-source, progressive Javascript framework for building user interfaces that aim to be incrementally adoptable. The core library of VueJS is focused on the `view layer` only, and is easy to pick up and integrate with other libraries or existing projects.
@@ -3539,3 +3540,40 @@ List of 300 VueJS Interview Questions
35393540
Dynamic argument values are expected to be strings but it allows `null` as a special value that explicitly indicates that the binding should be removed. Other types will be treated as mistakes and will trigger a warning. So null value can be applied for v-bind and v-on.
35403541
205. ### Can I use dynamic directive null value for slots?
35413542
No. It can be applied only for v-bind and v-on but not v-slot. This is because v-slot is not a binding and cannot be removed.
3543+
206. ### What is Vue I18n plugin?
3544+
Vue I18n is an internationalization plugin of Vue.js. It easily integrates some localization features to your Vue.js Application. The simple usage with in html would be as below,
3545+
```javascript
3546+
<script src="https://unpkg.com/vue/dist/vue.js"></script>
3547+
<script src="https://unpkg.com/vue-i18n/dist/vue-i18n.js"></script>
3548+
3549+
<div id="app">
3550+
<p>{{ $t("user.message") }}</p>
3551+
</div>
3552+
```
3553+
and after that configure them in javascript
3554+
```javascript
3555+
// Ready translated locale messages
3556+
const messages = {
3557+
en: {
3558+
user: {
3559+
message: 'Good morning'
3560+
}
3561+
},
3562+
de: {
3563+
user: {
3564+
message: 'Guten Morgen'
3565+
}
3566+
}
3567+
}
3568+
3569+
// Create VueI18n instance with options
3570+
const i18n = new VueI18n({
3571+
locale: 'de', // set locale
3572+
messages, // set locale messages
3573+
})
3574+
3575+
3576+
// Create a Vue instance with `i18n` option
3577+
new Vue({ i18n }).$mount('#app')
3578+
3579+
```

0 commit comments

Comments
 (0)