diff --git a/static/js/services/i18n.js b/static/js/services/i18n.js index 1e314cab4..730e11935 100644 --- a/static/js/services/i18n.js +++ b/static/js/services/i18n.js @@ -1,8 +1,18 @@ (function() { 'use strict'; - // Global I18n registry that stores and serves translations. - // Each translation must have a unique ID. + /** + * I18n + * + * This module stores and serves translated strings, according to the users language settings. + * + * Translations are stored in /messages/frontend/*.msg. + * + * To make additions to any of these files accessible to JavaScrip Utilities + * you need to add them to the respective *.msg file and to the list of FrontendMessages + * in /src/Utils/Frontend/I18n.hs. + * + */ window.I18n = (function() { var translations = {}; @@ -19,7 +29,7 @@ function getTranslation(id) { if (!translations[id]) { - return '(translation missing for »' + id + '«)'; + throw new Error('I18N Error: Translation missing for »' + id + '«!'); } return translations[id]; }