Sha256: 779d904391f91e6aed61cfaeec45023adf4d9bfb32e7b30ae89172ad34d5e0ab
Contents?: true
Size: 1.11 KB
Versions: 1
Compression:
Stored size: 1.11 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: "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. 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 | README.markdown |