fixed a bug in translator.js