@@ -25,6 +25,62 @@ API is part of the larger Cloud Machine Learning API family. Samples
2525Before running the samples, make sure you've followed the steps outlined in
2626[ Using the client library] ( https://github.com/googleapis/nodejs-translate#using-the-client-library ) .
2727
28+ ### Translate V3 Beta Samples
29+
30+ #### Install Dependencies
31+
32+ From the [ root directory] ( https://github.com/googleapis/nodejs-translate ) of the client library install the dependencies:
33+
34+ ```
35+ npm install
36+ ```
37+
38+ Change to the samples directory, link the google-cloud/translate library from the parent, and install its dependencies:
39+
40+ ```
41+ cd samples/
42+ npm link ../
43+ npm install
44+ ```
45+
46+ #### Run the Tests
47+
48+ To run the tests for the entire sample, run
49+
50+ ```
51+ npm test
52+ ```
53+
54+ To run the tests for only the translate v3 samples, run
55+
56+ ```
57+ npm run test-v3
58+ ```
59+
60+ To run the tests for a single translate v3 sample, run this command, substituting FILE_NAME with the name of a valid test file.
61+
62+ ```
63+ ./node_modules/.bin/mocha test/v3beta1/FILE_NAME
64+ ```
65+
66+ For example, to test the ` translate_list_language_names_beta ` sample, the command would be
67+
68+ ```
69+ ./node_modules/.bin/mocha test/v3beta1/translate_list_language_names_beta.test.js
70+ ```
71+
72+ To run a sample directly, call the file with the ` node ` command and any required CLI arguments:
73+
74+ ```
75+ node v3beta1/FILE_NAME <CLI argument 0> <CLI argument 1>
76+ ```
77+
78+ 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"
79+
80+ ```
81+ node v3beta1/translate_list_codes_beta.js "your_project_id"
82+ ```
83+
2884## Samples
2985
3086
0 commit comments