Контекст названий месяцев должен учитывать флаги и ширину поля#41
Closed
asavartsov wants to merge 74 commits intoyaroslav:masterfrom
Closed
Контекст названий месяцев должен учитывать флаги и ширину поля#41asavartsov wants to merge 74 commits intoyaroslav:masterfrom
asavartsov wants to merge 74 commits intoyaroslav:masterfrom
Conversation
Fix hash syntax to be 1.8-compatible
Conflicts: lib/russian.rb
|
👍 |
|
Подскажите, пожалуйста, как дела с этим запросом? |
update i18n
Fix stack level too deep
Owner
|
Спасибо @asavartsov |
Closed
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).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Кажется, это уже несколько раз фиксили, и каждый раз неправильно.
Исправлено путем написания более злостных регулярок для %d и %e в соответствии с документацией strftime (http://ruby-doc.org/core-1.9.3/Time.html#method-i-strftime).
Чтобы уменьшить количество регулярочного мусора я не стал добавлять правила к %B, %b, %a и %A , так как использование флагов или ширины для них все равно не работает (как у товарища из #38), так как хак над strftime из I18n не учитывает флаги и ширину, и не будет работать, пока кто-нибудь это не починит там.