From ea49295774b9d5668ac7337cb77466c0aad92451 Mon Sep 17 00:00:00 2001 From: psychobunny Date: Sat, 4 Jan 2014 18:15:06 -0500 Subject: [PATCH] some translator methods useful for plugins that wish to support i8n --- public/src/translator.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/public/src/translator.js b/public/src/translator.js index 22de13a045..7f87402557 100644 --- a/public/src/translator.js +++ b/public/src/translator.js @@ -25,6 +25,15 @@ module.exports = translator; + // Use this in plugins to add your own translation files. + translator.addTranslation = function(filename, translations) { + files.loaded[filename] = translations; + }; + + translator.getLanguage = function() { + return DEFAULT_LANGUAGE; + }; + translator.get = function (key, callback) { var parsedKey = key.split(':'), languageFile = parsedKey[0];