Translation of JS File + dashboard content

I add a method for translation on JS file.
I add a sql escape instead of preg_replace who give some problem with utf8 (in units for example).

I don't understand very well why you use preg_replace on many sql save instead of escape ?