fix: format_P (%P) uses language-specific AM/PM values#115
Draft
Koan-Bot wants to merge 1 commit intocpan-authors:mainfrom
Draft
fix: format_P (%P) uses language-specific AM/PM values#115Koan-Bot wants to merge 1 commit intocpan-authors:mainfrom
Koan-Bot wants to merge 1 commit intocpan-authors:mainfrom
Conversation
format_P in Generic.pm used a lexical @ampm array directly, so it always returned English "am"/"pm" regardless of language module. Same inheritance bug pattern as format_o (PR cpan-authors#107). Fix: delegate to format_p via method dispatch, which correctly resolves to the language module's copied format_p function. Affected languages with non-English AMPM: Dutch (VM/NM), Finnish (ap/ip), Hungarian (DE./DU.), Czech (dop./odp.), Chinese, Arabic, Greek, and 10+ others. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
%P(lowercase am/pm) now returns the correct language-specific value instead of always returning English "am"/"pm".Why
format_PinGeneric.pmused the lexical@AMPMarray directly — same inheritance bug pattern asformat_o(#107). Language modules copyformat_pinto their own namespace (where it references the module's@AMPM), butformat_Pwas never copied, so it always fell through to Generic's English array.Affected languages: Dutch (VM/NM), Finnish (ap/ip), Hungarian (DE./DU.), Czech (dop./odp.), Chinese, Arabic, Greek, and 10+ others.
How
One-line fix: changed
format_Pfrom reimplementing the AM/PM logic with the lexical array to delegating via method dispatch ($_[0]->format_p), which correctly resolves to the language module's copiedformat_p.Testing
%Ptest to English baseline section%preturnsVM/NMand%Preturnsvm/nm🤖 Generated with Claude Code
Quality Report
Changes: 2 files changed, 12 insertions(+), 2 deletions(-)
Code scan: clean
Tests: skipped
Branch hygiene: clean
Generated by Kōan post-mission quality pipeline