{"id":13725406,"url":"https://github.com/sindresorhus/transliterate","last_synced_at":"2026-01-08T21:16:54.868Z","repository":{"id":45652027,"uuid":"241100108","full_name":"sindresorhus/transliterate","owner":"sindresorhus","description":"Convert Unicode characters to Latin characters using transliteration","archived":false,"fork":false,"pushed_at":"2022-12-09T12:26:13.000Z","size":28,"stargazers_count":301,"open_issues_count":13,"forks_count":20,"subscribers_count":6,"default_branch":"main","last_synced_at":"2025-05-12T03:25:00.132Z","etag":null,"topics":["deburr","latinization","node-module","npm-package","string-conversion","transliteration","unicode","unicode-converter"],"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/sindresorhus.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":".github/funding.yml","license":"license","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":".github/security.md","support":null},"funding":{"github":"sindresorhus","open_collective":"sindresorhus","custom":"https://sindresorhus.com/donate"}},"created_at":"2020-02-17T12:17:38.000Z","updated_at":"2025-05-07T00:23:00.000Z","dependencies_parsed_at":"2023-01-25T13:30:30.323Z","dependency_job_id":null,"html_url":"https://github.com/sindresorhus/transliterate","commit_stats":null,"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sindresorhus%2Ftransliterate","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sindresorhus%2Ftransliterate/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sindresorhus%2Ftransliterate/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sindresorhus%2Ftransliterate/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sindresorhus","download_url":"https://codeload.github.com/sindresorhus/transliterate/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254464890,"owners_count":22075570,"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":["deburr","latinization","node-module","npm-package","string-conversion","transliteration","unicode","unicode-converter"],"created_at":"2024-08-03T01:02:22.125Z","updated_at":"2026-01-08T21:16:54.839Z","avatar_url":"https://github.com/sindresorhus.png","language":"JavaScript","funding_links":["https://github.com/sponsors/sindresorhus","https://opencollective.com/sindresorhus","https://sindresorhus.com/donate"],"categories":["JavaScript","Packages"],"sub_categories":["Other"],"readme":"# transliterate\n\n\u003e Convert Unicode characters to Latin characters using [transliteration](https://en.wikipedia.org/wiki/Transliteration)\n\nCan be useful for [slugification](https://github.com/sindresorhus/slugify) purposes and other times you cannot use Unicode.\n\n## Install\n\n```sh\nnpm install @sindresorhus/transliterate\n```\n\n## Usage\n\n```js\nimport transliterate from '@sindresorhus/transliterate';\n\ntransliterate('Fußgängerübergänge');\n//=\u003e 'Fussgaengeruebergaenge'\n\ntransliterate('Я люблю единорогов');\n//=\u003e 'Ya lyublyu edinorogov'\n\ntransliterate('أنا أحب حيدات');\n//=\u003e 'ana ahb hydat'\n\ntransliterate('tôi yêu những chú kỳ lân');\n//=\u003e 'toi yeu nhung chu ky lan'\n\ntransliterate('En–dashes and em—dashes are normalized');\n//=\u003e 'En-dashes and em-dashes are normalized'\n```\n\n## API\n\n### transliterate(string, options?)\n\n#### string\n\nType: `string`\n\nString to transliterate.\n\n#### options\n\nType: `object`\n\n##### customReplacements\n\nType: `Array\u003cstring[]\u003e | Map\u003cstring, string\u003e`\\\nDefault: `[]`\n\nAdd your own custom replacements.\n\nThe replacements are run on the original string before any other transformations.\n\nThis only overrides a default replacement if you set an item with the same key.\n\n```js\nimport transliterate from '@sindresorhus/transliterate';\n\ntransliterate('Я люблю единорогов', {\n\tcustomReplacements: [\n\t\t['единорогов', '🦄']\n\t]\n})\n//=\u003e 'Ya lyublyu 🦄'\n```\n\nYou can also pass a `Map`:\n\n```js\ntransliterate('foo \u0026 bar', {\n\tcustomReplacements: new Map([\n\t\t['\u0026', 'and']\n\t])\n})\n//=\u003e 'foo and bar'\n```\n\n##### locale\n\nType: `string`\n\n[BCP-47](https://developer.mozilla.org/en-US/docs/Glossary/BCP_47_language_tag) language tag for language-specific transliteration.\n\nWhen specified, uses language-specific replacement rules for characters that have different transliterations in different languages.\n\n```js\nimport transliterate from '@sindresorhus/transliterate';\n\n// Swedish: ä→a, ö→o, å→a\ntransliterate('Räksmörgås', {locale: 'sv'});\n//=\u003e 'Raksmorgas'\n\n// German: ä→ae, ö→oe\ntransliterate('Räksmörgås', {locale: 'de'});\n//=\u003e 'Raeksmoergas'\n```\n\n### Supported locales\n\nThe following locales have specific replacement rules when using the `locale` option:\n\n- `da` - Danish\n- `de` - German\n- `hu` - Hungarian\n- `nb` - Norwegian Bokmål\n- `sr` - Serbian\n- `sv` - Swedish\n- `tr` - Turkish\n\n## Supported languages\n\nMost major languages are supported.\n\nThis includes special handling for:\n\n- Arabic\n- Armenian\n- Czech\n- Danish\n- Dhivehi\n- Georgian\n- German (umlauts)\n- Greek\n- Hungarian\n- Latin\n- Latvian\n- Lithuanian\n- Macedonian\n- Pashto\n- Persian\n- Polish\n- Romanian\n- Russian\n- Serbian\n- Slovak\n- Swedish\n- Turkish\n- Ukrainian\n- Urdu\n- Vietnamese\n\nHowever, Chinese is [currently not supported](https://github.com/sindresorhus/transliterate/issues/1).\n\n## Related\n\n- [slugify](https://github.com/sindresorhus/slugify) - Slugify a string\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsindresorhus%2Ftransliterate","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsindresorhus%2Ftransliterate","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsindresorhus%2Ftransliterate/lists"}