Skip to content

Add locale-aware list formatting (CLDR-style and/or/unit)#320

Merged
JE-Chen merged 1 commit into
devfrom
feat/list-format-batch
Jun 22, 2026
Merged

Add locale-aware list formatting (CLDR-style and/or/unit)#320
JE-Chen merged 1 commit into
devfrom
feat/list-format-batch

Conversation

@JE-Chen

@JE-Chen JE-Chen commented Jun 22, 2026

Copy link
Copy Markdown
Member

Summary

locale_parse formats numbers and dates, but joining a list of items the way a language expects — the conjunction word, the serial/Oxford comma, the two-item special case — is its own problem. Naive ", ".join gives "A, B, C" with no "and"/"or" and no localisation. This implements the CLDR list-pattern composition.

Layers

  • Headless core: je_auto_control/utils/list_format/list_format.pyformat_list(items, *, style, locale). Pure stdlib, no PySide6, pure function. Styles and/or/unit; locales en/es/fr/de/pt (English Oxford comma, others none; unknown → English).
  • Facade: format_list re-exported + __all__.
  • Executor: AC_format_list → {text}.
  • MCP: ac_format_list.
  • Script Builder: one CommandSpec under Data.

Tests / docs

  • test/unit_test/headless/test_list_format_batch.py — 10 headless tests (Oxford comma, two/one/empty, unit style, other locales, unknown-locale fallback, unknown-style ValueError, non-string coercion + wiring + facade).
  • EN/Zh feature docs v112_features_doc.rst + toctrees; 3 README What's-new sections.

@codacy-production

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 26 complexity · 0 duplication

Metric Results
Complexity 26
Duplication 0

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

@JE-Chen JE-Chen merged commit b09bccd into dev Jun 22, 2026
16 checks passed
@sonarqubecloud

Copy link
Copy Markdown

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.

1 participant