Add function to display i18n keys in UI

Avoids having to load translations in riot-web tests
pull/21833/head
David Baker 2017-05-26 15:29:11 +01:00
parent e3e848d09e
commit 0f8e560247
1 changed files with 7 additions and 0 deletions

View File

@ -37,6 +37,13 @@ export function _t(...args) {
return counterpart.translate(...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) { export function setLanguage(preferredLangs) {
if (!Array.isArray(preferredLangs)) { if (!Array.isArray(preferredLangs)) {
preferredLangs = [preferredLangs]; preferredLangs = [preferredLangs];