Module: Smriti::Admin::LocalizedDigitHelper
- Defined in:
- app/helpers/smriti/admin/localized_digit_helper.rb
Overview
Smriti::Admin::LocalizedDigitHelper
Helper methods for localizing digits in strings and dates. This is used in the admin UI to display numbers according to the current locale.
Responsibilities:
- Map ASCII digits (0-9) to localized representations based on I18n.t('numbers').
- Replace digits in strings or numeric inputs with their localized equivalents.
- Localize dates/times with localized digits.
Methods:
- localized_numbers: returns a hash mapping '0'-'9' to localized strings.
- localized_digits: replaces digits in a string or number with localized versions.
- l_with_digits: localizes an object (e.g. date/time) and replaces digits.