Is there any other translation java API?

Discussion in 'Spigot Plugin Development' started by Kyllian, Apr 30, 2017.

  1. Hey, I was experimenting with the google translator API. Tried everything I could. But it just didn't work, Then I saw this:

    [​IMG]

    I was like omfg... It costs money to use their API. But you can get a 300$ trial. But that isn't practical at all (Is it?) because you need to enter your credit card/other data.

    But all the translation API's are from google. So is there a better way?
     
  2. Can't you do a get request on the url without using the API, like so: https://translate.googleapis.com/translate_a/single?client=gtx&sl=en&tl=nl&dt=t&q=This+is+a+test. I don't think it's protected whatsoever. This request will return a json with this response:

    Code (Text):
    [
      [
        [
          "Dit is een test",
          "This is a test",
          null,
          null,
          1
        ]
      ],
      null,
      "en"
    ]
    These are the get parameters to use:
    • sl source language
    • tl target language
    • q search query; string to translate
     
    • Like Like x 1
  3. I can't do JSON yet :3
     
  4. Why can't you?
    One time you are probably going to need it anyway, why wait?
     
    #4 Spoch, Apr 30, 2017
    Last edited: Apr 30, 2017
  5. Mas

    Mas

    Then learn it :p
    Google's Gson is packaged with Spigot, so it won't be hard to learn.