Skip to content

fix(i18n): publication-date field is free text, not "Italian format" (#201)#202

Merged
fabiodalez-dev merged 1 commit into
mainfrom
fix/publication-date-helper-i18n
Jul 1, 2026
Merged

fix(i18n): publication-date field is free text, not "Italian format" (#201)#202
fabiodalez-dev merged 1 commit into
mainfrom
fix/publication-date-helper-i18n

Conversation

@fabiodalez-dev

Copy link
Copy Markdown
Owner

Closes #201.

Problem

The book edit form showed Publication Date with placeholder e.g. August 26, 2025 but 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_pubblicazione is a free-text varchar(50):

  • BookRepository stores it verbatim (bind type s, no parsing).
  • format_date() only reformats values strtotime() can parse (English/numeric); anything else — e.g. the real-world value 24 settembre 1991 — is returned unchanged.
  • The Italian DateHelper parser 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.

locale new value
it_IT Data di pubblicazione originale (testo libero)
en_US Original publication date (free text)
fr_FR Date de publication originale (texte libre)
de_DE Ursprüngliches Erscheinungsdatum (Freitext)

Verify

  • php -l clean; the 4 locale JSONs valid.
  • Book edit form renders the new helper (browser, it_IT): "Data di pubblicazione originale (testo libero)"; placeholder unchanged.

…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)".
@coderabbitai

coderabbitai Bot commented Jun 27, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@fabiodalez-dev, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 59 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 2e1e9c9f-ba5d-42cb-ba36-fcc0f5019bf9

📥 Commits

Reviewing files that changed from the base of the PR and between eab030e and 8f7a506.

📒 Files selected for processing (5)
  • app/Views/libri/partials/book_form.php
  • locale/de_DE.json
  • locale/en_US.json
  • locale/fr_FR.json
  • locale/it_IT.json
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/publication-date-helper-i18n

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@fabiodalez-dev

fabiodalez-dev commented Jun 27, 2026

Copy link
Copy Markdown
Owner Author

Code review (--full)

Branch: fix/publication-date-helper-i18nmain · PR: #202

Full 6-lens review of the i18n change. Verdict: sound, nothing blocking. Structurally verified: the old key Data originale di pubblicazione (formato italiano) is referenced nowhere else (no orphaned __()), the new key is present in all four locale files with correct translations, and the __() argument in the view matches the JSON key char-for-char.

3 minor notes (below the validation gate, non-blocking)

  • JSON key ordering (cosmetic) · locale/*.json — the new key was placed at the old key's position, out of alphabetical order in all 4 files. No impact: the CI parity check sorts keys before comparing and nothing enforces physical order. (score 15)
  • Stale JS comment · book_form.php:~3919// Handle publication date - store Italian format directly still says "Italian format", now inconsistent with the new "(free text)" label. No runtime effect. (score 20)
  • UX wording · book_form.php:220 — "(free text)" says what the field is but not what to type; a phrasing like "any text format (see example)" or a hint pointing to the adjacent Year field (which drives filters/sorting) would help more. The placeholder already carries the example. (score 22)

Lenses: L1/L3/L6 no findings; L2 1 (ordering), L4 1 (comment), L5 1 (wording) — all below threshold. Happy to fix the stale JS comment and/or tweak the wording in a follow-up commit if you want.

@fabiodalez-dev

Copy link
Copy Markdown
Owner Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jun 30, 2026

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@fabiodalez-dev fabiodalez-dev merged commit 808c366 into main Jul 1, 2026
6 checks passed
fabiodalez-dev added a commit that referenced this pull request Jul 1, 2026
…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.
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.

Date translation issue

1 participant