{"id":19622218,"url":"https://github.com/commercetools/connect-product-translator","last_synced_at":"2025-07-20T16:03:22.248Z","repository":{"id":216324491,"uuid":"721060625","full_name":"commercetools/connect-product-translator","owner":"commercetools","description":"OpenAI based composable commerce product data translations","archived":false,"fork":false,"pushed_at":"2024-06-21T09:35:16.000Z","size":559,"stargazers_count":1,"open_issues_count":2,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-07-18T05:09:20.035Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/commercetools.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-11-20T09:25:55.000Z","updated_at":"2024-03-19T11:55:22.000Z","dependencies_parsed_at":"2024-01-09T16:51:07.512Z","dependency_job_id":"be8abcaf-663a-47c1-9f9e-f05420b619fa","html_url":"https://github.com/commercetools/connect-product-translator","commit_stats":null,"previous_names":["commercetools/connect-product-translator"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/commercetools/connect-product-translator","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/commercetools%2Fconnect-product-translator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/commercetools%2Fconnect-product-translator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/commercetools%2Fconnect-product-translator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/commercetools%2Fconnect-product-translator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/commercetools","download_url":"https://codeload.github.com/commercetools/connect-product-translator/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/commercetools%2Fconnect-product-translator/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266152253,"owners_count":23884473,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-11T11:26:42.516Z","updated_at":"2025-07-20T16:03:22.224Z","avatar_url":"https://github.com/commercetools.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# connect-product-translator\nThis is a connect application which aims at translating localized texts of a specific product and its variants into different languages supported by composable commerce project. The translation is powered by [OpenAI](https://openai.com/).\n\nThis connector uses the [Product type](https://docs.commercetools.com/api/projects/productTypes), [Product](https://docs.commercetools.com/api/projects/products) and  [State](https://docs.commercetools.com/api/projects/states) data models from composable commerce which can be used for translating various texts and variant attributes of a product when specific state of the product is set. Connector is based on asynchronous [Subscriptions](https://docs.commercetools.com/api/projects/subscriptions) to run the translation process.\n\n## Connector Features\n- NodeJS supported.\n- Uses Express as web server framework.\n- Uses [commercetools SDK](https://docs.commercetools.com/sdk/js-sdk-getting-started) for the commercetools-specific communication.\n- Includes local development utilities in npm commands to build, start, test, lint \u0026 prettify code.\n- Uses JSON formatted logger with log levels\n\n## Prerequisite\n#### 1. commercetools composable commerce API client\nUsers are expected to create API client responsible for changing state, fetching product type, fetching and updating product from composable commerce project. API client should have enough scope to be able to do so. These API client details are taken as input as an environment variable/ configuration for connect. Details of compsable commerce project can be provided as environment variables (configuration for connect) `CTP_PROJECT_KEY` , `CTP_CLIENT_ID`, `CTP_CLIENT_SECRET`, `CTP_SCOPE`, `CTP_REGION`. For details, please read [Deployment Configuration](./README.md#Deployment Configuration).\n\n#### 2. commercetools composable commerce language setup\nUsers are expected to define the languages supported in the composable commerce project.\n\n#### 3. commercetools composable commerce product details initialization\nUsers are expected to fill in the text values in the product and its variant attributes with default language. The connect application defines the source language for translation by adapting the language with non-empty value in product name. For example, if product details are required to translate from English to all other languages, product name needs to be defined in `en-GB` locale. \n\n#### 4. external system\nUsers are expected to provide API token in OpenAI. Those details are taken as input as an environment variable / configuration for connect. The API token of OpenAI can be provided as environment variables (configuration for connect) `OPENAI_API_KEY`.For details, please read [Deployment Configuration](./README.md#Deployment Configuration).\n\n \n## Getting started\nThe connect application contains one event-driven module : \n- Product Translator : Receives message from commercetools project once the state of a specific product is set as 'Request Translation'. The localized texts of the product are then translated into different languages supported by the project.\n\nRegarding the development of this module, please refer to the following documentation:\n- Development of Product Translator\n\n#### Register as connector in commercetools Connect\nFollow guidelines [here](https://docs.commercetools.com/connect/getting-started) to register the connector for public/private use.\n\n## Deployment Configuration\nIn order to deploy your customized connector application on commercetools Connect, it needs to be published. For details, please refer to [documentation about commercetools Connect](https://docs.commercetools.com/connect/concepts)\nIn addition, in order to support connect, the search connector template has a folder structure as listed below\n```\n├── product-translator\n│   ├── src\n│   ├── test\n│   └── package.json\n└── connect.yaml\n```\n\nConnect deployment configuration is specified in `connect.yaml` which is required information needed for publishing of the application. Following is the deployment configuration used by full ingestion and incremental updater modules\n```\ndeployAs:\n  - name: product-translator\n    applicationType: event\n    endpoint: /productTranslator\n    scripts:\n      postDeploy: npm install \u0026\u0026 npm run connector:post-deploy\n      preUndeploy: npm install \u0026\u0026 npm run connector:pre-undeploy\n    configuration:\n      standardConfiguration:\n        - key: CTP_REGION\n          description: commercetools Composable Commerce API region\n      securedConfiguration:\n        - key: CTP_PROJECT_KEY\n          description: commercetools Composable Commerce project key\n        - key: CTP_CLIENT_ID\n          description: commercetools Composable Commerce client ID\n        - key: CTP_CLIENT_SECRET\n          description: commercetools Composable Commerce client secret\n        - key: CTP_SCOPE\n          description: commercetools Composable Commerce client scope\n        - key: OPENAI_API_KEY\n          description: API token used to communicate with OpenAI platform\n```\n\nHere you can see the details about various variables in configuration\n- CTP_PROJECT_KEY: The key of commercetools project.\n- CTP_CLIENT_ID: The client ID of your commercetools user account. It is used in commercetools client to communicate with commercetools platform via SDK.\n- CTP_CLIENT_SECRET: The client secret of commercetools user account. It is used in commercetools client to communicate with commercetools platform via SDK.\n- CTP_SCOPE: The scope constrains the endpoints to which the commercetools client has access, as well as the read/write access right to an endpoint.\n- CTP_REGION: As the commercetools APIs are provided in six different region, it defines the region which your commercetools user account belongs to.\n- OPENAI_API_KEY: It defines the API token which is used to communicate with OpenAI platform.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcommercetools%2Fconnect-product-translator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcommercetools%2Fconnect-product-translator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcommercetools%2Fconnect-product-translator/lists"}