Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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: 29 days 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 (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2021-04-29T19:19:19.000Z (over 3 years ago)
- Last Synced: 2024-04-29T09:41:12.313Z (8 months 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).
[![Build Status](https://travis-ci.org/richardvenneman/emoji_flag.svg?branch=master)](https://travis-ci.org/richardvenneman/emoji_flag)
[![Gem Version](https://badge.fury.io/rb/emoji_flag.svg)](https://badge.fury.io/rb/emoji_flag)
[![Maintainability](https://api.codeclimate.com/v1/badges/a89942c8e3aca31dfd6a/maintainability)](https://codeclimate.com/github/richardvenneman/emoji_flag/maintainability)
[![Test Coverage](https://api.codeclimate.com/v1/badges/a89942c8e3aca31dfd6a/test_coverage)](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).