If I pass a string (either in English or Arabic) as an input to the Google Translate API, it should translate it into the corresponding other language and give the translate
You can use Google Translate API v2 Java. It has a core module that you can call from your Java code and also a command line interface module.