--- lang.orig.php	2010-02-19 21:00:52.733487412 +0200
+++ lang.php	2010-02-14 23:25:44.545525246 +0200
@@ -545,6 +545,32 @@
             $string = isset($string) ? $string : array();
             ksort($string);
 
+$translang = preg_replace('/_.*/', '', $currentlang);
+echo '
+<script type="text/javascript" src="http://www.google.com/jsapi"></script>
+<script type="text/javascript">
+  google.load("language", "1")
+  google.load("jquery", "1.4.1")
+</script>
+<script type="text/javascript">
+  $(document).ready(function() {
+    $("form .translator .stren").click(function() {
+      var src = $(this);
+      var dst = $("[name=\'stringXXX" + this.id + "\']")
+      var tokens = [];
+      var text = src.text().replace(/\$a(->\w*)?/g, function(match) {
+        return "TK" + (tokens.push(match)-1);
+      });
+      google.language.translate(text, "en", "' . $translang .'", function(result) {
+        if (!result.error) {
+          dst.text(result.translation.replace(/TK\d+/g, function(match) {
+            return tokens[match.substring(2)];
+          })).css("background-color", "yellow")
+        }
+      })
+    })
+  });
+</script>';
             if ($editable) {
                 $o .= "<form id=\"$currentfile\" action=\"lang.php\" method=\"post\">";
                 $o .= '<div>';
