Skip to content

feat!: one Get per key kind, the MessageArguments type and a replaceable enum key convention - #33

Merged
rent-a-developer merged 1 commit into
release/issue-29-v2.0.0from
feature/issue-32-positional-arguments
Oct 14, 2026
Merged

rent-a-developer merged 1 commit into
release/issue-29-v2.0.0from
feature/issue-32-positional-arguments

Conversation

@rent-a-developer

@rent-a-developer rent-a-developer commented Oct 14, 2026 •

Copy link
Copy Markdown
Owner

Part of #29
Refs #32

ILocalizer has three Get overloads - string, ResourceKey and Enum keys - each with an optional MessageArguments, built with FromValues, FromTuples, FromDictionary or FromObject. A MessageArguments is immutable and always valid: its argument positions are 0 to Count - 1 and MessageArgument.Position is their only source. IMessageFormatter.Format and LookupFailure.Arguments take MessageArguments too. ILocalizer.EnumKeyBuilder replaces the fixed enum key convention for code and XAML.

BREAKING CHANGE: Write Get("Key", MessageArguments.FromValues(a, b)) instead of Get("Key", a, b), Get("Key", resourceManager: rm) for a scoped lookup and keyPrefix: for an enum prefix. A null manager means search-all and a null key prefix the EnumKeyBuilder's default. KeyPrefix on LocalizeEnumExtension and LocalizeEnumConverter is string? and defaults to null. Every 1.1.0 Get signature is removed; recompile dependent assemblies. See docs/guides/migration-2.0.md.

Checklist

Everything under Always applies to every pull request. The rest applies only when its trigger does —
tick it, or leave it and say why in the description. A box that does not apply is not a box to tick.

Always

  • pwsh -File scripts/pre-commit-gate.ps1 passes. It runs the public-API reminder, checks line endings,
    style, formatting and member ordering, builds Release and runs the test suites. Use -Fix to have it
    apply the tidying rather than only report it.
  • The Release build produces zero warnings. TreatWarningsAsErrors is on, so this also covers style,
    member ordering, trim and public-API diagnostics.
  • Branch name follows <type>/issue-<number>-<slug>, or <type>/<slug> when there is no issue — see
    CONTRIBUTING.md.

If the change adds behaviour or fixes a bug

  • It is covered by tests.
  • CHANGELOG.md has an entry under ## [Unreleased]. Do not bump a version — the version, the
    release date and the tag are the maintainer's, at release time.

If the change touches one UI package

  • It is mirrored into the other, or it genuinely does not apply there — see
    CONTRIBUTING.md. The Avalonia and WPF markup
    extensions and converters are deliberate mirrors of each other.

If the change touches resource lookup, the generated keys, or the packaging that carries them

Culture fallback, satellite discovery, the source generator's output, the buildTransitive wiring, or a
dependency version. Nothing is trimmed on the just-in-time compiler, so no other check in this repository
can see the damage a mistake here does to a trimmed application.

  • pwsh -File scripts/verify-package-aot.ps1 -Pack passes for both frameworks
    (-Framework net8.0 and the net10.0 default).
  • No new IL2xxx / IL3xxx diagnostics, and none suppressed.

If the change touches the public API

  • The affected PublicAPI.Unshipped.txt is updated with pwsh -File scripts/update-public-api.ps1, and
    the diff was reviewed line by line. A *REMOVED* entry is a breaking change.
  • The XML documentation and the affected pages under docs/ are updated.

…ble enum key convention

ILocalizer has three Get overloads - string, ResourceKey and Enum keys -
each with an optional MessageArguments, built with FromValues, FromTuples,
FromDictionary or FromObject. A MessageArguments is immutable and always
valid: its argument positions are 0 to Count - 1 and MessageArgument.Position
is their only source. IMessageFormatter.Format and LookupFailure.Arguments
take MessageArguments too. ILocalizer.EnumKeyBuilder replaces the fixed
enum key convention for code and XAML.

Refs #32

BREAKING CHANGE: Write Get("Key", MessageArguments.FromValues(a, b))
instead of Get("Key", a, b), Get("Key", resourceManager: rm) for a scoped
lookup and keyPrefix: for an enum prefix. A null manager means search-all
and a null key prefix the EnumKeyBuilder's default. KeyPrefix on
LocalizeEnumExtension and LocalizeEnumConverter is string? and defaults to
null. Every 1.1.0 Get signature is removed; recompile dependent assemblies.
See docs/guides/migration-2.0.md.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@rent-a-developer rent-a-developer added this to the v2.0.0 milestone Oct 14, 2026
@rent-a-developer rent-a-developer self-assigned this Oct 14, 2026
@codecov

codecov Bot commented Oct 14, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 98.05825% with 2 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/ResXLocalization.Core/Localizer.cs 92.85% 0 Missing and 1 partial ⚠️
src/ResXLocalization.Core/MessageArguments.cs 98.18% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

@rent-a-developer
rent-a-developer merged commit 297da76 into release/issue-29-v2.0.0 Oct 14, 2026
17 checks passed
@rent-a-developer
rent-a-developer deleted the feature/issue-32-positional-arguments branch October 14, 2026 07:23
@rent-a-developer rent-a-developer mentioned this pull request Oct 20, 2026
8 tasks done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaking change enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant