{"id":25580379,"url":"https://github.com/tderflinger/remark-translate","last_synced_at":"2026-04-14T06:04:38.256Z","repository":{"id":57749526,"uuid":"523283739","full_name":"tderflinger/remark-translate","owner":"tderflinger","description":"A simple plugin for remark to translate markdown text to other languages.","archived":false,"fork":false,"pushed_at":"2022-08-14T12:31:08.000Z","size":123,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-07T12:43:23.401Z","etag":null,"topics":["javascript","languages","markdown","node","remark","unified"],"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/tderflinger.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":"2022-08-10T09:38:26.000Z","updated_at":"2022-08-12T10:56:28.000Z","dependencies_parsed_at":"2022-08-26T23:21:41.550Z","dependency_job_id":null,"html_url":"https://github.com/tderflinger/remark-translate","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tderflinger%2Fremark-translate","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tderflinger%2Fremark-translate/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tderflinger%2Fremark-translate/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tderflinger%2Fremark-translate/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tderflinger","download_url":"https://codeload.github.com/tderflinger/remark-translate/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239428052,"owners_count":19636881,"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":["javascript","languages","markdown","node","remark","unified"],"created_at":"2025-02-21T04:15:50.920Z","updated_at":"2026-03-30T21:30:17.717Z","avatar_url":"https://github.com/tderflinger.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"![remark-translate logo](./assets/svg/logo-new.svg)\n\n[![npm](https://img.shields.io/npm/l/remark-translate)](https://www.npmjs.com/package/remark-translate)\n\n**Remark-translate** is a simple plugin for remark to translate markdown text to other languages. It uses the\ntranslation API of [DeepL](https://www.deepl.com/).\n\nIn order to use this plugin, you need to create an API key and register with DeepL.\n\nNote: This is the first version of `remark-translate`, so please give feedback if you find any bugs.\n\n## Installation\n\n```bash\nnpm install remark-translate\n```\n\n## Usage\n\nYou need to pass an `options` object to the plugin in order to use it.\n\nThese are the options:\n\n- sourceLang: the language of the source markdown text\n- destLang: the language of the translated text\n- apiKey: the DeepL API token\n- yamlTranslate (optional): array with the yaml frontmatter keys to be translated\n\nFor security, the API key is not displayed in the source code but used from the environment\nvariable `DEEPL_API_KEY`.\n\nThis is an example for translating markdown text from English to Spanish:\n\n```js\nconst authKey = process.env.DEEPL_KEY;\nconst options = { sourceLang: 'en', destLang: 'es', apiKey: authKey, yamlTranslate: [\"title\", \"description\"] };\n\nconst file = await unified()\n    .use(remarkParse)\n    .use(remarkStringify)\n    .use(remarkFrontmatter, ['yaml'])\n    .use(remarkTranslate, options)\n    .process(data);\n```\n\nNote that any yaml frontmatter fields as defined in `yamlTranslate` options are also translated.\n\nThis library is ESM only, meaning you cannot import it using `require` in a Node application. Therefore, you need\nat a minimum a Node version that supports ESMs.\n\n## Testing\n\nYou can test the plugin by running the following command:\n\n```bash\nnpm run test\n```\n\n## Todos\n\nCurrently, the best results are with pure text paragraphs without any additional markdown elements like links or emphasis.\nThese markdown elements influence the whole sentence translation because they are currently translated independently.\n\nI hope to fix this in the future.\n\nAlso, I hope to add other translation providers like AWS Translate in the future.\n\n## References\n\n- Unified: https://github.com/unifiedjs\n- Remark: https://remark.js.org\n- DeepL: https://www.deepl.com\n- js-yaml: https://github.com/nodeca/js-yaml\n\n## License\n\nMIT License","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftderflinger%2Fremark-translate","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftderflinger%2Fremark-translate","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftderflinger%2Fremark-translate/lists"}