1. #1
    Sencha User
    Join Date
    Aug 2008
    Posts
    34
    Vote Rating
    1
    tomim is on a distinguished road

      0  

    Default [3.0]Automatic translation of ExtJs Components v1.6 NEW

    [3.0]Automatic translation of ExtJs Components v1.6 NEW


    INFO : 13.07.2009. From now source is hosted on http://code.google.com/p/extjsdyntran/

    There is also client only version.It must be deployed to server also, but does not require serverside support (PHP or Java). Translations will be made directly from Google Translation Service. This is limited version with less features but it is zero configuraiton. Use it for testing and previewing this add-on.

    Screencast can be found also on project download page.


    Hi all,

    I have created additional override to Ext.Component to implement translation functions to all GUI Ext components through Google Translation API.

    These translation functions will call server side through ajax calls to translate field labels, titles, messages and other standard text properties of Ext GUI components.

    Server side is written as Java Servlet and PHP using Google Translation API (Java and PHP version). So you can use which one you prefere.

    I have noticed one problem with PHP. When server runs on intranet and use proxy to exit to Internet, PHP does not work?!?! I am not PHP developer so I am not using original PHP but Quercus PHP Java library so maybe the problem is in this library?!

    Next version will contain server side cached translation to minimize calls to Google Translation Service. Automatic translation will be cached (saved to text file ) so admin can additionaly translate words that are not translated or quality of translation is not good enough.

    Never the less this will help developers to add some degre of automatic translation of their projects.
    There is only one line of code to call to start automatic translation.

    setLanguage('CROATIAN');

    See more in Ext.translate.js and attatched project.

    Project is not finished yet but working example with sources you can find in the attachment.

    After new version is finnished I will post new sources here.

    Any ideas and suggestions are wery wellcome.

    Update 02.07.2009.

    In the attatchement one will find ziped Eclipse project that can be rebuilt and deployed on the Tomcat or any other java web server.

    When you start the Tomcat and install the war file go to

    http://localhost:8080/GoogleTranslation

    Server side is written in Java but also the PHP version is available.
    Caching is added (Java only) so already translated text is no longer sent to GT API.

    For PHP version I'm using Resin Quercus java library (PHP engine 100% written in Java).
    There is no need for PHP instalation.
    For more info go to http://www.caucho.com/ and http://quercus.caucho.com/

    Requirements : java jdk 1.5 ; Tomcat 5/6 ; Eclipse ; ExtJs 3.0

    Install :
    1. Unzip project in Eclipse workspace folder and import it.
    2. Download resinn from http://www.caucho.com/download/resin-4.0.0.zip and copy all jar files from lib folder to project subfolder WebContent\WEB-INF\lib
    3. Fix paths to libraries. (included in project subfolder WebContent\WEB-INF\lib).
    4. Create new Server project; create server instance in Eclipse; add this project to Server instance
    5. Create new empty Dynamic Web Project and copy EXTJS3 library inside WebContent folder. Deploy it to server instance also.
    6. Start Tomcat in Eclipse and right click to index.html -> Run As -> Run on Server. File is in WebContent of this project.

    IMPORTANT NOTE : Resin class com.caucho.vfs.HttpStream has a bug so you need to remove it from resin.jar (open with winzip or winrar).
    When project is rebuilt, new replacement class will be used.
    Source is included inside project. For more details see header in included HttpStream.java file.

    Update 05.07.2009.

    Added server side caching
    Added autotranslate on component create
    Added ExtJs Web Desktop demo with Google Translation
    (for Web Desktop Demo , go to Start and Window 6 where you can change language)

    Update 07.07.2009.
    Source code optimization and smaller fixes.
    Ext.MessageBox auto translation added.
    Added client side caching object Ext.translate.Cache (not implemented yet).
    Fixed bug in Web Desktop demo with Google Translation.

    Update 10.07.2009.
    Fixed minor bugs and implemented client side caching.

    Update 13.07.2009.
    New version with rewritten code and improved speed, now on Google code.

    Update 21.07.2009.
    Version 1.4 available for download.

    Update 24.07.2009.
    Video demoes added under download section on project page.

    Update 12.08.2009.
    Version 1.5 BETA available. For more info visit link on top of this post.

    Update 30.09.2009.
    Version 1.6 available. For more info visit link on top of this post.
    Last edited by tomim; 30 Sep 2009 at 9:01 AM. Reason: new version update

  2. #2
    Sencha - Community Support Team mystix's Avatar
    Join Date
    Mar 2007
    Location
    Singapore
    Posts
    6,236
    Vote Rating
    5
    mystix will become famous soon enough

      0  

    Default


    wow... this looks real interesting.
    is there any way to dump the contents of the cache?

  3. #3
    Sencha User
    Join Date
    Aug 2008
    Posts
    34
    Vote Rating
    1
    tomim is on a distinguished road

      0  

    Default


    Quote Originally Posted by mystix View Post
    wow... this looks real interesting.
    is there any way to dump the contents of the cache?
    Cached translation will be saved as text file so they can be easily reconfigured.
    My idea is if browser send new request to the server for new GUI language...then server side program will search for words in cache and if not found, new translation request will be sent to the Google Translation Service.

    New translation will be serialized back to cached txt file and to the browser .

    Later on, developer can check translations in cached files (I will name it like ENGLISH.properties etc...).

  4. #4
    Sencha - Community Support Team mystix's Avatar
    Join Date
    Mar 2007
    Location
    Singapore
    Posts
    6,236
    Vote Rating
    5
    mystix will become famous soon enough

      0  

    Default


    you read my mind.

    this has the potential to make (near) zero-config translations a reality.
    (imagine -- no more plowing through locale files )

  5. #5
    Sencha User
    Join Date
    Aug 2008
    Posts
    34
    Vote Rating
    1
    tomim is on a distinguished road

      0  

    Default


    Quote Originally Posted by mystix View Post
    you read my mind.

    this has the potential to make (near) zero-config translations a reality.
    (imagine -- no more plowing through locale files )

    You are correct about near zero-config. It will be impossible to have 100% translation
    but translation of original properties inside ExtJs componets should work nicely.

    I have added caching (java only), Web Desktop Demo with Google Translation and some new updates in Ext.translate.js. Sources in first post of this thread are replaced with new version.

  6. #6
    Sencha User
    Join Date
    Aug 2008
    Posts
    34
    Vote Rating
    1
    tomim is on a distinguished road

      0  

    Default


    I have added new improved version.

    Next step is to implement global client side cache. (new Ext.translate.Cache object is included)

    Many object can have the same texts for the titles, field names etc. It is not needed to repeatedly call remote translation of already translated resources.

  7. #7
    Sencha User
    Join Date
    Aug 2008
    Posts
    34
    Vote Rating
    1
    tomim is on a distinguished road

      0  

    Default


    !!! NEW VERSION !!! Ext.translate 1.3

    It has a lot of enhancements. Code is rewritten for usage of client side cache
    for translated texts. There is many code optimizations to improve speed and
    minimize remote calls. AJAX Calls are made on component init so all fields is translated
    before component is rendered.(synchronous AJAX calls
    using addon library ext-basex.js)

    Code is now located on Google Code page... http://code.google.com/p/extjsdyntran/

  8. #8
    Sencha User
    Join Date
    Mar 2009
    Posts
    19
    Vote Rating
    1
    YYSAM is on a distinguished road

      0  

    Default


    Quote Originally Posted by tomim View Post
    !!! NEW VERSION !!! Ext.translate 1.3

    It has a lot of enhancements. Code is rewritten for usage of client side cache
    for translated texts. There is many code optimizations to improve speed and
    minimize remote calls. AJAX Calls are made on component init so all fields is translated
    before component is rendered.(synchronous AJAX calls
    using addon library ext-basex.js)

    Code is now located on Google Code page... http://code.google.com/p/extjsdyntran/
    great, I will try it later. thanks so much!!

  9. #9
    Ext User
    Join Date
    Sep 2008
    Location
    Germany
    Posts
    961
    Vote Rating
    1
    Arno.Nyhm is on a distinguished road

      0  

    Default


    maybe you can attach some sample screenshots or sample translations to see what is translated and how is the quality of this.

    how is the problem solved that technical things are a little bit different translatet than normal speach?


    maybe you can also make connection to tools like babelzilla?
    ( see glossary of babelzilla http://www.babelzilla.org/index.php?...ary&Itemid=219 and an firefox extension using this https://addons.mozilla.org/de/firefox/addon/5810 )

  10. #10
    Sencha User
    Join Date
    Aug 2008
    Posts
    34
    Vote Rating
    1
    tomim is on a distinguished road

      0  

    Default


    Quote Originally Posted by Arno.Nyhm View Post
    maybe you can attach some sample screenshots or sample translations to see what is translated and how is the quality of this.

    how is the problem solved that technical things are a little bit different translatet than normal speach?
    You can download demoes and try. Translations are not always as expected. This is due to Google Translation Service quality. Manual correction is neccessary.

    I am sure you are aware that there is no literaly and gramaticaly 100% correct automatic translation engine.

    As I mentioned on project page, idea is to help developers to have some kind of solution for automatic loading of translations and applying them to Ext.Component elements. It is AJAXED, no need for loading locale.js files and refreshing whole page.

    The whole concept is that application is developed on development environment. In process of development, you give support to some other languages simply by using this add on, selecting different language and translations will be done with help of some translation service (in this case Google Translation Service). Translated words are saved in text files on server side. In production environment is enough to copy translated text files (i need to put some documentatin how to do it ) and server side support I wrote will load those translated files on startup.When user selects one of supported languages, translations will be loaded dynamicaly from server side cache. It is faster than translating again from remote service. Also you can be sure that translations will be correct as they are loaded from already corrected translation files. You can also give support to any other language not supported by Google Translation Service by creating your own language text file.

    For example...

    For Kenian language you will create KENIAN.properties file and wrote some translations like
    english word = kenian word

    And add KENIAN in Ext.translate.languages.

    Quote Originally Posted by Arno.Nyhm View Post
    maybe you can also make connection to tools like babelzilla?
    ( see glossary of babelzilla http://www.babelzilla.org/index.php?...ary&Itemid=219 and an firefox extension using this https://addons.mozilla.org/de/firefox/addon/5810 )
    Thanks for ideas. It they support remote AJAX services I will look into this.

    If that kind of plugins exists for all other browsers then my addon will not be neededd at all. On other hand, if you are running application in some company intranet (banks for example) which have firewalls blocking such services or using proxies for filtering urls and data, then that kind of addons for page translations are not good enough.