- Notifications
You must be signed in to change notification settings - Fork16
Vue component which shows the flag of the country from which the language comes from
License
NotificationsYou must be signed in to change notification settings
qWici/vue-lang-code-flags
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
Vue component which shows the flag of the country from which the language comes from
Get the package from NPM:
npm install vue-lang-code-flags --saveoryarn add vue-lang-code-flags --save
RegisterLangFlag
component in your app. You can use two approaches:
- in
main.js
you can mount it as a global Vue component:
importVuefrom'vue';importLangFlagfrom'vue-lang-code-flags';Vue.component('lang-flag',LangFlag);
- in a specific component (e.g.:
Component.vue
):
importLangFlagfrom'vue-lang-code-flags';newVue({components:{ LangFlag,},});
Then, after the proper mounting, in your template you can call it like this:
<lang-flagiso="en"/><lang-flagiso="ja":squared="false"/><lang-flagiso="zh"title="Some title"/>
Mandatory properties
Property | Description | Type | Value |
---|---|---|---|
iso | ISO 639-1 identifier of the language | String | one of the values definedhere |
Optional properties
Property | Description | Type | Default |
---|---|---|---|
squared | Squared flag | Boolean | true |
title | Title | String | null |
Here follows the list of the currently available flags.They are identified using theISO 639-1 standard.
Language | Code |
---|---|
Arabic | ar |
Armenian | am |
Azerbaijani | az |
Belarusian | be |
Bengali | bn |
Bulgarian | bg |
Chinese | zh |
Catalan | ca |
Czech | cs |
Dutch | nl |
English | en |
Estonian | et |
French | fr |
German | de |
Greek | el |
Hausa | ha |
Hindi | hi |
Hungarian | hu |
Indonesian | id |
Italian | it |
Japanese | ja |
Javanese | jv |
Khmer | km |
Korean | ko |
Latvian | lv |
Malay | ms |
Marathi | mr |
Dutch | nl |
Persian | fa |
Polish | pl |
Portuguese | pt |
Romanian | ro |
Russian | ru |
Spanish | es |
Swahili | sw |
Tamil | ta |
Telugu | te |
Thai | th |
Turkish | tr |
Uzbek | uz |
Vietnamese | vi |
Please follow the guidelineshere.
About
Vue component which shows the flag of the country from which the language comes from