mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-04 10:24:02 +00:00
i18n: translate the application views with t() as they render
Every data-i18n, data-i18n-title, data-i18n-aria-label and data-i18n-placeholder marker in the Vue templates becomes a t() call with the key the boot pass used to look up, contexts included. The three labels the shell rewrote at boot (Visual Presets, Location and the standby description) render through t() too, and that rewrite is gone. With the locale in vue-i18n, view text now follows a locale change, and markup under v-if or v-for no longer comes back in English when it re-renders. Rendered text and attributes are unchanged in every locale. The boot pass still translates static page markup such as the loading screen and a host's own markup, and npm run i18n rejects data-i18n* in a Vue template.
This commit is contained in:
1 parent
2c72a038d5
commit
ba20bc13d8
33 files changed
+377
-344
No files matched your search
@@ -153,10 +153,9 @@ a feature supplying only its accent.
|
||||
Next each view takes over its wiring: markup an owner builds with
|
||||
`createElement` becomes component markup that renders from a Pinia store
|
||||
the owner publishes to, and user actions come back to the owner through
|
||||
the store, so the owner keeps every decision. Static markup that the
|
||||
translation pass rewrites (`data-i18n*`) stays outside `v-if` and
|
||||
`v-for`, because re-rendering it would bring back the English; component
|
||||
text uses `t()` instead. Shared builders become components first and
|
||||
the store, so the owner keeps every decision. Component text uses
|
||||
`t()`, which follows the locale as the view renders; the views carry no
|
||||
`data-i18n*` markers, which `npm run i18n` rejects in a template. Shared builders become components first and
|
||||
keep their imperative entry points until their owners are components:
|
||||
the rail cards, card blocks and timeline (`src/ui/rail/`) render through
|
||||
Vue's synchronous `render()` behind `createRailCards()`,
|
||||
@@ -344,8 +343,10 @@ a feature supplying only its accent.
|
||||
now requires the pattern for new UI. The page-level markup tests read
|
||||
`renderApplicationHtml()`, the real views rendered on the server, and new
|
||||
tests mount components; three tests still read a `.vue` file's source
|
||||
(`cyberTheme`, `panelStorageDocs`, `geoFileImport`). The attribute translation pass goes with the move to
|
||||
vue-i18n. An explicit API for hosts to register panels and rail items is
|
||||
(`cyberTheme`, `panelStorageDocs`, `geoFileImport`). The views translate with `t()`
|
||||
while rendering, and vue-i18n holds the locale they read; the attribute
|
||||
translation pass is left for static page markup (the loading screen and a
|
||||
host's own markup). An explicit API for hosts to register panels and rail items is
|
||||
deferred until a host adds one: no host does today (the hosted
|
||||
application's account interface is its own markup), and the first such
|
||||
panel, the hosted timeline, will shape it.
|
||||
|
||||
Reference in new issue
Block a user