ui: Fix intl keys in order to render correct messages for empty states (#13409)

* ui: Fix intl keys in order to render correct messages for empty states

* Add a debug only debug log to warn about missing keys
This commit is contained in:
John Cowen 2022-06-16 12:07:04 +01:00 committed by GitHub
parent da8cea58c9
commit 7761d0abe4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 19 additions and 9 deletions

3
.changelog/13409.txt Normal file
View File

@ -0,0 +1,3 @@
```release-note:bug
ui: Fix incorrect text on certain page empty states
```

View File

@ -90,13 +90,13 @@ as |route|>
>
<BlockSlot @name="header">
<h2>
{{t 'routes.dc.auth-methods.index.empty.header'
{{t 'routes.dc.acls.auth-methods.index.empty.header'
items=items.length
}}
</h2>
</BlockSlot>
<BlockSlot @name="body">
{{t 'routes.dc.auth-methods.index.empty.body'
{{t 'routes.dc.acls.auth-methods.index.empty.body'
items=items.length
htmlSafe=true
}}

View File

@ -94,13 +94,13 @@ as |route|>
>
<BlockSlot @name="header">
<h2>
{{t 'routes.dc.services.intentions.index.empty.header'
{{t 'routes.dc.services.show.intentions.index.empty.header'
items=items.length
}}
</h2>
</BlockSlot>
<BlockSlot @name="body">
{{t 'routes.dc.services.intentions.index.empty.body'
{{t 'routes.dc.services.show.intentions.index.empty.body'
items=items.length
htmlSafe=true
}}

View File

@ -1,6 +1,12 @@
/* eslint no-console: ["error", { allow: ["debug"] }] */
import { runInDebug } from '@ember/debug';
// if we can't find the message, take the last part of the identifier and
// ucfirst it so it looks human
export default function missingMessage(key, locales) {
runInDebug(
_ => console.debug(`Translation key not found: ${key}`)
);
const last = key
.split('.')
.pop()

View File

@ -75,6 +75,7 @@ dc:
title: Metadata
sessions:
title: Lock Sessions
empty:
header: Welcome to Lock Sessions
body: |
<p>