Skip to content

fix: add missing diacritical marks in Italian day names#104

Merged
atoomic merged 1 commit intocpan-authors:mainfrom
Koan-Bot:koan.atoomic/fix-italian-accents
Apr 26, 2026
Merged

fix: add missing diacritical marks in Italian day names#104
atoomic merged 1 commit intocpan-authors:mainfrom
Koan-Bot:koan.atoomic/fix-italian-accents

Conversation

@Koan-Bot
Copy link
Copy Markdown

@Koan-Bot Koan-Bot commented Mar 28, 2026

What

Correct Italian weekday names to include the grave accent (ì).

Why

Five of seven Italian day names require a grave accent: Lunedì, Martedì, Mercoledì, Giovedì, Venerdì. The module had plain ASCII approximations ("Lunedi", "Martedi", etc.) since its original contribution — a localization bug present since the module was first added.

How

Added use utf8 pragma and corrected the @DoW array. Short names (@DoWs) are unaffected since they use only the first 3 characters (before the accent). Updated test expectations in format.t and lang-data.t.

Testing

  • Full suite: 1219 tests pass
  • Round-trip (ctime → str2time) verified for Italian

🤖 Generated with Claude Code


Quality Report

Changes: 3 files changed, 4 insertions(+), 3 deletions(-)

Code scan: clean

Tests: skipped

Branch hygiene: clean

Generated by Kōan post-mission quality pipeline

Italian weekday names require a grave accent (ì) on five of seven
days: Lunedì, Martedì, Mercoledì, Giovedì, Venerdì. The module
had plain ASCII approximations without accents since its original
contribution.

Add `use utf8` pragma and correct the @Dow array. Update test
expectations in format.t and lang-data.t accordingly.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@atoomic atoomic marked this pull request as ready for review April 26, 2026 12:51
Luglio Agosto Settembre Ottobre Novembre Dicembre);
@MoYs = qw(Gen Feb Mar Apr Mag Giu Lug Ago Set Ott Nov Dic);
@DoW = qw(Domenica Lunedi Martedi Mercoledi Giovedi Venerdi Sabato);
@DoW = qw(Domenica Lunedì Martedì Mercoledì Giovedì Venerdì Sabato);
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks correct after double check

my %en_to_it_days = (
  Monday    => 'lunedì',
  Tuesday   => 'martedì',
  Wednesday => 'mercoledì',
  Thursday  => 'giovedì',
  Friday    => 'venerdì',
  Saturday  => 'sabato',
  Sunday    => 'domenica',
);

@atoomic atoomic merged commit 77ed658 into cpan-authors:main Apr 26, 2026
22 checks passed
@greptile-apps
Copy link
Copy Markdown

greptile-apps Bot commented Apr 26, 2026

Greptile Summary

This PR corrects a long-standing localization bug in Date::Language::Italian by adding use utf8 to the module and supplying the correct grave-accented forms of the five Italian weekday names (Lunedì, Martedì, Mercoledì, Giovedì, Venerdì). Test expectations in format.t and lang-data.t are updated accordingly, following the same encoding conventions already used by other language modules such as Portuguese.

Confidence Score: 5/5

This PR is safe to merge — it is a minimal, well-scoped correctness fix with no logic changes.

All three files are changed in a targeted way that mirrors the existing pattern used by Portuguese and other language modules. The lang-data.t update uses the encoding-safe \x{ec} escape; format.t uses literal UTF-8 in __DATA__, exactly as Portuguese already does. No P0 or P1 issues were found.

No files require special attention.

Important Files Changed

Filename Overview
lib/Date/Language/Italian.pm Added use utf8 pragma and corrected @DoW with proper grave-accented Italian day names; consistent with how other modules (e.g. Portuguese.pm) handle non-ASCII strings.
t/format.t Updated %A expectation for Italian from Martedi to Martedì; follows the same literal-UTF-8-in-__DATA__ pattern already used for Portuguese and other languages with accented characters.
t/lang-data.t Updated Italian A expectation to "Marted\x{ec}" using a Unicode escape, which is the safest encoding-agnostic style for a test file that does not declare use utf8.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A["Italian.pm\n(use utf8 added)"] -->|"@DoW contains\nUnicode character strings\ne.g. 'Martedì' U+00EC"| B["format_A()\nreturns $DoW[wday]"]
    B --> C["time2str('%A', ...)"]
    C -->|"compare"| D["format.t __DATA__\n'Martedì' literal\n(UTF-8 bytes)"]
    C -->|"compare"| E["lang-data.t\n'Marted\\x{ec}'\n(Unicode escape)"]
    D -->|"is() passes"| F["✓ Test suite green"]
    E -->|"is() passes"| F
Loading

Reviews (1): Last reviewed commit: "fix: add missing diacritical marks in It..." | Re-trigger Greptile

@Koan-Bot Koan-Bot deleted the koan.atoomic/fix-italian-accents branch April 27, 2026 09:14
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.

2 participants