Sha256: e52765be64297cd13d57cb65736753a540db0fe2bb378c4ddf50cdbaa0ffbd5e

Contents?: true

Size: 1.16 KB

Versions: 1

Compression:

Stored size: 1.16 KB

Contents

ParsiLocalize
=============

Change I18n localize to use parsi digits and jalaly dates in farsi (فارسی) locale.
This gem contains two sections

ParsiDigits
-----------
Simply change digits in a string/integer/float to unicode parsi digits.

(In all the example below we have right to left issues to present output!)

Example:

    require 'parsi_digits'
    ‪"15,000 تومان".with_parsi_digits => "۱۵,۰۰۰ تومان"
    123.25.with_parsi_digits => "۱۲۳/۲۵"


ParsiLocalize
-------------
Change behaivor of I18n#localize so that it localize digits and dates in 'farsi' locale.

    require 'parsi_localize'
    I18n.l ‪"15,000 تومان" => "۱۵,۰۰۰ تومان"
    I18n.l Time.now, fromat: "%y/%m/%d %H:%M:%S" => "۹۰/۱۰/۱۳ ۰۵:۴۳:۳۲"

If you don't set date format, it uses the default locale format (time.formats.default) wich you can set in your locale file. For more info on dateformating see 'jalalidate' docs
For example with

    fa:
      time:
        formats:
          default: "%d %b %y"
          
in your locale file you will get:

    I18n.l Time.now => "۱۳ دی ۹۰"

Copyright (c) 2012 Hassan Zamani, released under the MIT license.

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
parsi-localize-0.1.1 README.markdown