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.
{
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',
},
],
},
}the host gives the shell a book:
{
Tonight: 'Heute Abend',
Your name: 'Ihr Name',
Book a seat: 'Platz buchen',
}{ show: 'The Tempest' }Heute Abend The Tempest Ihr Name Platz buchen
Runs in this page on the installed package. The input and the expected output are defined by the example.