-
Notifications
You must be signed in to change notification settings - Fork 603
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs: generate new samples/README.md, README.md (#268)
* Add README with instructions to run v3 translate * Remove extra blank line * docs: generate new samples/README.md, README.md * docs: finish porting over changes to samples/README.md * docs: add issue tracker link * chore: address code review * Move region tag
- Loading branch information
Showing
9 changed files
with
214 additions
and
221 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
title: |- | ||
The [Cloud Translation API](https://cloud.google.com/translate/docs/), | ||
can dynamically translate text between thousands | ||
of language pairs. The Cloud Translation API lets websites and programs | ||
integrate with the translation service programmatically. The Cloud Translation | ||
API is part of the larger Cloud Machine Learning API family. | ||
samples_body: |- | ||
### Translate V3 Beta Samples | ||
#### Install Dependencies | ||
From the [root directory](https://github.com/googleapis/nodejs-translate) of the client library install the dependencies: | ||
``` | ||
npm install | ||
``` | ||
Change to the samples directory, link the google-cloud/translate library from the parent, and install its dependencies: | ||
``` | ||
cd samples/ | ||
npm link ../ | ||
npm install | ||
``` | ||
#### Run the Tests | ||
To run the tests for the entire sample, run | ||
``` | ||
npm test | ||
``` | ||
To run the tests for only the translate v3 samples, run | ||
``` | ||
npm run test-v3 | ||
``` | ||
To run the tests for a single translate v3 sample, run this command, substituting FILE_NAME with the name of a valid test file. | ||
``` | ||
./node_modules/.bin/mocha test/v3beta1/FILE_NAME | ||
``` | ||
For example, to test the `translate_list_language_names_beta` sample, the command would be | ||
``` | ||
./node_modules/.bin/mocha test/v3beta1/translate_list_language_names_beta.test.js | ||
``` | ||
To run a sample directly, call the file with the `node` command and any required CLI arguments: | ||
``` | ||
node v3beta1/FILE_NAME <CLI argument 0> <CLI argument 1> | ||
``` | ||
For example, to run the `translate_list_codes_beta` sample, you would run the following command, substituting your project ID in place of "your_project_id" | ||
``` | ||
node v3beta1/translate_list_codes_beta.js "your_project_id" | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{ | ||
"name": "translate", | ||
"name_pretty": "Cloud Translation", | ||
"product_documentation": "https://cloud.google.com/translate/docs/", | ||
"client_documentation": "https://cloud.google.com/nodejs/docs/reference/translate/latest/", | ||
"issue_tracker": "https://issuetracker.google.com/savedsearches/559749", | ||
"release_level": "ga", | ||
"language": "nodejs", | ||
"repo": "googleapis/nodejs-translate", | ||
"distribution_name": "@google-cloud/translate", | ||
"api_id": "translate.googleapis.com", | ||
"requires_billing": true | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.