Skip to content

String resource management UI #159

Description

@einari

Context

Depends on Screenplay's string resource construct (pending reconciliation
with the existing Internationalization language feature — see that
Screenplay issue). Studio needs a way to manage owned strings per
module/feature and let users promote literals to resources.

Proposal

  • "Extract to resource" action on any literal label "text" (or other
    text-bearing property) — prompts for a resource name, creates the entry
    in the owning module/feature's strings, rewrites the reference in
    place. Mirrors IDE "extract to constant" UX.
  • Per-locale editing surface once the locale model is settled — a table
    view per strings block, one column per active locale.
  • Missing-translation indicators, consistent with how other gaps
    (unresolved names, incompatible themes) are surfaced elsewhere in
    Studio.

Open questions

  • Blocked on the Screenplay-side reconciliation with the existing
    Internationalization construct — don't build the per-locale table UI
    until that's settled, to avoid building against a shape that changes.

Dependencies

Depends on

Blocked: don't build the per-locale table UI until the Internationalization reconciliation in Cratis/Screenplay#93 settles, to avoid building against a shape that changes. The "extract to resource" action can proceed ahead of it.

Part of the screen work — build order and full dependency map: Cratis/Scene#7


Scope update — Cratis/Screenplay#93 is decided, this is unblocked

The language side resolved to extending the existing $strings. mechanism, not adding an inline strings block. That settles the shape this UI edits against, so the "blocked" note above no longer applies. Concretely:

  • "Extract to resource" takes a literal label "text", writes a <key.path> = "text" entry into the .play file's companion .strings file for the default locale, and rewrites the reference in place to the unquoted token $strings.<key.path>.
  • Per-locale editing is a table over the companion .strings files (MySystem.en.strings, MySystem.nb.strings, …) — one column per discovered locale, rows keyed by dotted key. StringsFiles already discovers every .strings file under a root and exposes base name + locale, so Studio does not need its own discovery.
  • Missing-translation indicators are keys present in one locale's file and absent from another — computable directly from the same discovery.
  • Keys are dotted paths (invoices.actions.newInvoice); ownership is expressed by key naming, not by a language construct. The "extract" flow should propose a key prefix from the declaring module/feature.

Format details and the round-trip guarantee are in Documentation/screenplay/internationalization.md in the Screenplay repo.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions