{"id":21147825,"url":"https://github.com/siamahnaf/google-translate-nodejs","last_synced_at":"2026-02-04T03:33:08.311Z","repository":{"id":219303223,"uuid":"748726119","full_name":"siamahnaf/google-translate-nodejs","owner":"siamahnaf","description":"A Node.js package for translating text using Google Translate for free, with support for batching translation, involves several steps. Below is a detailed guide on how you can achieve this using the google-translate-nodejs package.","archived":false,"fork":false,"pushed_at":"2024-09-17T13:14:50.000Z","size":11,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-11-07T07:46:48.458Z","etag":null,"topics":["google","google-translate","google-translate-nodejs","ndoejs"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/google-translate-nodejs","language":"TypeScript","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/siamahnaf.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,"publiccode":null,"codemeta":null}},"created_at":"2024-01-26T16:23:26.000Z","updated_at":"2024-09-17T13:14:53.000Z","dependencies_parsed_at":"2024-09-17T16:30:58.871Z","dependency_job_id":null,"html_url":"https://github.com/siamahnaf/google-translate-nodejs","commit_stats":{"total_commits":4,"total_committers":1,"mean_commits":4.0,"dds":0.0,"last_synced_commit":"deabcba8ea13fba5c9b1ba95ceb294f0936cdfe9"},"previous_names":["siamahnaf/google-translate-nodejs"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/siamahnaf%2Fgoogle-translate-nodejs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/siamahnaf%2Fgoogle-translate-nodejs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/siamahnaf%2Fgoogle-translate-nodejs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/siamahnaf%2Fgoogle-translate-nodejs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/siamahnaf","download_url":"https://codeload.github.com/siamahnaf/google-translate-nodejs/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225083705,"owners_count":17418343,"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":["google","google-translate","google-translate-nodejs","ndoejs"],"created_at":"2024-11-20T09:18:46.166Z","updated_at":"2026-02-04T03:33:08.284Z","avatar_url":"https://github.com/siamahnaf.png","language":"TypeScript","funding_links":["https://www.buymeacoffee.com/siamahnaf"],"categories":[],"sub_categories":[],"readme":"\u003cpicture\u003e\n  \u003csource media=\"(prefers-color-scheme: dark)\" srcset=\"https://raw.githubusercontent.com/siamahnaf/assets-kit/main/logo/logo-white.png\"\u003e\n  \u003csource media=\"(prefers-color-scheme: light)\" srcset=\"https://raw.githubusercontent.com/siamahnaf/assets-kit/main/logo/logo-black.png\"\u003e\n  \u003cimg alt=\"Siam Ahnaf\" src=\"https://raw.githubusercontent.com/siamahnaf/assets-kit/main/logo/logo-black.png\" height=\"auto\" width=\"240\"\u003e\n\u003c/picture\u003e\n\n# Google Translate Nodejs\nA nodejs package for translating text using google translate for free! It also support batching translation!\n\n## Introduction\n\nA Node.js package for translating text using Google Translate for free, with support for batching translation, involves several steps. Below is a detailed guide on how you can achieve this using the google-translate-nodejs package.\n\n## Support Me\n\n\u003ca href=\"https://www.buymeacoffee.com/siamahnaf\" target=\"_blank\"\u003e\u003cimg src=\"https://cdn.buymeacoffee.com/buttons/v2/default-yellow.png\" alt=\"Buy Me A Coffee\" style=\"height: 60px !important;width: 217px !important;\" \u003e\u003c/a\u003e\n\n\n## Features\n\n- Fast and lightweight\n- Batching translation. You can translate one text to many target language at a time.\n- No unnecessary Dependencies\n- Now Multi translation is supported. You can translate a object into multiple languages\n- Small in Size (16KB)\n\n## Installing\n\nUsing npm\n\n```bash\n$ npm install google-translate-nodejs\n```\n\n## Batch Translation Example\n\n```bash\nimport { translate } from \"google-translate-nodejs\";\n\nconst { data } = await translate.batch(\"How are you\", [\"bn\", \"fr\", \"en\", \"es\", \"de\", \"ar\", \"ja\", \"ko\", \"ru\", \"pt\", \"it\", \"hi\", \"zh\", \"tr\", \"nl\", \"sv\", \"pl\", \"vi\", \"th\"]\n        );\nconsole.log(data);\n\n//And result will be printed like-\n\n{\n  source: { lan: 'auto', text: 'How are you' },\n  target: [\n    { lan: 'bn', text: 'আপনি কেমন আছেন' },\n    { lan: 'fr', text: 'Comment vas-tu' },\n    { lan: 'en', text: 'How are you' },\n    { lan: 'es', text: 'Cómo estás' },\n    { lan: 'de', text: 'Wie geht es dir' },\n    { lan: 'ar', text: 'كيف حالك' },\n    { lan: 'ja', text: '元気ですか' },\n    { lan: 'ko', text: '어떻게 지내세요' },\n    { lan: 'ru', text: 'Как вы' },\n    { lan: 'pt', text: 'Como vai' },\n    { lan: 'it', text: 'Come stai' },\n    { lan: 'hi', text: 'आप कैसे हैं?' },\n    { lan: 'zh', text: '你好吗' },\n    { lan: 'tr', text: 'Nasılsın' },\n    { lan: 'nl', text: 'Hoe is het' },\n    { lan: 'sv', text: 'Hur mår du' },\n    { lan: 'pl', text: 'Jak się masz' },\n    { lan: 'vi', text: 'Bạn có khỏe không' },\n    { lan: 'th', text: 'คุณเป็นอย่างไร' }\n  ]\n}\n\n//For typescript you can import Response Types also-\nimport { BatchResponse } from \"google-translate-nodejs\";\n```\n\n## API For Batch Translations-\n\n### translate.batch(text, targetLanguages, options)\n\n#### text\n- Type: `String`\n- Description: The main text which need to be translated\n\n#### targetLanuages\n- Type: `String[]` `(String array)`\n- Description: A array of string with lanuage code\n\n#### options\n- Type: `Object`\n- Description: Options Object (Optional)\n\n##### from\n- Type: `String`\n- Description: From Language\n- Default: `auto`\n\n\n## Single Translation Example\n\n```bash\nimport { translate } from \"google-translate-nodejs\";\n\nconst { data } = await translate.single(\"How are you\", \"fr\");\nconsole.log(data);\n\n//And result will be printed like-\n{\n  source: { lan: 'auto', text: 'How are you?' },\n  target: { lan: 'fr', text: 'Comment vas-tu?' }\n}\n\n//For typescript you can import Response Types also-\nimport { SingleResponse } from \"google-translate-nodejs\";\n```\n\n## API For Single Translations-\n\n### translate.single(text, targetLanguage, options)\n\n#### text\n- Type: `String`\n- Description: The main text which need to be translated\n\n#### targetLanguage\n- Type: `String`\n- Description: The target language code\n\n#### options\n- Type: `Object`\n- Description: Options Object (Optional)\n\n##### from\n- Type: `String`\n- Description: From Language\n- Default: `auto`\n\n\n## Multi Translation Example\n\n```bash\nimport { translate } from \"google-translate-nodejs\";\nconst text = {\n  title: \"How are you?\",\n  description: \"Here's a collection of news, notes, and highlights from Wednesday's on-field action.\",\n  otherText: \"Other text\"\n}\nconst target = [\"bn\", \"fr\", \"es\", \"ar\", \"de\"]\nconst { data } = await translate.multi(text, target);\nconsole.log(data);\n\n//And result will be printed like-\n{\n  source: { lan: 'auto' },\n  target: [\n    {\n      languageCode: 'bn',\n      title: 'আপনি কেমন আছেন?',\n      description: 'এখানে বুধবারের মাঠের অ্যাকশন থেকে খবর, নোট এবং হাইলাইটগুলির একটি সংগ্রহ রয়েছে৷',\n      otherText: 'অন্যান্য পাঠ্য'\n    },\n    {\n      languageCode: 'fr',\n      title: 'Comment vas-tu?',\n      description: \"Voici une collection d'actualités, de notes et de faits saillants de l'action sur le terrain de mercredi.\",\n      otherText: 'Autre texte'\n    },\n    {\n      languageCode: 'es',\n      title: '¿Cómo estás?',\n      description: 'Aquí hay una colección de noticias, notas y momentos destacados de la acción en el campo del miércoles.',\n      otherText: 'Otro texto'\n    },\n    {\n      languageCode: 'ar',\n      title: 'كيف حالك؟',\n      description: 'فيما يلي مجموعة من الأخبار والملاحظات والأحداث البارزة من الأحداث الميدانية يوم الأربعاء.',\n      otherText: 'نص آخر'\n    },\n    {\n      languageCode: 'de',\n      title: 'Wie geht es dir?',\n      description: 'Hier finden Sie eine Sammlung von Neuigkeiten, Notizen und Highlights vom Spielfeldeinsatz am Mittwoch.',\n      otherText: 'Anderer Text'\n    }\n  ]\n}\n\n//For typescript you can import Response Types also-\nimport { MultiResponse } from \"google-translate-nodejs\";\n```\n\n## API For Single Translations-\n\n### translate.multi(textObject, targetLanguages, options)\n\n#### text\n- Type: `Object`\n- Description: The main text which need to be translated. It can be any object.\n\n#### targetLanguages\n- Type: `String[]`\n- Description: The target languages code. Array of string.\n\n#### options\n- Type: `Object`\n- Description: Options Object (Optional)\n\n##### from\n- Type: `String`\n- Description: From Language\n- Default: `auto`\n\n\n## Issues or correction\nIf you face any issues to any function, please let me know by creating a issue on github.\n\n## Connect with me\n\u003cdiv style=\"display: flex; align-items: center; gap: 3px;\"\u003e\n\u003ca href=\"https://wa.me/8801611994403\"\u003e\u003cimg src=\"https://raw.githubusercontent.com/siamahnaf/assets-kit/main/icons/whatsapp.png\" width=\"40\" height=\"40\"\u003e\u003c/a\u003e\n\u003ca href=\"https://siamahnaf.com/\" style=\"margin-right: 8px\"\u003e\u003cimg src=\"https://raw.githubusercontent.com/siamahnaf/assets-kit/main/icons/web.png\" width=\"40\" height=\"40\"\u003e\u003c/a\u003e\n\u003ca href=\"https://www.linkedin.com/in/siamahnaf/\" style=\"margin-right: 8px\"\u003e\u003cimg src=\"https://raw.githubusercontent.com/siamahnaf/assets-kit/main/icons/linkedin.png\" width=\"40\" height=\"40\"\u003e\u003c/a\u003e\n\u003ca href=\"https://x.com/siamahnaf198\" style=\"margin-right: 8px\"\u003e\u003cimg src=\"https://raw.githubusercontent.com/siamahnaf/assets-kit/main/icons/x.png\" width=\"40\" height=\"40\"\u003e\u003c/a\u003e\n\u003ca href=\"https://www.facebook.com/siamahnaf198/\" style=\"margin-right: 8px\"\u003e\u003cimg src=\"https://raw.githubusercontent.com/siamahnaf/assets-kit/main/icons/facebook.png\" width=\"40\" height=\"40\"\u003e\u003c/a\u003e\n\u003ca href=\"https://t.me/siamahnaf198\" style=\"margin-right: 8px\"\u003e\u003cimg src=\"https://raw.githubusercontent.com/siamahnaf/assets-kit/main/icons/telegram.png\" width=\"40\" height=\"40\"\u003e\u003c/a\u003e\n\u003ca href=\"https://www.npmjs.com/~siamahnaf\" style=\"margin-right: 8px\"\u003e\u003cimg src=\"https://raw.githubusercontent.com/siamahnaf/assets-kit/main/icons/npm.png\" width=\"40\" height=\"40\"\u003e\u003c/a\u003e\n\u003c/div\u003e\n\n\n------------\n\n\u003cp align=\"center\" color=\"red\"\u003e\u003ca href=\"https://www.siamahnaf.com/\"\u003ewww.siamahnaf.com\u003c/a\u003e\u003c/p\u003e","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsiamahnaf%2Fgoogle-translate-nodejs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsiamahnaf%2Fgoogle-translate-nodejs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsiamahnaf%2Fgoogle-translate-nodejs/lists"}