
Research
/Security News
9 Malicious NuGet Packages Deliver Time-Delayed Destructive Payloads
Socket researchers discovered nine malicious NuGet packages that use time-delayed payloads to crash applications and corrupt industrial control systems.
Enhance I18n localize to use Parsi digits and Jalaly dates in Farsi (فارسی) locale.
For changing digits in string/integer/float with Unicode Parsi ones, we use
parsi-digits:
require 'parsi-localize'
I18n.l "15,000 تومان"
=> "۱۵,۰۰۰ تومان"
Another useful feature of parsi-digits is that you can parse strings with Unicode
digits to numerics:
"۱۲۳۴۵".to_i
=> 12345
"۱۹/۸".to_f
=> 19.8
To have a real localization of dates in I18n#localize (converting them to Jalali date),
we uses parsi-date:
I18n.l Time.now, fromat: "%y/%m/%d %H:%M:%S"
=> "۹۰/۱۰/۱۳ ۰۵:۴۳:۳۲"
As you know, date and time formats can be stored in the locale file. For example with
fa:
time:
formats:
default: "%y/%m/%d %H:%M:%S"
short: "%d %B، %H:%M"
long: "%A، %e %B %Y، ساعت %H:%M:%S"
date:
formats:
default: "%y/%m/%d"
short: "%d %B"
long: "%A، %e %B %Y"
in your locale file, you will get:
date = Date.today
I18n.l date
=> "۹۰/۱۱/۱۶"
I18n.l date, format: :short
=> "۱۶ بهمن"
I18n.l date, format: :long
=> "یکشنبه، ۱۶ بهمن ۱۳۹۰"
time = Time.now
I18n.l time
=> "۹۰/۱۱/۱۶ ۱۵:۴۳:۳۰"
I18n.l time, format: :short
=> "۱۶ بهمن، ۱۵:۴۳"
I18n.l time, format: :long
=> "یکشنبه، ۱۶ بهمن ۱۳۹۰، ساعت ۱۵:۴۳:۳۰"
For more info on date formating see parsi-date and Ruby's built-in date docs.
Copyright (c) 2012 Hassan Zamani, released under the MIT license.
FAQs
Unknown package
We found that parsi-localize demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Research
/Security News
Socket researchers discovered nine malicious NuGet packages that use time-delayed payloads to crash applications and corrupt industrial control systems.

Security News
Socket CTO Ahmad Nassri discusses why supply chain attacks now target developer machines and what AI means for the future of enterprise security.

Security News
Learn the essential steps every developer should take to stay secure on npm and reduce exposure to supply chain attacks.