class R18n::Locales::Fa

Persian locale

Public Instance Methods

format_float(integer) click to toggle source

Change numerals to Persian

Calls superclass method R18n::Locale#format_float
# File lib/r18n-core/locales/fa.rb, line 41
def format_float(integer)
  persian_numerals super
end
format_integer(integer) click to toggle source

Change numerals to Persian

Calls superclass method R18n::Locale#format_integer
# File lib/r18n-core/locales/fa.rb, line 36
def format_integer(integer)
  persian_numerals super
end
ltr?() click to toggle source

Change direction

# File lib/r18n-core/locales/fa.rb, line 31
def ltr?
  false
end
persian_numerals(str) click to toggle source

Replace western numerals to Persian

# File lib/r18n-core/locales/fa.rb, line 51
def persian_numerals(str)
  str
    .tr('0', '۰')
    .tr('1', '۱')
    .tr('2', '۲')
    .tr('3', '۳')
    .tr('4', '۴')
    .tr('5', '۵')
    .tr('6', '۶')
    .tr('7', '۷')
    .tr('8', '۸')
    .tr('9', '۹')
end
strftime(time, format) click to toggle source

Change numerals to Persian

Calls superclass method R18n::Locale#strftime
# File lib/r18n-core/locales/fa.rb, line 46
def strftime(time, format)
  persian_numerals super
end