diff options
| author | Shipwreckt <me@shipwreckt.co.uk> | 2025-10-31 20:02:14 +0000 |
|---|---|---|
| committer | Shipwreckt <me@shipwreckt.co.uk> | 2025-10-31 20:02:14 +0000 |
| commit | 7a52ddeba2a68388b544f529d2d92104420f77b0 (patch) | |
| tree | 15ddd47457a2cb4a96060747437d36474e4f6b4e /node_modules/@sindresorhus/transliterate/readme.md | |
| parent | 53d6ae2b5568437afa5e4995580a3fb679b7b91b (diff) | |
Changed from static to 11ty!
Diffstat (limited to 'node_modules/@sindresorhus/transliterate/readme.md')
| -rw-r--r-- | node_modules/@sindresorhus/transliterate/readme.md | 103 |
1 files changed, 103 insertions, 0 deletions
diff --git a/node_modules/@sindresorhus/transliterate/readme.md b/node_modules/@sindresorhus/transliterate/readme.md new file mode 100644 index 0000000..e46d08e --- /dev/null +++ b/node_modules/@sindresorhus/transliterate/readme.md @@ -0,0 +1,103 @@ +# transliterate + +> Convert Unicode characters to Latin characters using [transliteration](https://en.wikipedia.org/wiki/Transliteration) + +Can be useful for [slugification](https://github.com/sindresorhus/slugify) purposes and other times you cannot use Unicode. + +## Install + +``` +$ npm install @sindresorhus/transliterate +``` + +## Usage + +```js +import transliterate from '@sindresorhus/transliterate'; + +transliterate('Fußgängerübergänge'); +//=> 'Fussgaengeruebergaenge' + +transliterate('Я люблю единорогов'); +//=> 'Ya lyublyu edinorogov' + +transliterate('أنا أحب حيدات'); +//=> 'ana ahb hydat' + +transliterate('tôi yêu những chú kỳ lân'); +//=> 'toi yeu nhung chu ky lan' +``` + +## API + +### transliterate(string, options?) + +#### string + +Type: `string` + +String to transliterate. + +#### options + +Type: `object` + +##### customReplacements + +Type: `Array<string[]>`\ +Default: `[]` + +Add your own custom replacements. + +The replacements are run on the original string before any other transformations. + +This only overrides a default replacement if you set an item with the same key. + +```js +import transliterate from '@sindresorhus/transliterate'; + +transliterate('Я люблю единорогов', { + customReplacements: [ + ['единорогов', '🦄'] + ] +}) +//=> 'Ya lyublyu 🦄' +``` + +## Supported languages + +Most major languages are supported. + +This includes special handling for: + +- Arabic +- Armenian +- Czech +- Danish +- Dhivehi +- Georgian +- German (umlauts) +- Greek +- Hungarian +- Latin +- Latvian +- Lithuanian +- Macedonian +- Pashto +- Persian +- Polish +- Romanian +- Russian +- Serbian +- Slovak +- Swedish +- Turkish +- Ukrainian +- Urdu +- Vietnamese + +However, Chinese is [currently not supported](https://github.com/sindresorhus/transliterate/issues/1). + +## Related + +- [slugify](https://github.com/sindresorhus/slugify) - Slugify a string |
