forked from googleapis/nodejs-translate
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.readme-partials.yml
62 lines (44 loc) · 1.69 KB
/
.readme-partials.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
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"
```