dhowe / RiTranslate

A translation API for RiTa
2 stars 3 forks source link

RiTranslate: open-source translation for computational writing

npm version

A set of new translation features for the RiTa toolkit, allowing users to do programmatic, real-time translation from within RiTa-based works.

[javadocs]

With Processing

  1. If needed, download and install Processing.
  2. Download and unzip RiTranslate.zip to the "libraries" folder inside your Processing sketchbook (detailed instructions here).
  3. Restart Processing, then create a test sketch as follows:
    
    import rita.translate.*;

void setup() {

GoogleTranslate googleTranslate = new GoogleTranslate();

// language code reference: http://www.w3schools.com/tags/ref_language_codes.asp String translation = googleTranslate.translate("cat", "en", "zh-Hant");

fill(0); textAlign(CENTER); text(translation, width/2, height/2); }



### With Eclipse and Maven

1. Download and install [Eclipse](https://eclipse.org/downloads/)
2. Import RiTranslate, in Eclipse File > Import.. > Git > Projects from Git > Clone URI > URI : https://github.com/dhowe/RiTranslate.git 
3. Note: depending on your language, you may need to set your Eclipse editor to use the UTF8 character set: Window > Preferences > General > Workspace :: Text file encoding
4. To run the tests, navigate to src/test/java/GoogleTranslateTest.java in the package-explorer, then right-click and select  Run As > JUnit Test

<br>

---

Sponsored in part by a [Teaching Development Grant](http://www.cityu.edu.hk/edge/grant/tdg/) from the City University of Hong Kong.