Project

rtl

0.01
Low commit activity in last 3 years
No release in over a year
RTL helps you to check whether a language direction is right-to-left (RTL) or left-to-right (LTR) implicitly, by supplying its full name, iso code, or other options.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 2.2.20
~> 13
~> 0.21
 Project Readme

RTL

Gem Version Build Status Test Coverage Maintainability

This gem helps you check whether a language direction is right-to-left (RTL) or left-to-right (LTR) implicitly, by supplying its full name, iso code, or other options.

Installation

Add this line to your application's Gemfile:

gem 'rtl'

And then execute:

$ bundle

Or install it yourself as:

$ gem install rtl

Usage

Query a language by string or symbol:

require 'rtl'

Rtl.rtl? 'ar'                      #=> true
Rtl.rtl? :ara                      #=> true

Query a language by ISO 639 code, (the default) ..

Rtl.rtl? :syc, :iso_code           #=> true
Rtl.rtl? :eng                      #=> false

Or by ISO 15924 code ..

Rtl.rtl? 'Hung', :iso_long_code    #=> true

Or by ISO number ..

Rtl.rtl? 130, :iso_number          #=> true

Or by unicode alias ..

Rtl.rtl? 'Hebrew', :unicode_alias  #=> true

Or by full name ..

Rtl.rtl? :Persian, :full_name      #=> true

Or check all ways ..

Rtl.rtl? :kur, :all      #=> true

Which is the default, in case no scheme criteria is specified.

Get List of all languages by any of the above criteria:

Rtl.rtl_languages
#=> ["ar", "ara", "arc", "ae", "ave", "egy", "he", "heb", "nqo", "pal", "phn", "sam", "syc", "syr", "fa", "per", "fas", "ku", "kur"]

Rtl.rtl_languages :iso_long_code
#=> ...

Useful Links

Contributing

Bug reports and pull requests are very much appreciated at Github.

License

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