Skip to content

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

Open
fabiodalez-dev wants to merge 1 commit into
mainfrom
fix/publication-date-helper-i18n
Open

fix(i18n): publication-date field is free text, not "Italian format" (#201)#202
fabiodalez-dev wants to merge 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, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 53 minutes and 19 seconds. Learn how PR review limits work.

Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file).

⌛ How to resolve this issue?

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 credits.

🚦 How do rate 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 see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: aef87a9b-1002-4c1e-a4a4-a05eb6afd2a4

📥 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.

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