Define date.formats.short_with_year for every locale
Problem
date.formats.short_with_year existed in 7 of the 118 config/locales/defaults/*.yml files (en, ca, fr, pl, ru, tr, uk). With config.i18n.fallbacks on, the other 111 borrowed English "%b %d, %Y": month first, abbreviated in the locale's own language. A German user saw 5 January 2027 as "Jan 05, 2027".
The format is used for other-year dates in Bills (due labels, All bills table, the bill page, payment history, Needs review), the period picker (Period) and the recurring transaction pickers.
Found in the #3901 review, where it was declined as out of scope.
Change
Each locale that lacked the key gets one short_with_year line at the end of its date.formats block:
- 10 copied verbatim from open translation PRs, with the same quotes and the same position after
short_month_year, so those merges land the same line: #3681 (de, zh-TW), #3683 (es, it, pt-PT), #3688 (nl, pt-BR) and #3690 (hu, vi, zh-CN). - 97 derived from the locale's own
date.formats.long:%Bbecomes%b, and the weekday plus its separator is dropped (es-419, es-AR, es-CL, es-CO, es-CR, es-EC, es-MX, es-NI, es-PA, es-PE, es-US, es-VE, gl, id, km). - 4 picked by hand, since their
longhas no%B: ja"%Y年%m月%d日"(longwithout the weekday), ko and sl (longas is), and ug"%Y-%m-%d"(its ownlong; it has no month name to abbreviate).
German now renders " 5. Jan 2027".
For translators
The rule gives two awkward results, where a case suffix in long ends up glued onto the abbreviated month:
- fi:
%d. %bta %Yrenders "05. tammita 2027". - eu:
%Y(e)ko %bk %erenders "2027(e)ko Urtk 5".
Both still beat the English fallback, but a native speaker should pick a better value.
Tests
test/i18n_test.rbfails if anydefaults/*.ymllocale lacks the format. The locale list comes from the files, and each is checked withI18n.t(..., fallback: false, default: nil), becauseI18n.exists?and a plainI18n.tconsult fallbacks and would pass anyway.- A second test asserts
I18n.l(Date.new(2027, 1, 5), format: :short_with_year, locale: :de) == " 5. Jan 2027". i18n_test.rbnow requirestest_helper. Run on its own, the file loaded only the gems' built-in locales (en and ru), so anyI18n.twith another locale raisedI18n::InvalidLocale.- The new tests failed before the locale change and pass after it.
- Full
bin/rails test: 10431 runs, 0 failures, 1 error. The error isReportsControllerTestthird-currency, which fails on the 1st of the month on main too and is fixed by #3902. - RuboCop and Brakeman are clean.
Screenshots
A German user on All bills, with the clock set to 10 December 2026. The December bill uses :short either way; the three 2027 dates use :short_with_year.
| Before | After |
|---|---|
![]() | ![]() |
Values per locale
Each row shows the format and how it renders 5 January 2027. "long" means derived from that locale's date.formats.long.
All 111 locales
| Locale | Format | 5 Jan 2027 | Source |
|---|---|---|---|
| af | %d %b %Y | 05 Jan 2027 | long |
| ar | %e %b، %Y | 5 يناير، 2027 | long |
| az | %d %b %Y | 05 Yan 2027 | long |
| be | %-d %b %Y | 5 Сту 2027 | long |
| bg | %d %b %Y | 05 ян. 2027 | long |
| bn | %e %b %Y | 5 জানুয়ারি 2027 | long |
| bs | %e. %b %Y. | 5. jan 2027. | long |
| cs | %d. %b %Y | 05. Led 2027 | long |
| cy | %d %b %Y | 05 Ion 2027 | long |
| da | %e. %b %Y | 5. jan 2027 | long |
| de | %e. %b %Y | 5. Jan 2027 | open PR |
| de-AT | %e. %b %Y | 5. Jän 2027 | long |
| de-CH | %e. %b %Y | 5. Jan 2027 | long |
| de-DE | %e. %b %Y | 5. Jan 2027 | long |
| dz | %d %b %Y | 05 ཟླཝ་དང་པ 2027 | long |
| el | %e %b %Y | 5 Ιαν 2027 | long |
| el-CY | %e %b %Y | 5 Ιαν 2027 | long |
| en-AU | %d %b, %Y | 05 Jan, 2027 | long |
| en-CA | %b %d, %Y | Jan 05, 2027 | long |
| en-CY | %d %b, %Y | 05 Jan, 2027 | long |
| en-GB | %d %b, %Y | 05 Jan, 2027 | long |
| en-IE | %d %b, %Y | 05 Jan, 2027 | long |
| en-IN | %d %b %Y | 05 Jan 2027 | long |
| en-NZ | %d %b, %Y | 05 Jan, 2027 | long |
| en-TT | %d %b %Y | 05 Jan 2027 | long |
| en-US | %b %d, %Y | Jan 05, 2027 | long |
| en-ZA | %d %b %Y | 05 Jan 2027 | long |
| eo | %e %b %Y | 5 jan. 2027 | long |
| es | %-d de %b de %Y | 5 de ene de 2027 | open PR |
| es-419 | %d de %b de %Y | 05 de ene de 2027 | long |
| es-AR | %d de %b de %Y | 05 de ene de 2027 | long |
| es-CL | %d de %b de %Y | 05 de ene de 2027 | long |
| es-CO | %d de %b de %Y | 05 de ene de 2027 | long |
| es-CR | %d de %b de %Y | 05 de ene de 2027 | long |
| es-EC | %-d de %b de %Y | 5 de ene de 2027 | long |
| es-ES | %d de %b de %Y | 05 de ene de 2027 | long |
| es-MX | %d de %b de %Y | 05 de ene de 2027 | long |
| es-NI | %d de %b de %Y | 05 de ene de 2027 | long |
| es-PA | %-d de %b de %Y | 5 de ene de 2027 | long |
| es-PE | %d de %b del %Y | 05 de ene del 2027 | long |
| es-US | %d de %b de %Y | 05 de ene de 2027 | long |
| es-VE | %d de %b de %Y | 05 de ene de 2027 | long |
| et | %d. %b %Y | 05. jaan. 2027 | long |
| eu | %Y(e)ko %bk %e | 2027(e)ko Urtk 5 | long |
| fa | %e %b %Y | 5 ژانویه 2027 | long |
| fi | %d. %bta %Y | 05. tammita 2027 | long |
| fr-CA | %d %b %Y | 05 jan. 2027 | long |
| fr-CH | %-d %b %Y | 5 jan. 2027 | long |
| fr-FR | %-d %b %Y | 5 jan. 2027 | long |
| fy | %e %b %Y | 5 jan 2027 | long |
| gd | %d %b %Y | 05 Faoi 2027 | long |
| gl | %e de %b de %Y | 5 de Xan de 2027 | long |
| he | %e ב%b, %Y | 5 בינו, 2027 | long |
| hi | %d %b %Y | 05 जन 2027 | long |
| hi-IN | %d %b %Y | 05 Jan 2027 | long |
| hr | %e. %b %Y. | 5. sij. 2027. | long |
| hu | %Y. %b %d. | 2027. jan. 05. | open PR |
| id | %d %b %Y | 05 Jan 2027 | long |
| is | %e. %b %Y | 5. jan 2027 | long |
| it | %d %b %Y | 05 gen 2027 | open PR |
| it-CH | %d %b %Y | 05 Gen 2027 | long |
| ja | %Y年%m月%d日 | 2027年01月05日 | by hand |
| ka | %d %b %Y | 05 იანვ 2027 | long |
| kk | %-d %b %Y | 5 қаң. 2027 | long |
| km | ទី%e ខែ%b ឆ្នាំ%Y | ទី 5 ខែមករា ឆ្នាំ2027 | long |
| kn | %d %b %Y | 05 Jan 2027 | long |
| ko | %Y년 %m월 %d일 | 2027년 01월 05일 | by hand |
| lb | %e. %b %Y | 5. Jan 2027 | long |
| lo | %e %b %Y | 5 ມ.ກ 2027 | long |
| lt | %Y m. %b %d d. | 2027 m. Sau 05 d. | long |
| lv | %Y. gada %e. %b | 2027. gada 5. Janv | long |
| mg | %e %b %Y | 5 jan. 2027 | long |
| mk | %b %e, %Y | Јан 5, 2027 | long |
| ml | %d %b, %Y | 05 ജനു., 2027 | long |
| mn | %Y %b %d | 2027 1 сар 05 | long |
| mr-IN | %d %b %Y | 05 जाने 2027 | long |
| ms | %d %b, %Y | 05 Jan, 2027 | long |
| nb | %e. %b %Y | 5. jan 2027 | long |
| ne | %d %b %Y | 05 जन. 2027 | long |
| nl | %e %b %Y | 5 Jan 2027 | open PR |
| nn | %e. %b %Y | 5. jan 2027 | long |
| oc | Lo %e %b de %Y | Lo 5 gen de 2027 | long |
| or | %b %d, %Y | ଜାନୁ 05, 2027 | long |
| pa | %d %b %Y | 05 ਜਨ 2027 | long |
| pt | %d de %b de %Y | 05 de jan de 2027 | long |
| pt-BR | %d %b %Y | 05 jan 2027 | open PR |
| pt-PT | %d %b %Y | 05 jan 2027 | open PR |
| rm | %e. %b %Y | 5. schan 2027 | long |
| ro | %d %b %Y | 05 ian 2027 | long |
| sc | %d %b %Y | 05 ghe 2027 | long |
| sk | %d. %b %Y | 05. Jan 2027 | long |
| sl | %d. %b %Y | 05. jan 2027 | by hand |
| sq | %d %b, %Y | 05 Jan, 2027 | long |
| sr | %b %e, %Y | Јан 5, 2027 | long |
| st | %d %b %Y | 05 Phe 2027 | long |
| sv | %e %b %Y | 5 jan 2027 | long |
| sv-FI | %e %b %Y | 5 jan 2027 | long |
| sv-SE | %e %b %Y | 5 jan 2027 | long |
| sw | %e %b, %Y | 5 Jan, 2027 | long |
| ta | %d %b %Y | 05 ஜன 2027 | long |
| te | %d %b %Y | 05 Jan 2027 | long |
| th | %d %b %Y | 05 ม.ค. 2027 | long |
| tl | ika-%d ng %b, %Y | ika-05 ng Ene, 2027 | long |
| tt | %-d %b %Y | 5 гыйн. 2027 | long |
| ug | %Y-%m-%d | 2027-01-05 | by hand |
| ur | %d %b، %Y | 05 جنوری، 2027 | long |
| uz | %d %b %Y | 05 yan. 2027 | long |
| vi | %d %b, %Y | 05 Thg 1, 2027 | open PR |
| wo | %d %b, %Y | 05 Jan, 2027 | long |
| zh-CN | %Y年%m月%d日 | 2027年01月05日 | open PR |
| zh-TW | %Y年%m月%d日 | 2027年01月05日 | open PR |
Summary by CodeRabbit
-
New Features
- Added localized short date formats that include the year across supported languages and regions, following each locale’s conventions.
- Updated the Turkish date format to avoid padding single-digit days.
-
Tests
- Added coverage for availability in every locale, locale-specific formatting, and spacing for single-digit days.

