2023-03-14 13:18:55 +00:00
|
|
|
/**
|
|
|
|
* Copyright (c) HashiCorp, Inc.
|
|
|
|
* SPDX-License-Identifier: MPL-2.0
|
|
|
|
*/
|
|
|
|
|
2022-06-16 11:07:04 +00:00
|
|
|
/* eslint no-console: ["error", { allow: ["debug"] }] */
|
|
|
|
import { runInDebug } from '@ember/debug';
|
|
|
|
|
2021-01-25 18:13:54 +00:00
|
|
|
// 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) {
|
2022-09-15 08:43:17 +00:00
|
|
|
runInDebug((_) => console.debug(`Translation key not found: ${key}`));
|
|
|
|
const last = key.split('.').pop().split('-').join(' ');
|
2021-01-25 18:13:54 +00:00
|
|
|
return `${last.substr(0, 1).toUpperCase()}${last.substr(1)}`;
|
|
|
|
}
|