commit | 9d6144ab634f74f3cd480acc34e36ee1b5a2cc39 | [log] [tgz] |
---|---|---|
author | Kartik Mistry <[email protected]> | Mon Dec 02 10:35:12 2024 +0530 |
committer | jenkins-bot <[email protected]> | Tue Dec 10 13:23:49 2024 +0000 |
tree | f4ed9e7b491e0fbe24148c5637acc680ee9cff34 | |
parent | afc2bdc313ddf7c826905d42eb194f77e6766704 [diff] |
Enable support for Google MT for 11 Wikipedias (June 2024) Bug: T369815 Change-Id: Ic71af39081689d1bde63b168f7d4605c6b6850a4
ContentTranslation is a tool that allows editors to translate pages from one language to another with the help of machine translation and other translation tools.
This is the server component of ContentTranslation.
Install the dependencies:
$ npm install
npm start
Then browse to http://localhost:8080/v2
An default configuration file is given as config.dev.yaml. Copy it to config.yaml to customize. Restart server to read changes.
To know more about registry configuration, see doc/Registry.md
npm run dev
This will run the application in hot reload mode. It means, your code changes will be immediately reflected in the running server.
This will also enable nodejs debugging in port 9229. To debug in Chrome dev tools, launch chrome://inspect/
in Chrome browser. You will see a remote target listed there, corresponding to cxserver.
If you are using an IDE like VS Code, it can connect to this debugging port and you can debug directly from your IDE. From 'Debug' menu, select 'attach'. Note that your launch configuration should look like as follows. The remoteRoot
is important
{ "version": "0.2.0", "configurations": [ { "type": "node", "request": "attach", "name": "Attach", "port": 9229, "localRoot": "${workspaceRoot}/", "remoteRoot": "/usr/src/app/" }, { "type": "node", "request": "launch", "name": "Launch Program", "program": "${workspaceFolder}/app.js" } ] }
If you are familiar with Docker, this application can be developed easily using docker. From the cxserver directory, run this command once to install dependencies
docker-compose run cxserver npm install
Then
docker-compose up
This will start the cxserver in port 4000 (configurable by editing docker-compose.yaml) and you can launch the browser to localhost:4000/v2. This will also include hot reloading of your source code changes and opening up the debugger port as explained above.
To run the tests:
npm test