Typed keys alphabet switchers (Bulgarian Phonetic, Cyrillic)

Hi, Apologies for resurrecting an old thread, and with a slightly different purpose.
If needed, I may open a new one.

Really useful for my case would be not translation to official transliteration (mind you these are not to “cyrilic” but are language-specific, they are all different - Serbian, Bulgarian, Russian and so on…)

For me (and hope for others) really useful case is:

You start typing, but do not notice, you’re in a wrong keyboard layout - type in Bulgarian Phonetic (the usual one) instead in English. Or vice versa - start in English, instead of Bulgarian Phonetic:

Would be great of with a simple selection, that be changed to the correct symbols. The change is always 1-1 replacement, no other logic is required.
I prepared a table (as the above json) for Bulgarian Phonetic, Anyone may remap this easily for any other language.
This would be helpful not only for cyrilic, but for anyone using multiple keyboard layouts on their mac. I don’t know if an extension may be customizable per keyboard layout, or can be just for a single layout.

{
    "upper": {
        "А": "A",
        "Б": "B",
        "В": "V",
        "Г": "G",
        "Д": "D",
        "Е": "E",
        "Ж": "V",
        "З": "Z",
        "И": "I",
        "Й": "J",
        "К": "K",
        "Л": "L",
        "М": "M",
        "Н": "N",
        "О": "O",
        "П": "P",
        "Р": "R",
        "С": "S",
        "Т": "T",
        "У": "U",
        "Ф": "F",
        "Х": "H",
        "Ц": "C",
        "Ч": "~",
        "Ш": "{",
        "Щ": "}",
        "Ъ": "Y",
        "Ь": "X",
        "Ю": "|",
        "Я": ["Q"]
    },
    "lower": {
        "а": "a",
        "б": "b",
        "в": "v",
        "г": "g",
        "д": "d",
        "е": "e",
        "ж": "v",
        "з": "z",
        "и": "i",
        "й": "j",
        "к": "k",
        "л": "l",
        "м": "m",
        "н": "n",
        "о": "o",
        "п": "p",
        "р": "r",
        "с": "s",
        "т": "t",
        "у": "u",
        "ф": "f",
        "х": "x",
        "ц": "c",
        "ч": "`",
        "ш": "[",
        "щ": "]",
        "ъ": "y",
        "ь": "x",
        "ю": "\",
        "я": "q"
    }
}
1 Like

This is actually very similar to the Cyrillic/Latin switcher which another user contibuted. I’ve taken your table and that extension and bunged them together, seems to work but will need a test…

Also Cyrillic version:
https://github.com/pilotmoon/PopClip-Extensions/raw/master/extensions/CyrillicLatinSwitcher.popclipextz

First and foremost - many, many thanks!

Test result:

Dovnloaded txe version on txe first link. Vorks vitx tvo exceptions - letters “В-W” and “Х-H” - in botx directions
…and I vrote txis message via txis plugin :slight_smile:

When cyrilic “В” ор “в” is met, responce appears to be translation to “V” "or “v” instead to “W” and “w”

Update of specification:

Also one caveat, I forgot to mention, apologies. In Bulgarian there is no option of a word staring with capital “Ь”. That’s why on the mac keyboard the small “ь” is not capitalised, but is replaced with “ѝ”. My original table was wrong.

Update of the file:

I took the liberty to open the provided extension with BBEdit and did some changes on the mapping
“fixed” W-В and w-в mappings. Also “х”: “h” mapping was wrong. But for “Х”: “H”, the mapping was correct, I didn’t understand why it was not working for the capital letters.
I only touched the switcher.js file and installed as a modified user extension after modifying the identifier in the config.yaml part
But the results are correct now and I’m typing the last line with that extension now activated:

original:   абвгдежзийклмнопрстуфхцчшщъьюя
translated: abwgdevzijklmnoprstufhc`[]yx\q
original:   abwgdevzijklmnoprstufhc`[]yx\q
translated: абвгдежзийклмнопрстуфхцчшщъьюя
original:   АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪѝЮЯ
translated: ABWGDEVZIJKLMNOPRSTUFHC~{}YX|Q
original:   ABWGDEVZIJKLMNOPRSTUFHC~{}YX|Q
translated: АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪѝЮЯ

Attached is BulgarianPhoneticLatinSwitcher.popclipextz - with corrected mapping, but with wrong identifier
BulgarianPhoneticLatinSwitcher.popclipextz (1.9 KB)

Again, the fast and great responce is much appreciated!

P.S. I’m unable to find this thread in any forum category, only in the “Latest” list, is that intentional?

1 Like

Ah, that’s brilliant. I’ve now updated the code in the repo with your amended version.

I’ve also added a category to the post now too. I had split it off from the other thread since I felt it deserved a thread of its own, but it lost its category in the process.