common-turkic-script
v0.1.0
Published
Zero-dependency transliterator from Qazaq (kk) and Qırğız (ky) Cyrillic to the official 34-letter Common Turkic Alphabet (Ortaq Türk Älipbesi).
Maintainers
Readme
common-turkic-script
Qazaq (kk) pen Qırğız (ky) kirilın bekitilgen 34 tamgalı Ortaq Türk Jazuwına awdaratın, täweldiliksiz awdarğış.
Zero-dependency transliterator from Qazaq (kk) and Qırğız (ky) Cyrillic to the official 34-letter Common Turkic Alphabet.
Qazaqşa
Bul README-diñ qazaqşa böligi tutasımen 34 tamgalı Ortaq Türk Jazuwında jazılğan — demek buwma öziniñ şığısımen jazılğan.
common-turkic-script — Qazaq (kk) pen Qırğız (ky) kiril jazbasın bekitilgen 34 tamgalı Ortaq Türk Jazuwına (Baku 2024 · Astana 2026) awdaratın arıw, täweldiliksiz TypeScript buwması.
Erekşelikter
- Arıw atqarım, eş täweldilik joq; şolğışta da, Node-ta da jumıs isteydi.
- TypeScript türleri qosılğan (
.d.ts), ESM + CJS qoldaw. - Bas/kişi tamga saqtaladı (
Ұ→Ū,Я→Ya/YA). - Idempotent: bir kez awdarılğan ortaq jazuw jazbası qaytadan awdarılğanda özgermeydi.
- Tree-shakeable, minzip ölşemi öte kişi.
- CLI qosılğan: buyrıq jolında tikeley qoldanu.
Ornatuv
npm install common-turkic-scriptJıldam bastaw
import { transliterate, createTransliterator } from "common-turkic-script";
transliterate("Қазақстан", "kk"); // "Qazaqstan"
transliterate("Жалпы", "ky"); // "Calpı"
// Bir tilge baylanğan qaytımdı atqarım:
const toLatin = createTransliterator("kk");
toLatin("Абай Құнанбайұлы"); // "Abay Qūnanbayūlı"API
| Atqarım | Tüsindirme |
| --- | --- |
| transliterate(text, lang) | Jazbanı awdaradı. lang: "kk", "ky" nemese { lang }. |
| transliterateLines(lines, lang) | Joldar tizbesin tolığımen awdaradı. |
| createTransliterator(lang) | Bir tilge baylanğan (text) => string atqarımın qaytaradı. |
| getSupportedLangs() | Qoldaw körsetilgen til belgilerin qaytaradı. |
| langProfiles | Barlıq tildiñ derekteri men sızbası. |
| COMMON_TURKIC_34 | 34 tamgadan turatın tizbe. |
Bekitilgen sızba eskertpeleri
| Kiril | kk | ky | Eskertpe |
| --- | --- | --- | --- |
| ұ | ū | — | üst sızıq; у→u-dan bölek (eñ mañızdı ayırma) |
| ы | ı | ı | üsti belgisiz I |
| і / и | i | i | üsti belgili İ |
| й | y | y | |
| ж | j | c | Qazaq [ʒ]→j, Qırğız [d͡ʒ]→c |
| ч | ç | ç | |
| х | x | x | |
| ң | ñ | ñ | |
English
common-turkic-script is a pure, zero-dependency TypeScript package that transliterates Qazaq (kk) and Qırğız (ky) Cyrillic text into the official 34-letter Common Turkic Alphabet (Ortaq Türk Jazuwı; Baku 2024 · Astana 2026 Declaration).
Features
- Pure function, no dependencies; runs in the browser and in Node.
- TypeScript types included (
.d.ts), ESM + CJS support. - Case-preserving (
Ұ→Ū,Я→Ya/YA). - Idempotent: text already in the common alphabet is left unchanged.
- Tree-shakeable, tiny minzipped footprint.
- CLI included for direct terminal use.
Install
npm install common-turkic-scriptQuick start
import { transliterate, createTransliterator } from "common-turkic-script";
transliterate("Қазақстан", "kk"); // "Qazaqstan"
transliterate("Жалпы", "ky"); // "Calpı"
// A reusable function bound to one language:
const toLatin = createTransliterator("kk");
toLatin("Абай Құнанбайұлы"); // "Abay Qūnanbayūlı"CommonJS
const { transliterate } = require("common-turkic-script");
transliterate("Қазақ", "kk"); // "Qazaq"Browser (via CDN)
<script type="module">
import { transliterate } from "https://cdn.jsdelivr.net/npm/common-turkic-script/+esm";
console.log(transliterate("Қазақстан", "kk")); // "Qazaqstan"
</script>API
| Function | Description |
| --- | --- |
| transliterate(text, lang) | Transliterate text. lang: "kk", "ky", or { lang }. |
| transliterateLines(lines, lang) | Transliterate an array of lines in bulk. |
| createTransliterator(lang) | Returns a reusable (text) => string bound to one language. |
| getSupportedLangs() | Returns the supported language codes. |
| langProfiles | Per-language metadata and mapping table. |
| COMMON_TURKIC_34 | The 34-letter alphabet as an array. |
import type {
SourceLang,
TranslitOptions,
CharMap,
LangProfile,
} from "common-turkic-script";CLI
# Inline text
npx common-turkic-script --lang kk "Қазақстан" # Qazaqstan
# From stdin
echo "Жалпы" | npx common-turkic-script -l ky # Calpı
# From a file
npx common-turkic-script --lang kk input.txt > output.txt| Flag | Description |
| --- | --- |
| -l, --lang <kk\|ky> | Source Cyrillic language (required). |
| -h, --help | Show help. |
| -v, --version | Show version. |
Official table notes
| Cyrillic | kk | ky | Note |
| --- | --- | --- | --- |
| ұ | ū | — | macron; distinct from у→u (the most critical distinction) |
| ы | ı | ı | dotless I |
| і / и | i | i | dotted İ |
| й | y | y | |
| ж | j | c | Qazaq [ʒ]→j, Qırğız [d͡ʒ]→c |
| ч | ç | ç | |
| х | x | x | |
| ң | ñ | ñ | |
Source & standard
34-letter Common Turkic Alphabet (Baku 2024 · Astana 2026 Declaration). Letters: A Ä B C Ç D E F G Ğ H I İ J K L M N Ñ O Ö P Q R S Ş T U Ū Ü V X Y Z.
Contributing
Contributions are welcome. Please run npm run lint, npm run build, and
npm test before opening a pull request. See CHANGELOG.md.
