{"id":13650530,"url":"https://github.com/timio23/directus-operation-auto-translate","last_synced_at":"2025-04-09T00:30:35.332Z","repository":{"id":191749353,"uuid":"685314698","full_name":"timio23/directus-operation-auto-translate","owner":"timio23","description":"Use ChatGPT language models to automatically translate your content through Directus Flows!","archived":false,"fork":false,"pushed_at":"2023-09-02T19:13:14.000Z","size":215,"stargazers_count":38,"open_issues_count":2,"forks_count":3,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-04-07T08:52:12.821Z","etag":null,"topics":["directus","directus-ai-hackathon"],"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/timio23.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":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2023-08-31T00:54:45.000Z","updated_at":"2024-04-14T17:56:07.757Z","dependencies_parsed_at":null,"dependency_job_id":"6d7d7b98-331b-4eef-b866-fec53dae0987","html_url":"https://github.com/timio23/directus-operation-auto-translate","commit_stats":null,"previous_names":["timio23/directus-operation-auto-translate"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timio23%2Fdirectus-operation-auto-translate","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timio23%2Fdirectus-operation-auto-translate/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timio23%2Fdirectus-operation-auto-translate/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timio23%2Fdirectus-operation-auto-translate/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/timio23","download_url":"https://codeload.github.com/timio23/directus-operation-auto-translate/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247949655,"owners_count":21023362,"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":["directus","directus-ai-hackathon"],"created_at":"2024-08-02T02:00:37.580Z","updated_at":"2025-04-09T00:30:34.922Z","avatar_url":"https://github.com/timio23.png","language":"JavaScript","funding_links":[],"categories":["Extensions"],"sub_categories":["Community"],"readme":"# OpenAI Automatic Translation\n\nUse ChatGPT language models to automatically translate your content through Directus Flows!\n\n## Details\n\n- This extension will solve the issue of poor translations by utilizing the OpenAI language models to more accurately translate your content in the absense of multi-lingual staff.\n- Uses the OpenAI library to simplify the API interaction.\n- This extention is known as an operation which is part of Flows. This allows this functionality to be customized to suit the majority of use cases.\n- Given more time, I would branch out to other AI translation models and include notifications once the translations are complete.\n\n## Requirements\n\n- OpenAI API key with credits [OpenAI.com](https://platform.openai.com)\n- Create a collection with a translation field\n- Make note of the collections that are created. Usually *languages* and *\u003ccollection name\u003e_translations*\n\n## How to use this Operation\n\n1. Add this extension into the project's extensions/operations folder\n2. Update your project's environment file with the following:\n```javascript\nOPENAI_API_KEY=\"sk-XXXXXXXXXXXXXXXXXXX\"\nOPENAI_RATE_LIMIT=\"21000\"\n```\nThe rate limit is in ms. By default ChatGPT limits free trial accounts to 3 API calls per minute. Setting this to 21000 (21 seconds) ensures this limit is not reached.\n\n3. Start/Restart Directus\n4. Create a new Flow with an Event trigger for your collection. I recommend using the item.create event\n5. Add a new operation to your flow and choose OpanAI Auto Translate\n6. Set the item ID to {{$trigger.key}} and collection to {{$trigger.collection}} \n7. Choose the translations collection and languages collection from the list, then Save and close the Flow\n8. Create a new item and wait a couple minutes (depending on your rate limit)\n\n## Screenshots\n\nThis is how it appears in the list of Operations when adding to a Flow.\n![Operation in the list](./screenshots/Screenshot-06.webp)\n\nFlow using this Operation\n![Create Flows](./screenshots/Screenshot-02.webp)\n\nExample of the operation settings\n![Operation Settings](./screenshots/Screenshot-03.webp)\n\nCreating a new item in the collection\n![New Item](./screenshots/Screenshot-01.webp)\n\nAfter a few minutes, opened the item and clicked the language dropdown. The progress bar for each translation is complete.\n![Translation Progress](./screenshots/Screenshot-04.webp)\n\nExample of the Russian translation performed by ChatGPT 3.5 Turbo\n![Russian Translation](./screenshots/Screenshot-05.webp)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftimio23%2Fdirectus-operation-auto-translate","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftimio23%2Fdirectus-operation-auto-translate","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftimio23%2Fdirectus-operation-auto-translate/lists"}