https://github.com/qwici/vue-lang-code-flags
Vue component which shows the flag of the country from which the language comes from
https://github.com/qwici/vue-lang-code-flags
flags vue-components vuejs2
Last synced: 10 days ago
JSON representation
Vue component which shows the flag of the country from which the language comes from
- Host: GitHub
- URL: https://github.com/qwici/vue-lang-code-flags
- Owner: qWici
- License: mit
- Created: 2018-10-18T15:32:09.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2023-11-18T10:20:36.000Z (over 2 years ago)
- Last Synced: 2025-02-01T01:33:41.295Z (about 1 year ago)
- Topics: flags, vue-components, vuejs2
- Language: Vue
- Size: 38.1 KB
- Stars: 12
- Watchers: 3
- Forks: 16
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# Flags by language codes
Vue component which shows the flag of the country from which the language comes from
## How to install
Get the package from NPM:
```bash
npm install vue-lang-code-flags --save
or
yarn add vue-lang-code-flags --save
```
## How to use
Register `LangFlag` component in your app. You can use two approaches:
- in `main.js` you can mount it as a global Vue component:
```js
import Vue from 'vue';
import LangFlag from 'vue-lang-code-flags';
Vue.component('lang-flag', LangFlag);
```
- in a specific component (e.g.: `Component.vue`):
```js
import LangFlag from 'vue-lang-code-flags';
new Vue({
components: {
LangFlag,
},
});
```
Then, after the proper mounting, in your template you can call it like this:
```html
```
### API
Mandatory properties
| Property | Description | Type | Value |
| :------- | :--------------------------------------- | :------- | :------------------------------------------------- |
| iso | **ISO 639-1** identifier of the language | `String` | one of the values defined [here](#available-flags) |
Optional properties
| Property | Description | Type | Default |
| :------- | :----------- | :-------- | :------ |
| squared | Squared flag | `Boolean` | `true` |
| title | Title | `String` | `null` |
## Available Flags
Here follows the list of the currently available flags.
They are identified using the [ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) 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 |
## Contributing
Please follow the guidelines [here](https://github.com/qWici/vue-lang-code-flags/blob/master/CONTRIBUTING.md).