https://github.com/richardvenneman/emoji_flag
π³π± Emoji country flags for language codes and LCID's
https://github.com/richardvenneman/emoji_flag
emoji flags i18n language locale
Last synced: about 1 year ago
JSON representation
π³π± Emoji country flags for language codes and LCID's
- Host: GitHub
- URL: https://github.com/richardvenneman/emoji_flag
- Owner: richardvenneman
- License: mit
- Created: 2017-03-05T12:53:39.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2021-04-29T19:19:19.000Z (about 5 years ago)
- Last Synced: 2024-04-29T09:41:12.313Z (about 2 years ago)
- Topics: emoji, flags, i18n, language, locale
- Language: Ruby
- Homepage:
- Size: 21.5 KB
- Stars: 13
- Watchers: 2
- Forks: 5
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: MIT-LICENSE
Awesome Lists containing this project
README
# EmojiFlag
A simple gem to get the [emoji flag](http://emojipedia.org/flags/) for an [ISO 639-1 language code](http://www.loc.gov/standards/iso639-2/php/English_list.php) or locale id string (LCID).
[](https://travis-ci.org/richardvenneman/emoji_flag)
[](https://badge.fury.io/rb/emoji_flag)
[](https://codeclimate.com/github/richardvenneman/emoji_flag/maintainability)
[](https://codeclimate.com/github/richardvenneman/emoji_flag/test_coverage)
## Usage
```ruby
EmojiFlag.new('nl') # => π³π±
EmojiFlag.new('en') # => π¬π§
EmojiFlag.new('nl_BE') # => π§πͺ
EmojiFlag.new('en_US') # => πΊπΈ
```
Also supports passing in a symbol language code, making it easy to integrate with [Rails' `I18n.available_locales`](http://guides.rubyonrails.org/i18n.html]):
```ruby
EmojiFlag.new(:de) # => π©πͺ
```
## Installation
Add this line to your application's Gemfile:
```ruby
gem 'emoji_flag'
```
And then execute:
```bash
$ bundle
```
## License
The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).