Merge pull request #322 from incubateur-territoires/fix-i18n-exists

Fix condition to check that a translation key exists
pull/321/head
jarek 2 years ago committed by GitHub
commit 4ebffff06d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -71,7 +71,7 @@ export async function setupLocale() {
* Resolves the translation of the given key, using the given options.
*/
export function t(key: string, args?: any): string {
if (!i18next.exists(key)) {
if (!i18next.exists(key, args)) {
const error = new Error(`Missing translation for key: ${key} and language: ${i18next.language}`);
reportError(error);
}

Loading…
Cancel
Save