Comments (13)
here's the js am using:
<script type="text/javascript" src="assets/includes/js/jquery.js"></script>
<script type="text/javascript"
src="assets/includes/js/jquery.translate-1.2.4.js"></script>
$(document).ready(function(){
//translate
$('body').translate('<?php echo $_SESSION['sellang'];?>');
});
the session stores the current language to be loaded.
Original comment by [email protected]
on 6 Dec 2008 at 1:52
from jquery-translate.
Could you please send a link to the page?
Also, running it on localhost can cause problems.
Original comment by balazs.endresz
on 6 Dec 2008 at 1:57
from jquery-translate.
Here's the site I'am using it on http://www.surrectmedia.com/ its on a live
server
rsther then a localhost.
Original comment by [email protected]
on 6 Dec 2008 at 2:14
from jquery-translate.
There seems to be a problem in IE, it only works if you run it afterwards:
javascript:$('body').translate('dutch');void(0);
I'm gonna look into it tomorrow.
I don't see TinyMCE anywhere, where should it be?
Original comment by balazs.endresz
on 6 Dec 2008 at 4:15
- Added labels: Priority-Critical
- Removed labels: Priority-Medium
from jquery-translate.
sorry the tinyMCE is in the admin so you won't actually see it, I've put an
instance
on the contact form http://www.surrectmedia.com/contact-us strange thing is it
works
on the contact form but from some of the admin pages it does not it's very
strange it
calls the same javascript file for all instances so it should work ever where
or no
where.
Thanks for your help with this.
Original comment by [email protected]
on 6 Dec 2008 at 4:54
from jquery-translate.
This was so strange that I gave up my plans (and beers) for tonight. And after
struggling for more than an hour finally I've found that f*ckin bug that caused
IE to
fail. Right at the top you have to change
o.to=T.fn.toLanguageCode(o.to || to) || '';
to
o.to=to;
The first line was added not long ago and it converts the language to language
code
(like: 'English'->'en'). The problem is that it is called before the api is
loaded so
it returns undefined (and won't throw an error because a shorter variable is
declared
as an alias for google.language.Languages before the api is loaded, even it has
a
value undefined the for-in loop runs without error on it, great). But it almost
never
came up in Firefox as it loaded the api much faster. This is just a quick fix,
I have
to put that check inside the translateInit function, a bit testing and it will
be up
until tomorrow.
I don't know what to say about TinyMCE right now.
Original comment by balazs.endresz
on 6 Dec 2008 at 8:02
- Changed state: Started
from jquery-translate.
Thanks for all your hard work on this,
I've added the changes to the translate file here is the top section:
;(function($){
function $fn(){}
function isSet(a){ return typeof a!='undefined'; }
function isString(a){ return typeof a=='string'; }
function same(a, b){ return a.toLowerCase() == b.toLowerCase(); }
function isInput(e){
if(!$.nodeName(e[0],'input'))
return false;
return e.attr('type').match(/text|button|submit/i);
}
function args(a, b, c, method){
var from='', to, o={};
if(typeof a=='object'){o=a;}else{
if(!b && !c) to=a;
if(!c && b){ if(typeof b=='object'){ to=a; o=b; }else{ from=a; to=b; } }
if(a && b && c){ from=a; to=b; o=c;}
//o.from=T.fn.toLanguageCode(from)||''; o.to=T.fn.toLanguageCode(to)||'';
o.from=T.fn.toLanguageCode(o.from || from) || '';
//o.to=T.fn.toLanguageCode(o.to || to) || '';
o.to=to;
}
I commented out the line to change and put in the new line only now it does not
work
at all, have I edited the right place?
Original comment by [email protected]
on 6 Dec 2008 at 8:55
from jquery-translate.
I've fixed the IE issue, now you can download the newer version.
If you could share a non-working page with TinyMCE I'd have a look at it!
Original comment by balazs.endresz
on 6 Dec 2008 at 9:02
- Added labels: Priority-Medium
- Removed labels: Priority-Critical
from jquery-translate.
downloaded the new file works great in IE7 now thanks a lot I owe you one.
I've created a page with a tinyMCE instance on it that page as no action
associated
with it so do as you see fit.
http://www.surrectmedia.com/testpage
The editor works when I comment out
$('body').translate('<?php echo $_SESSION['sellang'];?>');
but as soon as I enable it the editor fails to load.
Original comment by [email protected]
on 6 Dec 2008 at 9:26
from jquery-translate.
Put the "Content" string inside a label or some tag because the plugin will
translate
the innerhtml of the containing paragraph in this case if it has a child
textnode, so
the whole stuff regarding the editor will be translated and replaced too. I
think
this was the difference between the contact page and this :)
And it's not that important but maybe you shouldn't translate the "mceEditor"
class,
I don't see any text in it and it will be a bit faster if you tell the plugin
to skip it:
$('body').translate('english',{not:'.mceEditor'})
Original comment by balazs.endresz
on 6 Dec 2008 at 10:15
from jquery-translate.
yeah you were right I put the content string in span tags and that fixed it the
editor loads up fine now. Good point about the translating the editor class I
read
somewhere about not translating some parts just could remember where.
The not: is very useful I've got it set so the languages in the drop down never
changes, I tried doing this yesterday but couldn't get it to work.
Thanks for your help you've been amazing!
Original comment by [email protected]
on 6 Dec 2008 at 10:51
from jquery-translate.
Just wondering if google translate languages are updated will the plugin need
to be
updated as well as I've noticed some languages don't seem to translate I assume
this
is down to google translate api with it being so new.
Original comment by [email protected]
on 6 Dec 2008 at 11:53
from jquery-translate.
http://code.google.com/apis/ajaxlanguage/documentation/reference.html#LangNameAr
ray
These are just the languages google recognizes but can't translate all of them,
the
google.language.isTranslatable(lngCode) function tells if one can be
translated. But
you can get all the translatable languages with
$.translate().getLanguages(true). So
you don't have to update the plugin at all. Also there's a bit more convenient
$.translate().isTranslatable method that automatically converts the argument to
language code: http://code.google.com/p/jquery-translate/wiki/General
And you can also generate a dropdown by just calling
$.translate().ui('select', 'option');
see the Extensions page for details.
Glad I could help and thanks for the bug report!
Original comment by balazs.endresz
on 7 Dec 2008 at 11:31
- Changed state: Done
from jquery-translate.
Related Issues (20)
- Bing won't translate HOT 5
- bing translator and non-well-formed html HOT 24
- support for Google v2 API HOT 25
- Line 462 in Code Trunk Bug. from should be form HOT 1
- How to Remove Openning and Clsong div's in Translate Method Call HOT 1
- the // in http:// is interpreted as comment-line HOT 1
- The Translator is currently not translating anything. HOT 1
- Bing API ID Throwing Error HOT 4
- By setting parallel parameter to true doesn't work, is still working as parallel: false HOT 1
- getting error while loading bingAPI HOT 2
- Uncaught TypeError: Cannot call method 'replace' of undefined HOT 1
- Some fix for correct work with BING HOT 3
- No works for me and no translation , Can you help me please ?
- google.language.callbacks issue(?) HOT 1
- (414) Request-URI Too Large for content length > 2K characters
- Infinite loop when translating certain html
- new fix for use class notranslate
- Patch for /tags/1.4.1/src/jquery.translate-core.js
- Won't Work in Firefox or Chrome on Windows
- Provide a code sample of how to load the plugin
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jquery-translate.