New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

true_units

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

true_units

  • 0.0.1
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

= TrueUnits

The TrueUnits gem provides a simple way to display correct suffix for a noun depending on the number.

It's most important for russian, ukrainian, etc. languages.

=== Examples

1 день, 2 дня, 25 дней

1 дерево, 2 дерева, 25 деревьев.

== Installation

Add one string to the Gemfile

gem 'true_units'

and run bundle install

== Usage

It's very simple.

If you need a correct translation for hours then you should add few lines to your locale yml file under the true_units key

true_units: hours: v1: час v2: часа v3: часов

So now you can write foo.tu_hours where foo is a numerical variable.

=== More examples:

true_units:
  minutes:
    v1: минута
    v2: минуты
    v3: минут
  seconds:
    v1: секунда
    v2: секунды
    v3: секунд
  days:
    v1: день
    v2: дня
    v3: дней
  wins:
    v1: победа
    v2: победы
    v3: побед
  guards:
    v1: охранник
    v2: охранника
    v3: охранников
  tickets:
    v1: билет
    v2: билета
    v3: билетов

=== usage

puts 1.tu_guards puts 34.tu_tickets puts 7.tu_days

== Author

Alexander Dedusenko

== Copyright

This gem is released under the MIT License.

FAQs

Package last updated on 30 Apr 2014

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc