balazs-endresz / jquery-translate

Automatically exported from code.google.com/p/jquery-translate
5 stars 5 forks source link

Issue with leading white space #7

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
This is a re-post because the suggest fix did not resolve the issue.

I'm having an issue when i get a collection of textarea's for example:

$textCollection = $(".edit textarea");

$fields.translate("es",{
        start: function() { $loadingImage.removeClass("hide");},
        complete: function(value) { $loadingImage.addClass("hide"); }
});

it adds a white space character to the leading value in my textarea.

this: "This is the color blue"
becomes: " Este es el color azul" *notice the extra white space

The suggested fix was the following. `this.rawTranslation+=result.translation;`
to
`this.rawTranslation+=result.translation.replace(/^\s+/,"");`

I'm still having the same problem with it adding white space.

Original issue reported on code.google.com by biga...@gmail.com on 23 Jan 2009 at 10:28

GoogleCodeExporter commented 9 years ago
I'm not trying to complain just trying to figure out this issue. Also wanted to 
say
thank you for everyone that contributed in creating this plugin. 

Thank!!

Original comment by biga...@gmail.com on 23 Jan 2009 at 10:29

GoogleCodeExporter commented 9 years ago
I've just fixed this properly, and I'll upload it soon, but before that I want 
to 
configure the YUI Compressor too to work automatically with the build script. 

The problem is that Google inserts whitespace everywhere, and I suggested 
removing 
that in the wrong place, instead you have to replace 

`var tr=$(e).html()`
to
`var tr=$(e).html().replace(/^\s/,"")`

Of course, bugreports are the best one can do to improve software, they are 
very 
welcome! And thanks for filing a new ticket, I'll delete the comments in the 
other 
one.

Original comment by balazs.endresz on 24 Jan 2009 at 11:33

GoogleCodeExporter commented 9 years ago
This should be fixed now in 1.2.6. Please tell if some problem still persists!

Original comment by balazs.endresz on 24 Jan 2009 at 12:26

GoogleCodeExporter commented 9 years ago
I'm having the same issue, but it adds whitespace to the end of a value.

ie:

"1"
"1 "

Original comment by Jstylede...@gmail.com on 15 Dec 2009 at 11:31

GoogleCodeExporter commented 9 years ago
Thanks for reporting! Will be fixed in the next release soon.

Original comment by balazs.endresz on 15 Dec 2009 at 8:57

GoogleCodeExporter commented 9 years ago
Hopefully it's going to work properly now.

Original comment by balazs.endresz on 28 Jan 2010 at 6:06