<script type="text/javascript"> jQuery(document).ready(function($){ jQuery('.description-en').keyup(function(){ var value = jQuery(this).val(); jQuery("div.original").text(value); }); var apiKey = "ENTER-YOUR-API-KEY-HERE"; var langSource = "en"; jQuery('a.translate-de').click(function(){ var langTarget = "de"; // The language Google will translate the text in. var description = jQuery("div.original").val(); // Fetch source of text to translate. var apiurl = "https://www.googleapis.com/language/translate/v2?key=" + apiKey + "&source=" + langSource + "&target=" + langTarget + "&q=" + description + ""; alert(apiurl); // This is just to see if all data is sent through // Now we call the data $.ajax({ url: apiurl + encodeURIComponent(description), dataType: 'jsonp', success: function(data){ // console.log(data); console.log(data.data.translations[0].translatedText); jQuery('.description-de').text(data); // Inserts translated text. jQuery('span.status').text('Translation Complete!'); // Updates the status of translation if successfull. } }); return false; }); }); </script> <textarea class="description-en" rows="5" cols="20"></textarea> <div class="original">Your description is presented here.</div> <a href="#" class="translate-de">Translate Description</a><br> <textarea class="description-de" rows="5" cols="20">Translation is inserted here!</textarea> <br>Status: <b><span class="status">No Translation</span></b> [/CODE]
I'm in need of some help to get this working. I have a text-area field box to which I enter my text in English and then I have a link that when clicked it will translate it in German and enter the translation text in another text-area field below.
I am having trouble trying to get the value of the original text when sending it through and would like some feed back to tell me what is missing or wrong with the code.
Your feedback would be greatly appreciated and any one can you use this if they wish once it works.
P.S. 'div.original' will be hidden off screen once this function works so the user will not see what they are typing appearing below the text-area field.
It's iconic and a useful accessible place to see all your apps. That was its core goal, and it still delivers that today, in arguably a much simpler, easier to manage way than in years gone by.
I think the key thing to note is MacOS has the Launcher, a place where all apps are listed. Prior to that, a list of apps were only accessible via Finder Apps folder, and the dock was auto populated as apps were installed. With the upcoming MacOS 26? release it looks like Launcher is becoming more menu like, rather than full screen, which I think shows how useful such a feature actually is.
At the end of the day, the vast majority of users will rely on the Start Menu for accessing their apps. While there are many other ways to go about it, it's actually a very well designed, simple, yet feature rich menu (obviously with some issues) that make using a computer so damn simple. And that's why Microsoft needs it, because Windows isn't Linux.
Is the Start menu needed? Yes.
Is it needed in its current form? No.
I run lubuntu, it has all my apps sorted into categories, a bunch of preferences and system tools, the option to turn off, and search. It's all in a small rectangle and does everything you need it to.
Question
seb86
I'm in need of some help to get this working. I have a text-area field box to which I enter my text in English and then I have a link that when clicked it will translate it in German and enter the translation text in another text-area field below.
I am having trouble trying to get the value of the original text when sending it through and would like some feed back to tell me what is missing or wrong with the code.
Your feedback would be greatly appreciated and any one can you use this if they wish once it works.
P.S. 'div.original' will be hidden off screen once this function works so the user will not see what they are typing appearing below the text-area field.
Link to comment
https://www.neowin.net/forum/topic/1045685-google-translate-v2-using-jquery-and-ajax/Share on other sites
9 answers to this question
Recommended Posts