This is a multilingual dropdown component written in plain JavaScript with Bootstrap 4.1 that has only 1 class object and 2 functions which you can also easily implement on any front-end or back-end web framework of your choice.
GitHub:
github.com/kucxgithub/multilingualdropdown
To instantiate a new Language object, you only need to declare:
Language(country = String, language = String, img = String, link = String)
To print the list of language items on your dropdown, just call:
printLanguageList(language_items)
To print the main language to display on your dropdown, just call:
printLanguageToDisplay(language_items)
Please take note that you are free to customize the theme for the dropdown via CSS or Bootstrap classes.
Below is a sample snapshot.
I've tried to include as much languages as I can but please don't feel bad if I wasn't able to include your language, you can always include all of the languages you intend to implement on your web app by instantiating new Language items.
Enjoy! (^_^)
GitHub:
github.com/kucxgithub/multilingualdropdown
To instantiate a new Language object, you only need to declare:
Language(country = String, language = String, img = String, link = String)
- country: country's 3-letter code, or full name, if you prefer (String)
- language: language name (String)
- img: file location of the image (String)
- link: the URL or link you'd like to re-direct the user to (String)
To print the list of language items on your dropdown, just call:
printLanguageList(language_items)
- language_items: the array of your Language items
To print the main language to display on your dropdown, just call:
printLanguageToDisplay(language_items)
- language_items: the array of your Language items
Please take note that you are free to customize the theme for the dropdown via CSS or Bootstrap classes.
Below is a sample snapshot.
I've tried to include as much languages as I can but please don't feel bad if I wasn't able to include your language, you can always include all of the languages you intend to implement on your web app by instantiating new Language items.
Enjoy! (^_^)