Skip to content

Release v4.2.0

Choose a tag to compare

@github-actions github-actions released this 24 Sep 05:31
0b03d29

Why

Screenplay compiles a $strings.<key> reference symbolically and prints it unquoted, but nothing in Scene or Stage ever turned it into the text a .strings file actually holds - Stage frontend rendered the literal token. Resolution has to happen at runtime, not compile time, so a locale switch or an edited translation takes effect without recompiling the model.

What changed

resolveStringsInElement walks an element tree the same way elementKind.ts already distinguishes kinds elsewhere in this package - an ExternalComponent named slots, a ContentControl own content, an ItemsControl itemTemplate, a Panel children - resolving every $strings. reference in every properties bag along the way against a flat dictionary. A missing key stays as its literal token rather than going blank, matching the failure mode that already existed and staying visible to an author.

This is the generic half only - turning a dictionary and a tree into a resolved tree, no opinion about where the dictionary comes from. That is filesystem access only a host has; Stage picks it up from here in a follow-up PR.

Verification

yarn test/yarn lint in Source/JavaScript/engine: 236/236 passing (9 new), clean lint.