Mercredi 1 juillet 2009
Purpose

Here is a Java Bean from Jesus Vallejo that works as a translator,
based on the Google Translater project which can be found at "http://google-api-translate-java.googlecode.com/files/google-api-translate-java-0.53.jar".



Translator Bean




The implementation class of the Bean Item

     oracle.forms.jvr.demo.Translater


The methods you can call



  • Register the bean

fbean.register_bean(hBean, 1, 'oracle.forms.jvr.demo.Translater');

This is the very first operation you have to do.



  • Set the text to translate

fbean.invoke( hBean, 1, 'setText', 'Hello');

  • Set the language from

fbean.invoke (hBean,1,'setOrigen','en');


  • Set the language to

fbean.invoke (hBean,1,'setDestino','es');


  • Get the translated text

 translated_text  := fbean.invoke_char (hBean,1,'traducir','');




The sample dialog

     .
Download the gtranslator.zip file
     .  Unzip the gtranslator.zip file
     .  Copy the JAR files in your /forms/java/ folder

     .  Add them to the archive and archive_jini tags of the /forms/server/formsweb.cfg file
     . Open the Translater.fmb module (Oracle Forms 10.1.2)
     . Compile all and run the module

     The jar files must be signed
     The jar files provided with the .zip file are already signed


For any question concerning this bean, send a mail to Jesus at vallejo.jesus@gmail.com.

Par Oracle Forms community - Publié dans : Bean - general
Ecrire un commentaire - Voir les commentaires - Recommander
Retour à l'accueil
Créer un blog sur over-blog.com - Contact - C.G.U. - Rémunération en droits d'auteur - Signaler un abus - Articles les plus commentés