iview-ui in English language?

2k Views Asked by At

The official docs of iview are mostly in Chinese.

This link iview Installation contains code which is in English but when you run the code, the modal options - "Cancel" is showing in Chinese.

Is there any way to fix that, I mean convert it to English?

enter image description here

I tried to follow this link from Github issue but it was for NodeJS. I want to make it work without NodeJS.

2

There are 2 best solutions below

6
Sergio On BEST ANSWER

You need to define the Locale you want to use. I'm using English and Swedish settings for example.

You can do this like:

import Vue from 'vue';
import iView from 'iview';
import locale from 'iview/dist/locale/en-US';
Vue.use(iView, {locale: locale});

This way all components will use English text.

0
Dantio On

Use with CDN:

<script src="//unpkg.com/vue"></script>
<script src="//unpkg.com/iview/dist/iview.min.js"></script>
<script src="//unpkg.com/iview/dist/locale/en-US.js"></script>
<script>
  iview.lang('en-US');
</script>

For more language options see here