{"id":22407505,"url":"https://github.com/imlinhanchao/translate-platforms","last_synced_at":"2025-07-31T19:31:37.785Z","repository":{"id":48316721,"uuid":"251477633","full_name":"imlinhanchao/translate-platforms","owner":"imlinhanchao","description":"Translation API from multiple platforms.","archived":false,"fork":false,"pushed_at":"2021-07-29T05:05:51.000Z","size":42,"stargazers_count":22,"open_issues_count":2,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-06-24T12:17:40.996Z","etag":null,"topics":["api","baidu","google","microsoft","translate","youdao"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/translate-platforms","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/imlinhanchao.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}},"created_at":"2020-03-31T02:13:16.000Z","updated_at":"2023-04-08T01:22:41.000Z","dependencies_parsed_at":"2022-09-02T20:41:30.451Z","dependency_job_id":null,"html_url":"https://github.com/imlinhanchao/translate-platforms","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/imlinhanchao/translate-platforms","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imlinhanchao%2Ftranslate-platforms","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imlinhanchao%2Ftranslate-platforms/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imlinhanchao%2Ftranslate-platforms/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imlinhanchao%2Ftranslate-platforms/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/imlinhanchao","download_url":"https://codeload.github.com/imlinhanchao/translate-platforms/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imlinhanchao%2Ftranslate-platforms/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267586047,"owners_count":24111587,"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","status":"online","status_checked_at":"2025-07-28T02:00:09.689Z","response_time":68,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["api","baidu","google","microsoft","translate","youdao"],"created_at":"2024-12-05T11:14:36.583Z","updated_at":"2025-07-31T19:31:37.486Z","avatar_url":"https://github.com/imlinhanchao.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Translate Platforms\nA Node module to translate words by multiple platforms.\n\n## Installation\n```bash\nnpm install translate-platforms\n```\n\n## Usage\n\n```javascript\nconst { google, microsoft, youdao, baidu } = require('translate-platforms');\n// async/await. The second parameter can be a language name (ISO 639-1)\nconst result = await google('Hello world', { to: google.ja });\nconsole.log(result); \n// Output:\n// {\n//     lang: { from: 'en', to: 'ja' },\n//     word: 'Hello world', \n//     text: 'こんにちは世界', \n//     candidate: [ 'こんにちは世界', 'こんにちは' ] \n// }\n \n// Promises with .then(). The third parameter is the source language.\nmicrosoft('こんにちは世界', { to: microsoft.zh }).then(result =\u003e {\n  console.log(result);  \n  // Output:\n  // { \n  //     lang: { from: 'ja', to: 'zh' },\n  //     word: 'こんにちは世界', \n  //     text: '你好世界', \n  //     candidate: [ ] \n  // }\n});\n```\n\n## Parameters\n\n```typescript\nfunction translate(word: string, language: { from: string, to: string }): object\n```\n\n|parameter|description|\n|--|--|\n|word|The word want to translate.|\n|from|The source language. Default is recognized automatically(`auto`). (Optional)|\n|to|The target language. Default is Chinese(`zh`). (Optional)|\n\n### Return Object\n|key|description|\n|--|--|\n|lang|The source language and target language.|\n|word|The word want to translate.|\n|text|The most match result.|\n|candidate|Other translate result.|\n\n## Language Code\nEach platform supports different translation languages. You can check the interface function properties.\n\n## Support Platform\nSupported platforms are [Google](http://translate.google.com/), [Microsoft](https://docs.microsoft.com/en-us/azure/cognitive-services/translator/reference/v3-0-translate), [Yandex](https://translate.yandex.com/), [Baidu](https://fanyi.baidu.com/), [Tencent](https://fanyi.qq.com/) and [Youdao](http://fanyi.youdao.com/).\n\n## Notice\nTencent does not support mutual translation of all languages, you can use the `support` function to get the translation language supported by the language.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fimlinhanchao%2Ftranslate-platforms","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fimlinhanchao%2Ftranslate-platforms","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fimlinhanchao%2Ftranslate-platforms/lists"}