Skip to content

Add Cyrillic to Latin transliteration for metadata display #23

Description

@WinD52

Hello.
I've been using your device for some time. There are some changes that I would like to make, but the problem is that I am a very weak programmer (actually I am not a programmer at all, just an enthusiast).
Some time ago I wrote about head unit buttons for track switching. You provided me with a beta firmware #15 (comment) which works well for me. But there is always something to improve.

In the original firmware there is no support for Cyrillic characters, and most of the tracks in my region have such tags. And the display, not familiar with this encoding, just shows nothing.
While studying your source code I came across the transliteration block for some German letters. And I thought it could solve my problem too.

Unfortunately, I do not have the source code for the beta version with head unit control, and I don't know what changes are needed to add this functionality.
But by analogy with your code, I can provide a Cyrillic transliteration table:

// Cyrillic uppercase
input.replace("А", "A");
input.replace("Б", "B");
input.replace("В", "V");
input.replace("Г", "G");
input.replace("Д", "D");
input.replace("Е", "E");
input.replace("Ё", "Yo");
input.replace("Ж", "Zh");
input.replace("З", "Z");
input.replace("И", "I");
input.replace("Й", "Y");
input.replace("К", "K");
input.replace("Л", "L");
input.replace("М", "M");
input.replace("Н", "N");
input.replace("О", "O");
input.replace("П", "P");
input.replace("Р", "R");
input.replace("С", "S");
input.replace("Т", "T");
input.replace("У", "U");
input.replace("Ф", "F");
input.replace("Х", "Kh");
input.replace("Ц", "Ts");
input.replace("Ч", "Ch");
input.replace("Ш", "Sh");
input.replace("Щ", "Sh");
input.replace("Ъ", "");
input.replace("Ы", "Y");
input.replace("Ь", "");
input.replace("Э", "E");
input.replace("Ю", "Yu");
input.replace("Я", "Ya");

// Cyrillic lowercase
input.replace("а", "a");
input.replace("б", "b");
input.replace("в", "v");
input.replace("г", "g");
input.replace("д", "d");
input.replace("е", "e");
input.replace("ё", "yo");
input.replace("ж", "zh");
input.replace("з", "z");
input.replace("и", "i");
input.replace("й", "y");
input.replace("к", "k");
input.replace("л", "l");
input.replace("м", "m");
input.replace("н", "n");
input.replace("о", "o");
input.replace("п", "p");
input.replace("р", "r");
input.replace("с", "s");
input.replace("т", "t");
input.replace("у", "u");
input.replace("ф", "f");
input.replace("х", "kh");
input.replace("ц", "ts");
input.replace("ч", "ch");
input.replace("ш", "sh");
input.replace("щ", "sh");
input.replace("ъ", "");
input.replace("ы", "y");
input.replace("ь", "");
input.replace("э", "e");
input.replace("ю", "yu");
input.replace("я", "ya");

It would be great if you could add this to the firmware.
Thanks for your work.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions