Dakov.Transliterator 1.3.1

dotnet add package Dakov.Transliterator --version 1.3.1
                    
NuGet\Install-Package Dakov.Transliterator -Version 1.3.1
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Dakov.Transliterator" Version="1.3.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Dakov.Transliterator" Version="1.3.1" />
                    
Directory.Packages.props
<PackageReference Include="Dakov.Transliterator" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Dakov.Transliterator --version 1.3.1
                    
#r "nuget: Dakov.Transliterator, 1.3.1"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Dakov.Transliterator@1.3.1
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Dakov.Transliterator&version=1.3.1
                    
Install as a Cake Addin
#tool nuget:?package=Dakov.Transliterator&version=1.3.1
                    
Install as a Cake Tool

Dakov.Transliterator

License NuGet Badge

A lightweight and extensible .NET library for bidirectional transliteration between Cyrillic and Latin alphabets. Supports Bulgarian and Macedonian rule sets, basic character mapping, and customizable overrides via configuration.

If this library saved you time or proved useful, feel free to share it with your friends or colleagues.
And if you'd like to support the project—you can always buy me a beer! 🙂

A small thank you

I truly appreciate every bit of support If you choose to donate, I’d be happy to feature your name, project, or anything you'd like to share in the Friends and Supporters section.

I’m also open to simple ad or link exchanges

Donation options

The following wallets are supported via Bitfinex.
Please make sure to check the latest details before sending a transaction.

  • Bitcoin (BTC)
    Address - 3FqXqTzGhzxosERosz832F7rGDXMteMjRh

  • Ethereum (ETH) At this time Bitfinex does not accept transactions sent from smart contracts.
    Address - 0x818E07acD7d75d1812B2E7067e417C5Bc80d327E

  • XRP (XRP) Sending XRP requires both an address and a Tag
    Address - rLW9gnQo7BQhU6igk5keqYnH3TVrCxGRzm
    Tag - 2345006832

  • Dogecoin (DOGE)
    Address - DNXrvtmrSWVyBKfmPizXQsreqLSRJQpqCv

  • Bitcoin Cash Node (BCHN) Depositing anything other than BCH Node WILL RESULT IN LOSS OF FUNDS. Bitfinex currently is not supporting automated chain splits.
    Address - bitcoincash:qz4tu69cn50gryhdahemytrszdtnn9vwtqexclhleq

  • Litecoin (LTC)
    Address - MD7ngCjhUbLNZfnvLdXkVu1LUkXwZMTHmF

  • Monero (XMR)
    Address - 86GNkvtYzbEZwq5MxpVvzP7kZ2tUgea5SKy8FTJ4S48fY8hz3DYBPWwJsLNz2woi7dQi34TYkcPDpZKh7iZLaaMLGHrSTwZ

Note: Please check the transaction fees before sending, as they can sometimes be quite high.

Installation

Its can be installed and use via NuGet:

Package Manager
Install-Package Dakov.Transliterator
.NET CLI
dotnet add package Dakov.Transliterator

How to use it

We should include the library after the installation.

using Dakov.Transliterator;

Code snippets show how to call the methods.

var cyrillicText = "Съученичките Мария и Дияна скачаха с бънджи.";

var options1 = new TransliterationOption
{
    TransliterationRuleset = TransliterationRuleset.Basic,
    UrlCompatibility = false,
    WordSeparator = '-',
};

// If we miss the TransliterationOption param we will use the basic values.
// We can see it in the example above "option1".
var latinText0 = Transliterator.CyrillicToLatin(cyrillicText);
// The result is : Sauchenichkite Mariya i Diyana skachaha s bandzhi.

var latinText1 = Transliterator.CyrillicToLatin(cyrillicText, options1);
// The result is : Sauchenichkite Mariya i Diyana skachaha s bandzhi.

var options2 = new TransliterationOption
{
    TransliterationRuleset = TransliterationRuleset.Bulgarian,
};

var latinText2 = Transliterator.CyrillicToLatin(cyrillicText, options2);
// The result is : Sauchenichkite Maria i Diyana skachaha s bandzhi.
// One of the differences between the Basic and Bulgarian rule set you can see in the name "Мария".
// According to the Article 5(2) of the Transliteration Law.

var options3 = new TransliterationOption
{
    TransliterationRuleset = TransliterationRuleset.Bulgarian,
    UrlCompatibility = true,
};

var latinText3 = Transliterator.CyrillicToLatin(cyrillicText, options3);
// The result is : sauchenichkite-maria-i-diyana-skachaha-s-bandzhi

var options4 = new TransliterationOption
{
    TransliterationRuleset = TransliterationRuleset.Bulgarian,
    UrlCompatibility = true,
    WordSeparator = '_',
};

var latinText4 = Transliterator.CyrillicToLatin(cyrillicText, options4);
// The result is : sauchenichkite_maria_i_diyana_skachaha_s_bandzhi

// Macedonian example
var macedonianText = "Скопје е главен град.";
var macedonianOptions = new TransliterationOption
{
    TransliterationRuleset = TransliterationRuleset.Macedonian,
};

var macedonianLatin = Transliterator.CyrillicToLatin(macedonianText, macedonianOptions);
// The result is : Skopje e glaven grad.

var listOfCyrillicTexts = new List<string>()
{
    "Съученичките Мария и Дияна скачаха с бънджи.",
    "Полета от високо е опасен и вдига адреналина.",
    "На следващият ден двете момичета разказаха на приятелите си."
};

var listOfCyrillicTexts0 = Transliterator.CyrillicToLatin(listOfCyrillicTexts);
// The result is :
// - Sauchenichkite Mariya i Diyana skachaha s bandzhi.
// - Poleta ot visoko e opasen i vdiga adrenalina.
// - Na sledvashtiyat den dvete momicheta razkazaha na priyatelite si.

var listOfCyrillicTexts1 = Transliterator.CyrillicToLatin(listOfCyrillicTexts, options1);

var latinText = "Sauchenichkite Mariya i Diyana skachaha s bandzhi.";
var cyrillicText = Transliterator.LatinToCyrillic(latinText);
// The result is : Саученичките Мария и Дияна скачаха с банджи.
// But in transliteration via Basic ruleset from Latin to Cyrillic have small percentage inaccuracies.

Transliteration law

Basic character pairs
Cyrillic Latin
А, а A, a
Б, б B, b
В, в V, v
Г, г G, g
Д, д D, d
Е, е E, e
Ж, ж Zh, zh
З, з Z, z
И, и I, i
Й, й Y, y
К, к K, k
Л, л L, l
М, м M, m
Н, н N, n
О, о O, o
П, п P, p
Р, р R, r
С, с S, s
Т, т T, t
У, у U, u
Ф, ф F, f
Х, х H, h
Ц, ц Ts, ts
Ч, ч Ch, ch
Ш, ш Sh, sh
Щ, щ Sht, sht
Ъ, ъ A, a
Ь, ь Y, y
Ю, ю Yu, yu
Я, я Ya, ya

Bulgarian ruleset

The full text on Transliteration Law you can read here (on Bulgarian).

Macedonian ruleset

Official orthography (pages 169–170):
https://www.pollitecon.com/Assets/Ebooks/Pravopis-na-Makedonskiot-Jazik.pdf |

Friends and Supporters

Waiting for the first friends! 😃

To-Do List

  • Acception generic objects as parameters in transliteration methods.
  • Extending exception support.
  • Adding specific rules for other languages.

Author

Petar Dakov

License

License

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.3.1 226 4/8/2026
1.2.1 2,735 2/20/2025
1.1.4 18,395 6/23/2023
1.1.3 66,924 2/25/2020

- Added Macedonian transliteration rules
     - Introduced language-specific override system
     - Improved extensibility for future rule sets (e.g. Ukrainian, Serbian)
     - Fixed edge cases in Latin-to-Cyrillic conversion (Gj, Sht, etc.)
     - Expanded unit test coverage with real-world examples