mirror of
https://github.com/photoprism/photoprism.git
synced 2026-07-17 16:49:04 +00:00
UX: Name message fields messageId/messageParams in i18n payloads #5682
Rename the i18n notification/error envelope fields from id/params to messageId/messageParams across the WS notify Data and the i18n.Response body, so they are unambiguous next to session, log, and correlation ids. Updates the frontend consumers (notify.vue, api.js), tests, swagger, and the event/locales READMEs.
This commit is contained in:
parent
2fd9e93247
commit
fd8448d6de
9 changed files with 39 additions and 38 deletions
|
|
@ -111,9 +111,9 @@ $api.interceptors.response.use(
|
|||
code = data.code;
|
||||
}
|
||||
|
||||
if (data.id) {
|
||||
if (data.messageId) {
|
||||
// Render the backend message in the current UI locale from its source id and params.
|
||||
errorMessage = Tp(data.id, data.params);
|
||||
errorMessage = Tp(data.messageId, data.messageParams);
|
||||
} else if (data.message) {
|
||||
errorMessage = data.message;
|
||||
} else if (data.error) {
|
||||
|
|
|
|||
|
|
@ -63,7 +63,7 @@ export default {
|
|||
|
||||
// Render in the current UI language when the backend sent a message id (the English source
|
||||
// string); otherwise fall back to the pre-rendered message string as-is.
|
||||
let m = data.id ? Tp(data.id, data.params) : data.message;
|
||||
let m = data.messageId ? Tp(data.messageId, data.messageParams) : data.message;
|
||||
|
||||
// Skip empty messages.
|
||||
if (!m || !m.length) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue