Skip to content

Контекст названий месяцев должен учитывать флаги и ширину поля#41

Closed
asavartsov wants to merge 74 commits intoyaroslav:masterfrom
asavartsov:master
Closed

Контекст названий месяцев должен учитывать флаги и ширину поля#41
asavartsov wants to merge 74 commits intoyaroslav:masterfrom
asavartsov:master

Conversation

@asavartsov
Copy link
Copy Markdown
Contributor

Кажется, это уже несколько раз фиксили, и каждый раз неправильно.

Исправлено путем написания более злостных регулярок для %d и %e в соответствии с документацией strftime (http://ruby-doc.org/core-1.9.3/Time.html#method-i-strftime).

Чтобы уменьшить количество регулярочного мусора я не стал добавлять правила к %B, %b, %a и %A , так как использование флагов или ширины для них все равно не работает (как у товарища из #38), так как хак над strftime из I18n не учитывает флаги и ширину, и не будет работать, пока кто-нибудь это не починит там.

@travisbot
Copy link
Copy Markdown

This pull request passes (merged 2a03c8e into e2dde13).

@travisbot
Copy link
Copy Markdown

This pull request passes (merged f1a1b9e into e2dde13).

@RunsFor
Copy link
Copy Markdown

RunsFor commented Nov 17, 2016

👍

@gafrom
Copy link
Copy Markdown

gafrom commented Nov 21, 2018

Подскажите, пожалуйста, как дела с этим запросом?

@yaroslav
Copy link
Copy Markdown
Owner

Применил в #81, 6408c18.

Спасибо @asavartsov

@yaroslav yaroslav closed this Mar 15, 2026
yaroslav added a commit that referenced this pull request Mar 16, 2026
A remaster of the library, 15 years later.

It turned out that the library is still in use, even on recent Ruby versions, despite some of its helpers having been broken for a long time. On top of that, I wanted to finally release version 1.0 and close the loop.

As a result, the russian gem has been largely rewritten while preserving the old API: the Russian module methods, and even optional support for the old strftime signature. The gem now targets modern versions of Ruby (3.2+, 4.0+) and Rails (7.2 and 8.0+).

- The library is now designed for Ruby 3.2, 3.3, 3.4 and 4.0.
- Support Rails integration for Rails 7.2, 8.0 and 8.1.
- Added RBS signatures for the public API.
- Full YARD documentation now available.
- Refreshed Russian locale data and added missing modern keys.
- Aligned the Russian currency decimal separator with CLDR and standard Russian numeric formatting by using a comma instead of a period.
- Fixed `Russian.transliterate` so it preserves newlines instead of dropping them during tokenization [#57].
- Fixed context-sensitive month-name selection in `strftime` formats with width and flag modifiers such as `%-e`, `%3d`, and `%_3d`. [#41] [#43] [Aleksei Savartsov](https://github.com/asavartsov)
- Added localized versions of `strptime`: `date_strptime`, `time_strptime`, and `datetime_strptime` helpers, including case-insensitive parsing of Russian month and weekday names.
- Speedup for transliteration [#42] (inspired by [Igor Bochkariov](https://github.com/ujifgc))
- Speedup for pluralization.
- Speedup for date format checks.
- Bundled locale files are now added to `I18n.load_path` in a deterministic sorted order, which avoids filesystem-dependent ordering issues and helps tools such as `i18n-js`. [#56] [Andrey Novikov](https://github.com/Envek)
- Cleaned up Russian comparison validation messages (`greater_than`, `greater_than_or_equal_to`, `less_than`, `less_than_or_equal_to`) for more natural wording. [#47] [Valentin Vasilyev](https://github.com/Valve)
- Migrated to GitHub Actions with Ruby and Rails matrix jobs testing.
- Converted the main docs to Markdown and updated development tooling (modern RSpec, gemfiles for supported Rails lines).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.