Update translator.js

when translate word, trim the word first, in case the word doesn't match the key of wordsMap.
This commit is contained in:
bnupaladin
2015-05-27 15:38:21 +08:00
parent 0ad8c74e32
commit c0ea250ddd

View File

@@ -29,7 +29,7 @@ window.SwaggerTranslator = {
}, },
_tryTranslate: function(word) { _tryTranslate: function(word) {
return this._words[word] !== undefined ? this._words[word] : word; return this._words[$.trim(word)] !== undefined ? this._words[$.trim(word)] : word;
}, },
learn: function(wordsMap) { learn: function(wordsMap) {