# language-translator-nodejs **Repository Path**: qzone/language-translator-nodejs ## Basic Information - **Project Name**: language-translator-nodejs - **Description**: Sample Node.js Application for the IBM Language Translation Service - **Primary Language**: CSS - **License**: Apache-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2019-11-05 - **Last Updated**: 2020-12-19 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # Language Translator Node.js [![Build Status](https://travis-ci.org/watson-developer-cloud/language-translator-nodejs.svg?branch=master)](https://travis-ci.org/watson-developer-cloud/language-translator-nodejs) The IBM Watson™ [Language Translator][service_url] service provides an Application Programming Interface (API) that lets you identify the language of text, and then use a custom business domain to translate the text from one supported language to another. You can translate either by letting the service identify the source language or by selecting a source language and then by selecting a target language, and a business domain. Domain translation is linguistically targeted these business domains: * *The News domain* - targeted at news articles and transcripts, it translates English to and from Arabic, Brazilian Portuguese, French, Italian, or Spanish. It also translates Spanish to and from French. * *The Conversational domain* - targeted at conversational colloquialisms, it translates English to and from Arabic, Brazilian Portuguese, French, Italian, or Spanish. * *The Patent domain* - targeted at technical and legal terminology, it translates Brazilian Portuguese, Chinese, or Spanish to English. Give it a try! Click the button below to fork into IBM DevOps Services and deploy your own copy of this application on Bluemix. [![Deploy to Bluemix](https://bluemix.net/deploy/button.png)](https://bluemix.net/deploy?repository=https://github.com/watson-developer-cloud/language-translator-nodejs) ## Getting started 1. You need a Bluemix account. If you don't have one, [sign up][sign_up]. Experimental Watson Services are free to use. 1. Download and install the [Cloud-foundry CLI][cloud_foundry] tool if you haven't already. 1. Edit the `manifest.yml` file and change `` to something unique. The name you use determines the URL of your application. For example, `.mybluemix.net`. ``` applications: - services: - language-translator-service name: command: node app.js path: . memory: 128M ``` 1. Connect to Bluemix with the command line tool. ```sh $ cf api https://api.ng.bluemix.net $ cf login -u ``` 1. Create the Language Translator service in Bluemix. ```sh $ cf create-service language_translator standard language-translator-service ``` 1. Push your app to make it live: ```sh $ cf push ``` For details about developing applications that use Watson Developer Cloud services in Bluemix, see [Service credentials for Watson services][getting_started]. ## Running locally 1. Download and install [Node.js](http://nodejs.org/) and [npm](https://www.npmjs.com/). 1. Configure the code to connect to your service: 1. Copy the credentials from your `language-translator-service` service in Bluemix. Run the following command: ```sh $ cf env ``` Example output: ```sh System-Provided: { "VCAP_SERVICES": { "language_translator": [ { "credentials": { "password": "", "url": "", "username": "" } "label": "language-translator", "name": "language-translator-service", "plan": "standard", "tags": [ ... ] } ] } } ``` 1. Copy `username`, `password`, and `url` from the credentials. 1. Open the `app.js` file and paste the username, password, and url credentials for the service. 1. Save the `creds.js` file. 1. Install the Language Translator Node.js package: 1. Change to the new directory that contains the project. 2. Run the following command: ```node $ npm install ``` 1. Run the following command to start the application: ```node node app.js ``` 1. Point your browser to [http://localhost:3000](http://localhost:3000). ## Troubleshooting * The main source of troubleshooting and recovery information is the Bluemix log. To view the log, run the following command: ```sh $ cf logs --recent ``` * For more details about the service, see the [documentation][docs] for the Language Translator. ## License This sample code is licensed under Apache 2.0. Full license text is available in [LICENSE](LICENSE). This sample code is using jQuery which is licensed under MIT. This sample code is using bootstrap which is licensed under MIT. ## Contributing See [CONTRIBUTING](CONTRIBUTING.md). ## Open Source @ IBM Find more open source projects on the [IBM Github Page](http://ibm.github.io/) [cloud_foundry]: https://github.com/cloudfoundry/cli [service_url]: http://www.ibm.com/watson/developercloud/language-translator.html [getting_started]: https://www.ibm.com/watson/developercloud/doc/common/getting-started-credentials.html [sign_up]: https://console.ng.bluemix.net/registration/ [docs]: http://www.ibm.com/watson/developercloud/doc/language-translator/index.html