Nova · i18n

Switch

A screen that is already open changes language when its host hands the shell another book. Nova swaps the words as it draws: what a person wrote in the layout, and what stands at a prose key such as placeholder. What came from data stays as it is.

The action, as it is written
{
  id: 'i18n-switch',
  data: { show: 'The Tempest' },
  layout: {
    component: 'Stack',
    children: [
      { component: 'Text', children: 'Tonight' },
      { component: 'Text', children: '$.show' },
      {
        component: 'Input',
        ref: 'name',
        props: { placeholder: 'Your name' },
      },
      {
        component: 'Button',
        ref: 'book',
        children: 'Book a seat',
      },
    ],
  },
}
What is done to it
the host gives the shell a book:
{
  Tonight: 'Heute Abend',
  Your name: 'Ihr Name',
  Book a seat: 'Platz buchen',
}
What it then holds
{ show: 'The Tempest' }
What it then says
Heute Abend
The Tempest
Ihr Name
Platz buchen
Output matches the expected value

Runs in this page on the installed package. The input and the expected output are defined by the example.