@quazardous/qdadm 2.33.0 → 2.34.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +3 -2
- package/src/components/dialogs/MultiStepDialog.vue +15 -12
- package/src/components/display/EntityTimeline.vue +9 -7
- package/src/components/display/LogStream.vue +11 -0
- package/src/components/layout/PageNav.vue +4 -2
- package/src/components/pages/NotFoundPage.vue +5 -3
- package/src/components/tasks/TaskDialog.vue +1 -1
- package/src/components/tasks/TaskHost.vue +2 -1
- package/src/composables/useBreadcrumb.ts +21 -14
- package/src/composables/useEntityItemFormPage.ts +9 -6
- package/src/composables/useEntityItemShowPage.ts +8 -6
- package/src/composables/useListPage.ts +9 -6
- package/src/composables/useNavContext.ts +4 -6
- package/src/i18n/__tests__/I18n.test.ts +14 -0
- package/src/i18n/defaults/__tests__/generated-sync.test.ts +2 -2
- package/src/i18n/defaults/core.en.generated.ts +22 -10
- package/src/i18n/defaults/core.en.yml +22 -10
- package/src/i18n/defaults/core.fr.generated.ts +22 -10
- package/src/i18n/defaults/core.fr.yml +22 -10
- package/src/i18n/useI18n.ts +12 -0
- package/src/kernel/Module.ts +3 -2
- package/src/modules/debug/DebugModule.ts +3 -1
- package/src/modules/debug/styles.generated.css +2895 -0
- package/src/notifications/NotificationModule.ts +1 -1
- package/src/notifications/{styles.scss → styles.css} +5 -5
- package/src/tasks/taskStore.ts +22 -1
|
@@ -15,6 +15,7 @@ export default `core:
|
|
|
15
15
|
submit: Submit
|
|
16
16
|
reset: Reset
|
|
17
17
|
back: Back
|
|
18
|
+
view: View
|
|
18
19
|
next: Next
|
|
19
20
|
previous: Previous
|
|
20
21
|
close: Close
|
|
@@ -48,6 +49,9 @@ export default `core:
|
|
|
48
49
|
created: Created
|
|
49
50
|
updated: Updated
|
|
50
51
|
confirmDelete: Are you sure you want to delete this item?
|
|
52
|
+
confirmDeleteTitle: Confirm Delete
|
|
53
|
+
confirmDeleteItem: 'Delete {entity} "{label}"?'
|
|
54
|
+
confirmDeleteThis: Are you sure you want to delete this {entity}?
|
|
51
55
|
errors:
|
|
52
56
|
required: Required
|
|
53
57
|
tooShort: Too short (min {min})
|
|
@@ -77,24 +81,24 @@ export default `core:
|
|
|
77
81
|
done: Complete
|
|
78
82
|
stopped: Stopped
|
|
79
83
|
failed: "Failed: {error}"
|
|
80
|
-
lines: "{count} lines"
|
|
84
|
+
lines: "{count} line | {count} lines"
|
|
81
85
|
search: Search the log
|
|
82
86
|
previous: Previous match
|
|
83
87
|
next: Next match
|
|
84
88
|
onlyMatches: Only matching lines
|
|
85
|
-
errors: "{count} errors"
|
|
89
|
+
errors: "{count} error | {count} errors"
|
|
86
90
|
firstError: Go to the next error line
|
|
87
91
|
wrap: Wrap long lines
|
|
88
92
|
follow: Follow the end of the log
|
|
89
93
|
download: Download the log
|
|
90
|
-
newLines: "{count} new lines, resume"
|
|
94
|
+
newLines: "{count} new line, resume | {count} new lines, resume"
|
|
91
95
|
empty: No output yet
|
|
92
96
|
# EntityTimeline (#4111)
|
|
93
97
|
timeline:
|
|
94
98
|
actors: Filter by actor
|
|
95
99
|
loading: Loading…
|
|
96
100
|
empty: Nothing happened yet
|
|
97
|
-
newEvents: "{count} new events"
|
|
101
|
+
newEvents: "{count} new event | {count} new events"
|
|
98
102
|
oldestFirst: Oldest first
|
|
99
103
|
newestFirst: Newest first
|
|
100
104
|
# PayloadViewer / PayloadDiff (#4112)
|
|
@@ -105,14 +109,14 @@ export default `core:
|
|
|
105
109
|
copied: Copied to the clipboard
|
|
106
110
|
copyFailed: Could not copy
|
|
107
111
|
download: Download
|
|
108
|
-
showAll: "Show all {count} rows"
|
|
112
|
+
showAll: "Show {count} row | Show all {count} rows"
|
|
109
113
|
binary: "Binary content, {size}. First bytes:"
|
|
110
114
|
malformed: "Not valid {format} ({error}), shown as text"
|
|
111
115
|
expected: Expected
|
|
112
116
|
captured: Captured
|
|
113
117
|
identical: Identical
|
|
114
|
-
unchanged: "{count} unchanged lines"
|
|
115
|
-
showSame: "Show {count} unchanged rows"
|
|
118
|
+
unchanged: "{count} unchanged line | {count} unchanged lines"
|
|
119
|
+
showSame: "Show {count} unchanged row | Show {count} unchanged rows"
|
|
116
120
|
inline: Inline
|
|
117
121
|
split: Side by side
|
|
118
122
|
# EmailPreview (#4113)
|
|
@@ -129,7 +133,7 @@ export default `core:
|
|
|
129
133
|
html: HTML
|
|
130
134
|
text: Text
|
|
131
135
|
source: Source
|
|
132
|
-
imagesBlocked: "{count} remote images blocked"
|
|
136
|
+
imagesBlocked: "{count} remote image blocked | {count} remote images blocked"
|
|
133
137
|
loadImages: Load images
|
|
134
138
|
blockImages: Block images
|
|
135
139
|
empty: This email has no body
|
|
@@ -153,11 +157,19 @@ export default `core:
|
|
|
153
157
|
start: Start
|
|
154
158
|
dontStart: Do not start
|
|
155
159
|
typeToConfirm: "Type {value} to confirm"
|
|
156
|
-
tray: "{count} running tasks"
|
|
160
|
+
tray: "{count} running task | {count} running tasks"
|
|
157
161
|
trayDone: Recent tasks
|
|
158
162
|
clear: Clear finished
|
|
159
|
-
#
|
|
163
|
+
# NotFoundPage
|
|
164
|
+
notFound:
|
|
165
|
+
title: Page not found
|
|
166
|
+
message: The page you're looking for doesn't exist or has been moved.
|
|
167
|
+
home: Back to Home
|
|
168
|
+
# The breadcrumb (useBreadcrumb, useNavContext, PageNav).
|
|
160
169
|
breadcrumb:
|
|
170
|
+
home: Home
|
|
171
|
+
dashboard: Dashboard
|
|
172
|
+
details: Details
|
|
161
173
|
view: View
|
|
162
174
|
edit: Edit
|
|
163
175
|
`
|
|
@@ -13,6 +13,7 @@ core:
|
|
|
13
13
|
submit: Submit
|
|
14
14
|
reset: Reset
|
|
15
15
|
back: Back
|
|
16
|
+
view: View
|
|
16
17
|
next: Next
|
|
17
18
|
previous: Previous
|
|
18
19
|
close: Close
|
|
@@ -46,6 +47,9 @@ core:
|
|
|
46
47
|
created: Created
|
|
47
48
|
updated: Updated
|
|
48
49
|
confirmDelete: Are you sure you want to delete this item?
|
|
50
|
+
confirmDeleteTitle: Confirm Delete
|
|
51
|
+
confirmDeleteItem: 'Delete {entity} "{label}"?'
|
|
52
|
+
confirmDeleteThis: Are you sure you want to delete this {entity}?
|
|
49
53
|
errors:
|
|
50
54
|
required: Required
|
|
51
55
|
tooShort: Too short (min {min})
|
|
@@ -75,24 +79,24 @@ core:
|
|
|
75
79
|
done: Complete
|
|
76
80
|
stopped: Stopped
|
|
77
81
|
failed: "Failed: {error}"
|
|
78
|
-
lines: "{count} lines"
|
|
82
|
+
lines: "{count} line | {count} lines"
|
|
79
83
|
search: Search the log
|
|
80
84
|
previous: Previous match
|
|
81
85
|
next: Next match
|
|
82
86
|
onlyMatches: Only matching lines
|
|
83
|
-
errors: "{count} errors"
|
|
87
|
+
errors: "{count} error | {count} errors"
|
|
84
88
|
firstError: Go to the next error line
|
|
85
89
|
wrap: Wrap long lines
|
|
86
90
|
follow: Follow the end of the log
|
|
87
91
|
download: Download the log
|
|
88
|
-
newLines: "{count} new lines, resume"
|
|
92
|
+
newLines: "{count} new line, resume | {count} new lines, resume"
|
|
89
93
|
empty: No output yet
|
|
90
94
|
# EntityTimeline (#4111)
|
|
91
95
|
timeline:
|
|
92
96
|
actors: Filter by actor
|
|
93
97
|
loading: Loading…
|
|
94
98
|
empty: Nothing happened yet
|
|
95
|
-
newEvents: "{count} new events"
|
|
99
|
+
newEvents: "{count} new event | {count} new events"
|
|
96
100
|
oldestFirst: Oldest first
|
|
97
101
|
newestFirst: Newest first
|
|
98
102
|
# PayloadViewer / PayloadDiff (#4112)
|
|
@@ -103,14 +107,14 @@ core:
|
|
|
103
107
|
copied: Copied to the clipboard
|
|
104
108
|
copyFailed: Could not copy
|
|
105
109
|
download: Download
|
|
106
|
-
showAll: "Show all {count} rows"
|
|
110
|
+
showAll: "Show {count} row | Show all {count} rows"
|
|
107
111
|
binary: "Binary content, {size}. First bytes:"
|
|
108
112
|
malformed: "Not valid {format} ({error}), shown as text"
|
|
109
113
|
expected: Expected
|
|
110
114
|
captured: Captured
|
|
111
115
|
identical: Identical
|
|
112
|
-
unchanged: "{count} unchanged lines"
|
|
113
|
-
showSame: "Show {count} unchanged rows"
|
|
116
|
+
unchanged: "{count} unchanged line | {count} unchanged lines"
|
|
117
|
+
showSame: "Show {count} unchanged row | Show {count} unchanged rows"
|
|
114
118
|
inline: Inline
|
|
115
119
|
split: Side by side
|
|
116
120
|
# EmailPreview (#4113)
|
|
@@ -127,7 +131,7 @@ core:
|
|
|
127
131
|
html: HTML
|
|
128
132
|
text: Text
|
|
129
133
|
source: Source
|
|
130
|
-
imagesBlocked: "{count} remote images blocked"
|
|
134
|
+
imagesBlocked: "{count} remote image blocked | {count} remote images blocked"
|
|
131
135
|
loadImages: Load images
|
|
132
136
|
blockImages: Block images
|
|
133
137
|
empty: This email has no body
|
|
@@ -151,10 +155,18 @@ core:
|
|
|
151
155
|
start: Start
|
|
152
156
|
dontStart: Do not start
|
|
153
157
|
typeToConfirm: "Type {value} to confirm"
|
|
154
|
-
tray: "{count} running tasks"
|
|
158
|
+
tray: "{count} running task | {count} running tasks"
|
|
155
159
|
trayDone: Recent tasks
|
|
156
160
|
clear: Clear finished
|
|
157
|
-
#
|
|
161
|
+
# NotFoundPage
|
|
162
|
+
notFound:
|
|
163
|
+
title: Page not found
|
|
164
|
+
message: The page you're looking for doesn't exist or has been moved.
|
|
165
|
+
home: Back to Home
|
|
166
|
+
# The breadcrumb (useBreadcrumb, useNavContext, PageNav).
|
|
158
167
|
breadcrumb:
|
|
168
|
+
home: Home
|
|
169
|
+
dashboard: Dashboard
|
|
170
|
+
details: Details
|
|
159
171
|
view: View
|
|
160
172
|
edit: Edit
|
|
@@ -15,6 +15,7 @@ export default `core:
|
|
|
15
15
|
submit: Valider
|
|
16
16
|
reset: Réinitialiser
|
|
17
17
|
back: Retour
|
|
18
|
+
view: Voir
|
|
18
19
|
next: Suivant
|
|
19
20
|
previous: Précédent
|
|
20
21
|
close: Fermer
|
|
@@ -48,6 +49,9 @@ export default `core:
|
|
|
48
49
|
created: Créé
|
|
49
50
|
updated: Modifié
|
|
50
51
|
confirmDelete: Êtes-vous sûr de vouloir supprimer cet élément ?
|
|
52
|
+
confirmDeleteTitle: Confirmer la suppression
|
|
53
|
+
confirmDeleteItem: "Supprimer {entity} « {label} » ?"
|
|
54
|
+
confirmDeleteThis: "Êtes-vous sûr de vouloir supprimer cet élément ({entity}) ?"
|
|
51
55
|
errors:
|
|
52
56
|
required: Requis
|
|
53
57
|
tooShort: Trop court (min {min})
|
|
@@ -77,24 +81,24 @@ export default `core:
|
|
|
77
81
|
done: Terminé
|
|
78
82
|
stopped: Arrêté
|
|
79
83
|
failed: "Échec : {error}"
|
|
80
|
-
lines: "{count} lignes"
|
|
84
|
+
lines: "{count} ligne | {count} lignes"
|
|
81
85
|
search: Chercher dans le log
|
|
82
86
|
previous: Occurrence précédente
|
|
83
87
|
next: Occurrence suivante
|
|
84
88
|
onlyMatches: Seulement les lignes trouvées
|
|
85
|
-
errors: "{count} erreurs"
|
|
89
|
+
errors: "{count} erreur | {count} erreurs"
|
|
86
90
|
firstError: Aller à la ligne d'erreur suivante
|
|
87
91
|
wrap: Couper les lignes longues
|
|
88
92
|
follow: Suivre la fin du log
|
|
89
93
|
download: Télécharger le log
|
|
90
|
-
newLines: "{count} nouvelles lignes, reprendre"
|
|
94
|
+
newLines: "{count} nouvelle ligne, reprendre | {count} nouvelles lignes, reprendre"
|
|
91
95
|
empty: Rien pour l'instant
|
|
92
96
|
# EntityTimeline (#4111)
|
|
93
97
|
timeline:
|
|
94
98
|
actors: Filtrer par acteur
|
|
95
99
|
loading: Chargement…
|
|
96
100
|
empty: Rien ne s'est encore passé
|
|
97
|
-
newEvents: "{count} nouveaux événements"
|
|
101
|
+
newEvents: "{count} nouvel événement | {count} nouveaux événements"
|
|
98
102
|
oldestFirst: Plus anciens d'abord
|
|
99
103
|
newestFirst: Plus récents d'abord
|
|
100
104
|
# PayloadViewer / PayloadDiff (#4112)
|
|
@@ -105,14 +109,14 @@ export default `core:
|
|
|
105
109
|
copied: Copié dans le presse-papiers
|
|
106
110
|
copyFailed: Copie impossible
|
|
107
111
|
download: Télécharger
|
|
108
|
-
showAll: "Afficher les {count} lignes"
|
|
112
|
+
showAll: "Afficher {count} ligne | Afficher les {count} lignes"
|
|
109
113
|
binary: "Contenu binaire, {size}. Premiers octets :"
|
|
110
114
|
malformed: "{format} invalide ({error}), affiché comme texte"
|
|
111
115
|
expected: Attendu
|
|
112
116
|
captured: Capturé
|
|
113
117
|
identical: Identiques
|
|
114
|
-
unchanged: "{count} lignes inchangées"
|
|
115
|
-
showSame: "Afficher les {count} lignes inchangées"
|
|
118
|
+
unchanged: "{count} ligne inchangée | {count} lignes inchangées"
|
|
119
|
+
showSame: "Afficher {count} ligne inchangée | Afficher les {count} lignes inchangées"
|
|
116
120
|
inline: En ligne
|
|
117
121
|
split: Côte à côte
|
|
118
122
|
# EmailPreview (#4113)
|
|
@@ -129,7 +133,7 @@ export default `core:
|
|
|
129
133
|
html: HTML
|
|
130
134
|
text: Texte
|
|
131
135
|
source: Source
|
|
132
|
-
imagesBlocked: "{count} images distantes bloquées"
|
|
136
|
+
imagesBlocked: "{count} image distante bloquée | {count} images distantes bloquées"
|
|
133
137
|
loadImages: Charger les images
|
|
134
138
|
blockImages: Bloquer les images
|
|
135
139
|
empty: Ce mail n'a pas de contenu
|
|
@@ -153,11 +157,19 @@ export default `core:
|
|
|
153
157
|
start: Lancer
|
|
154
158
|
dontStart: Ne pas lancer
|
|
155
159
|
typeToConfirm: "Taper {value} pour confirmer"
|
|
156
|
-
tray: "{count} tâches en cours"
|
|
160
|
+
tray: "{count} tâche en cours | {count} tâches en cours"
|
|
157
161
|
trayDone: Tâches récentes
|
|
158
162
|
clear: Effacer les terminées
|
|
159
|
-
#
|
|
163
|
+
# NotFoundPage
|
|
164
|
+
notFound:
|
|
165
|
+
title: Page introuvable
|
|
166
|
+
message: La page demandée n'existe pas ou a été déplacée.
|
|
167
|
+
home: Retour à l'accueil
|
|
168
|
+
# The breadcrumb (useBreadcrumb, useNavContext, PageNav).
|
|
160
169
|
breadcrumb:
|
|
170
|
+
home: Accueil
|
|
171
|
+
dashboard: Tableau de bord
|
|
172
|
+
details: Détails
|
|
161
173
|
view: Voir
|
|
162
174
|
edit: Modifier
|
|
163
175
|
`
|
|
@@ -13,6 +13,7 @@ core:
|
|
|
13
13
|
submit: Valider
|
|
14
14
|
reset: Réinitialiser
|
|
15
15
|
back: Retour
|
|
16
|
+
view: Voir
|
|
16
17
|
next: Suivant
|
|
17
18
|
previous: Précédent
|
|
18
19
|
close: Fermer
|
|
@@ -46,6 +47,9 @@ core:
|
|
|
46
47
|
created: Créé
|
|
47
48
|
updated: Modifié
|
|
48
49
|
confirmDelete: Êtes-vous sûr de vouloir supprimer cet élément ?
|
|
50
|
+
confirmDeleteTitle: Confirmer la suppression
|
|
51
|
+
confirmDeleteItem: "Supprimer {entity} « {label} » ?"
|
|
52
|
+
confirmDeleteThis: "Êtes-vous sûr de vouloir supprimer cet élément ({entity}) ?"
|
|
49
53
|
errors:
|
|
50
54
|
required: Requis
|
|
51
55
|
tooShort: Trop court (min {min})
|
|
@@ -75,24 +79,24 @@ core:
|
|
|
75
79
|
done: Terminé
|
|
76
80
|
stopped: Arrêté
|
|
77
81
|
failed: "Échec : {error}"
|
|
78
|
-
lines: "{count} lignes"
|
|
82
|
+
lines: "{count} ligne | {count} lignes"
|
|
79
83
|
search: Chercher dans le log
|
|
80
84
|
previous: Occurrence précédente
|
|
81
85
|
next: Occurrence suivante
|
|
82
86
|
onlyMatches: Seulement les lignes trouvées
|
|
83
|
-
errors: "{count} erreurs"
|
|
87
|
+
errors: "{count} erreur | {count} erreurs"
|
|
84
88
|
firstError: Aller à la ligne d'erreur suivante
|
|
85
89
|
wrap: Couper les lignes longues
|
|
86
90
|
follow: Suivre la fin du log
|
|
87
91
|
download: Télécharger le log
|
|
88
|
-
newLines: "{count} nouvelles lignes, reprendre"
|
|
92
|
+
newLines: "{count} nouvelle ligne, reprendre | {count} nouvelles lignes, reprendre"
|
|
89
93
|
empty: Rien pour l'instant
|
|
90
94
|
# EntityTimeline (#4111)
|
|
91
95
|
timeline:
|
|
92
96
|
actors: Filtrer par acteur
|
|
93
97
|
loading: Chargement…
|
|
94
98
|
empty: Rien ne s'est encore passé
|
|
95
|
-
newEvents: "{count} nouveaux événements"
|
|
99
|
+
newEvents: "{count} nouvel événement | {count} nouveaux événements"
|
|
96
100
|
oldestFirst: Plus anciens d'abord
|
|
97
101
|
newestFirst: Plus récents d'abord
|
|
98
102
|
# PayloadViewer / PayloadDiff (#4112)
|
|
@@ -103,14 +107,14 @@ core:
|
|
|
103
107
|
copied: Copié dans le presse-papiers
|
|
104
108
|
copyFailed: Copie impossible
|
|
105
109
|
download: Télécharger
|
|
106
|
-
showAll: "Afficher les {count} lignes"
|
|
110
|
+
showAll: "Afficher {count} ligne | Afficher les {count} lignes"
|
|
107
111
|
binary: "Contenu binaire, {size}. Premiers octets :"
|
|
108
112
|
malformed: "{format} invalide ({error}), affiché comme texte"
|
|
109
113
|
expected: Attendu
|
|
110
114
|
captured: Capturé
|
|
111
115
|
identical: Identiques
|
|
112
|
-
unchanged: "{count} lignes inchangées"
|
|
113
|
-
showSame: "Afficher les {count} lignes inchangées"
|
|
116
|
+
unchanged: "{count} ligne inchangée | {count} lignes inchangées"
|
|
117
|
+
showSame: "Afficher {count} ligne inchangée | Afficher les {count} lignes inchangées"
|
|
114
118
|
inline: En ligne
|
|
115
119
|
split: Côte à côte
|
|
116
120
|
# EmailPreview (#4113)
|
|
@@ -127,7 +131,7 @@ core:
|
|
|
127
131
|
html: HTML
|
|
128
132
|
text: Texte
|
|
129
133
|
source: Source
|
|
130
|
-
imagesBlocked: "{count} images distantes bloquées"
|
|
134
|
+
imagesBlocked: "{count} image distante bloquée | {count} images distantes bloquées"
|
|
131
135
|
loadImages: Charger les images
|
|
132
136
|
blockImages: Bloquer les images
|
|
133
137
|
empty: Ce mail n'a pas de contenu
|
|
@@ -151,10 +155,18 @@ core:
|
|
|
151
155
|
start: Lancer
|
|
152
156
|
dontStart: Ne pas lancer
|
|
153
157
|
typeToConfirm: "Taper {value} pour confirmer"
|
|
154
|
-
tray: "{count} tâches en cours"
|
|
158
|
+
tray: "{count} tâche en cours | {count} tâches en cours"
|
|
155
159
|
trayDone: Tâches récentes
|
|
156
160
|
clear: Effacer les terminées
|
|
157
|
-
#
|
|
161
|
+
# NotFoundPage
|
|
162
|
+
notFound:
|
|
163
|
+
title: Page introuvable
|
|
164
|
+
message: La page demandée n'existe pas ou a été déplacée.
|
|
165
|
+
home: Retour à l'accueil
|
|
166
|
+
# The breadcrumb (useBreadcrumb, useNavContext, PageNav).
|
|
158
167
|
breadcrumb:
|
|
168
|
+
home: Accueil
|
|
169
|
+
dashboard: Tableau de bord
|
|
170
|
+
details: Détails
|
|
159
171
|
view: Voir
|
|
160
172
|
edit: Modifier
|
package/src/i18n/useI18n.ts
CHANGED
|
@@ -7,12 +7,19 @@
|
|
|
7
7
|
|
|
8
8
|
import { computed, inject, type Ref, type ComputedRef } from 'vue'
|
|
9
9
|
import type { I18n } from './I18n'
|
|
10
|
+
import { interpolate } from '@quazardous/qdcore'
|
|
10
11
|
import type { TranslateParams } from './types'
|
|
11
12
|
|
|
12
13
|
export const I18N_INJECTION_KEY = Symbol('qdadm.i18n')
|
|
13
14
|
|
|
14
15
|
export interface UseI18nResult {
|
|
15
16
|
t: (key: string, params?: TranslateParams) => string
|
|
17
|
+
/**
|
|
18
|
+
* The catalog's text for `key`, or `fallback` (interpolated) when the key
|
|
19
|
+
* is missing or there is no I18n: for labels that read as English text,
|
|
20
|
+
* not as a key, outside a kernel.
|
|
21
|
+
*/
|
|
22
|
+
tOr: (key: string, fallback: string, params?: TranslateParams) => string
|
|
16
23
|
locale: ComputedRef<string> | Ref<string>
|
|
17
24
|
i18n: I18n | null
|
|
18
25
|
}
|
|
@@ -22,12 +29,17 @@ export function useI18n(): UseI18nResult {
|
|
|
22
29
|
if (!i18n) {
|
|
23
30
|
return {
|
|
24
31
|
t: (key: string) => key,
|
|
32
|
+
tOr: (_key, fallback, params) => interpolate(fallback, params),
|
|
25
33
|
locale: computed(() => 'en'),
|
|
26
34
|
i18n: null,
|
|
27
35
|
}
|
|
28
36
|
}
|
|
29
37
|
return {
|
|
30
38
|
t: (key, params) => i18n.t(key, params),
|
|
39
|
+
tOr: (key, fallback, params) => {
|
|
40
|
+
const trace = i18n.resolve(key, params)
|
|
41
|
+
return trace.hit ? trace.result : interpolate(fallback, params, i18n.locale.value)
|
|
42
|
+
},
|
|
31
43
|
locale: i18n.locale,
|
|
32
44
|
i18n,
|
|
33
45
|
}
|
package/src/kernel/Module.ts
CHANGED
|
@@ -71,12 +71,13 @@ export class Module {
|
|
|
71
71
|
|
|
72
72
|
/**
|
|
73
73
|
* Path to module styles (relative import or absolute)
|
|
74
|
-
* Set in subclass to auto-load CSS
|
|
74
|
+
* Set in subclass to auto-load CSS when module connects. Ship CSS, not SCSS:
|
|
75
|
+
* an app should not need sass to load a module (#4140).
|
|
75
76
|
* Styles are loaded once and cached.
|
|
76
77
|
*
|
|
77
78
|
* @example
|
|
78
79
|
* class DebugModule extends Module {
|
|
79
|
-
* static styles = () => import('./styles.
|
|
80
|
+
* static styles = () => import('./styles.css')
|
|
80
81
|
* }
|
|
81
82
|
*/
|
|
82
83
|
static styles: (() => Promise<unknown>) | null = null
|
|
@@ -89,7 +89,9 @@ export class DebugModule extends Module {
|
|
|
89
89
|
static override moduleName = 'debug'
|
|
90
90
|
static override requires: string[] = []
|
|
91
91
|
static override priority = 1000
|
|
92
|
-
|
|
92
|
+
// Compiled from styles.scss by `npm run gen:debug-css` (#4140): apps load CSS,
|
|
93
|
+
// never sass. A test fails when the two drift apart.
|
|
94
|
+
static styles = () => import('./styles.generated.css')
|
|
93
95
|
|
|
94
96
|
declare options: DebugModuleOptions
|
|
95
97
|
private _bridge: DebugBridge | null = null
|