fix(i18n): publication-date field is free text, not "Italian format" (#201)#202
Conversation
…an format" (#201) The book edit form labelled the `data_pubblicazione` helper "Original publication date (Italian format)" while the placeholder showed a locale example ("e.g. August 26, 2025"). For a non-Italian user the note is contradictory and the translations had even drifted (fr_FR said "format français", de_DE/en kept "Italian format"), so #201 reasonably asked "what is the right date format?". There is none: `data_pubblicazione` is a free-text `varchar(50)`, stored verbatim by BookRepository (no parsing), and `format_date()` only reformats values `strtotime()` can parse (English/numeric) while leaving anything else — e.g. the real-world "24 settembre 1991" — untouched. The Italian `DateHelper` parser is not applied to this field. So drop the misleading format claim: the helper now reads "Original publication date (free text)" (and its IT/FR/DE equivalents), which matches the free-text nature and the locale-aware placeholder example. Source string + all four locale JSONs updated together. Verified: php -l clean; the 4 locale JSONs are valid; book edit form renders the new helper (browser, it_IT): "Data di pubblicazione originale (testo libero)".
|
Warning Review limit reached
Next review available in: 59 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (5)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Code review (
|
|
@coderabbitai review |
✅ Action performedReview finished.
|
…203) Book field-types + copy-repair (#203), waitlist promotion (#199, #157), scraped-translator precedence (#200), publication-date free text (#202, #201), mobile loan datepicker (#198), self-hosted Swagger UI (#197). Ships migrate_0.7.25-rc.1.sql (tipo_acquisizione -> VARCHAR(50); stato +non_disponibile; idempotent, data preserved). Mobile API contract unchanged — no Android update.
Closes #201.
Problem
The book edit form showed Publication Date with placeholder
e.g. August 26, 2025but a helper saying "Original publication date (Italian format)" — contradictory for a non-Italian user. The translations had also drifted (fr_FR→ "format français",de_DE/en_US→ "Italian format"), so the reporter reasonably asked "what is the right date format?".Answer / root cause
There is no required format.
data_pubblicazioneis a free-textvarchar(50):BookRepositorystores it verbatim (bind types, no parsing).format_date()only reformats valuesstrtotime()can parse (English/numeric); anything else — e.g. the real-world value24 settembre 1991— is returned unchanged.DateHelperparser is not applied to this field.So the "(Italian format)" note never reflected a real constraint.
Fix
Helper text is now "Original publication date (free text)" (+ IT/FR/DE equivalents), matching the free-text nature and the locale-aware placeholder example. Source string + all four locale JSONs updated in the same commit.
Verify
php -lclean; the 4 locale JSONs valid.