Skip to content

Latest commit

 

History

History
38 lines (28 loc) · 1.36 KB

README.md

File metadata and controls

38 lines (28 loc) · 1.36 KB

EmojiFlag

A simple gem to get the emoji flag for an ISO 639-1 language code or locale id string (LCID).

Build Status Gem Version Maintainability Test Coverage

Usage

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:

EmojiFlag.new(:de) # => 🇩🇪

Installation

Add this line to your application's Gemfile:

gem 'emoji_flag'

And then execute:

$ bundle

License

The gem is available as open source under the terms of the MIT License.