mirror of
https://github.com/discourse/discourse.git
synced 2025-05-22 07:53:49 +08:00
FIX: Allow message format translations to be overridden
This commit is contained in:
17
lib/javascripts/messageformat-lookup.js
Normal file
17
lib/javascripts/messageformat-lookup.js
Normal file
@ -0,0 +1,17 @@
|
||||
(function() {
|
||||
|
||||
I18n.messageFormat = function(key, options) {
|
||||
var fn = I18n._compiledMFs[key];
|
||||
if (fn) {
|
||||
try {
|
||||
return fn(options);
|
||||
} catch(err) {
|
||||
return err.message;
|
||||
}
|
||||
} else {
|
||||
return 'Missing Key: ' + key;
|
||||
}
|
||||
return I18n._compiledMFs[key](options);
|
||||
};
|
||||
|
||||
})();
|
Reference in New Issue
Block a user