Skip to content

Add metadata-based smart parameter type mapping (1.3.0) - #17

Merged
Severnbli merged 1 commit into
mainfrom
feature/smart-parameter-metadata
Oct 28, 2026
Merged

Severnbli merged 1 commit into
mainfrom
feature/smart-parameter-metadata

Conversation

@Severnbli

Copy link
Copy Markdown
Owner

Summary

  • New Smart Parameter Types = Mapping mode. Parameter types come from a new SmartParameterTypes metadata (Localization Codegen / Smart Parameter Types) on the shared table entry, so the table text is untouched. Parameters without a row are inferred like Inferred, and positional parameters (0 / {0}) can be typed too.
  • Warnings when a mapped type can't be formatted by plural/p (String, Bool, Char, DateTime, Object) or by list/l (anything but List), and for rows that name a missing parameter, have no name, or repeat a name.
  • Changing Smart Strings or Smart Parameter Types in the settings asks whether to regenerate.
  • README (new Parameter types section), CHANGELOG, and version bump to 1.3.0.

Why metadata

An inline [int]{count} prefix sits outside the placeholder, so Unity's SmartFormat would show it to players as literal text. Stripping it at runtime would mean modifying the loaded tables. Metadata keeps the text clean and gives the type a dropdown.

Testing

  • EditMode tests in Unity 6000.6.6f1 batch mode: 147 passed, 0 failed, 1 skipped (UniTask compile, since UniTask isn't installed).
  • New SmartParameterMappingTests. The generated-code compile test now includes mapped int / string / decimal / DateTime parameters.
  • Not checked by hand yet: adding the metadata through the Table Editor UI.

🤖 Generated with Claude Code

Smart Parameter Types = Mapping reads parameter types from the new
Smart Parameter Types metadata on a shared table entry and infers the
rest. Mapped types that plural or list cannot format are reported as
warnings, as are unknown, empty and duplicate names. Changing the smart
string settings asks whether to regenerate. Bump version to 1.3.0.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Severnbli Severnbli added the feature New feature or request label Oct 28, 2026
@Severnbli Severnbli self-assigned this Oct 28, 2026
@Severnbli
Severnbli merged commit 24fe54b into main Oct 28, 2026
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant