From 0f8e560247834f978afa7706ca9b231962786280 Mon Sep 17 00:00:00 2001 From: David Baker Date: Fri, 26 May 2017 15:29:11 +0100 Subject: [PATCH] Add function to display i18n keys in UI Avoids having to load translations in riot-web tests --- src/languageHandler.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/languageHandler.js b/src/languageHandler.js index 6734c99582..cddc70da56 100644 --- a/src/languageHandler.js +++ b/src/languageHandler.js @@ -37,6 +37,13 @@ export function _t(...args) { return counterpart.translate(...args); } +// Allow overriding the text displayed when no translation exists +// Currently only use din unit tests to avoid having to load +// the translations in riot-web +export function setMissingEntryGenerator(f) { + counterpart.setMissingEntryGenerator(f); +} + export function setLanguage(preferredLangs) { if (!Array.isArray(preferredLangs)) { preferredLangs = [preferredLangs];