An open API service indexing awesome lists of open source software.

https://github.com/bulgariamitko/lang-auto-switcher

Type English & Bulgarian on the same keyboard. Free macOS Input Method that auto-detects the language and converts to the right alphabet as you type — no Cmd+Space, no switching layouts.
https://github.com/bulgariamitko/lang-auto-switcher

bulgarian cyrillic imk input-method keyboard language-detection macos swift transliteration

Last synced: about 2 months ago
JSON representation

Type English & Bulgarian on the same keyboard. Free macOS Input Method that auto-detects the language and converts to the right alphabet as you type — no Cmd+Space, no switching layouts.

Awesome Lists containing this project

README

          

# LangAutoSwitcher

> **Type English and Bulgarian on the same keyboard, without ever switching layouts.**
> Just type — LangAutoSwitcher figures out which language you meant and converts it to the right alphabet as you go.

Free, open source, native macOS Input Method. No accounts, no telemetry. The only network traffic is a daily check for new versions (can be disabled in the Sparkle update preferences).

| Platform | Status |
|---|---|
| **macOS** | ✅ Ready — download and install below |
| **Linux** (IBus) | 🚧 [Skeleton](langauto-linux/README.md) — Rust core works, input plumbing TODO. Contributors welcome. |
| **Windows** | 🚧 [Skeleton](langauto-windows/README.md) — Rust core works, input plumbing TODO. Contributors welcome. |

The phonetic mapping, dictionaries, language detection, and autocorrect all live in a shared Rust crate (`langauto-core`) — porting to a new OS only requires writing the input-method shim for that platform.

```
You type: napisah now kod and sent email to John
You see: написах нов код and sent email to John
```

That's the whole idea. No `Cmd+Space`. No mistyped passwords. No half-Cyrillic, half-Latin Facebook posts.

---

## Who is this for?

Anyone who types in **both English and Bulgarian** every day and is tired of:

- Forgetting to switch the keyboard before typing a password
- Sending Facebook messages that start in one language and end in the other
- Constantly hitting `Cmd+Space` mid-sentence
- The standard БДС / Phonetic layout requiring you to *think* about which mode you're in

LangAutoSwitcher just watches what you type and picks the right alphabet for each word. Your existing Cyrillic and English keyboards stay exactly as they are — this is one more option you can switch to from the menu bar 🌐 icon.

---

## How it works

1. You type normally on a regular QWERTY keyboard.
2. Letters appear **underlined** while a word is being composed.
3. The moment you press **space**, the word is checked against:
- a **234,000-word English dictionary**
- a **234,000-word Bulgarian dictionary** (phonetically transliterated)
4. The winning language commits — either as-is (English) or converted to Cyrillic (Bulgarian).
5. If a word exists in both languages, it follows the language of the previous word, so your "flow" is preserved.

It auto-corrects common abbreviations too: `u` → `you`, `r` → `are`, plus edit-distance-1 spell correction for both languages.

### Examples

| You type | What appears | What happened |
|---|---|---|
| `towa e samo proba` | това е само проба | All Bulgarian words → Cyrillic |
| `hello how are you` | hello how are you | All English words → kept as-is |
| `napisah now kod and want to write` | написах нов код and want to write | Auto-switched mid-sentence |
| `how r u` | how are you | Abbreviation expanded |
| `kak si` | как си | Bulgarian via transliteration |
| `john@gmail.com` | john@gmail.com | Emails preserved |

---

## Install (60 seconds)

**1. Download** the latest release:
👉 [**Download LangAutoSwitcher-v2.7.7.dmg**](https://github.com/bulgariamitko/lang-auto-switcher/releases/latest)

**2. Open the DMG**, then **double-click `Install.command`**. A small Terminal window opens, copies the app into place, and shows you the next steps.

**3. Log out and log back in.** (macOS only discovers new input methods at login — there is no way around this, sorry.)

**4. Add it to your input sources:**
- Open **System Settings → Keyboard → Input Sources → Edit…**
- Click **+** in the bottom-left → search for **"LangAutoSwitcher"** → **Add**

**5. Switch to it.** Click the 🌐 / flag icon in your menu bar and pick **LangAutoSwitcher**.

Now just type. 🎉

> **Updates after this**: LangAutoSwitcher checks once a day for a new version and pops up an "Install Update" dialog when one ships. You only have to do the manual install once.

### Uninstall

```bash
rm -rf ~/Library/Input\ Methods/LangAutoSwitcher.app
```
Then log out / log back in.

---

## Transliteration mapping

Every Latin key maps to exactly one Cyrillic letter (no digraphs to remember):

| Key | → | Key | → | Key | → | Key | → |
|---|---|---|---|---|---|---|---|
| `a` | а | `i` | и | `q` | я | `y` | ъ |
| `b` | б | `j` | й | `r` | р | `z` | з |
| `c` | ц | `k` | к | `s` | с | `[` | ш |
| `d` | д | `l` | л | `t` | т | `]` | щ |
| `e` | е | `m` | м | `u` | у | `;` | ж |
| `f` | ф | `n` | н | `v` | ж | `` ` `` | ч |
| `g` | г | `o` | о | `w` | в | `\` | ю |
| `h` | х | `p` | п | `x` | ь | `'` | ь |

You almost never need to think about this table — most Bulgarian words are recognized by the dictionary directly from how you'd naturally spell them out (`zdravei`, `blagodarq`, `dobre`).

### Customizing the keymap

Don't like the default mapping? Click the 🌐 menu → **LangAutoSwitcher** → **Edit Keymap…** to open `~/Library/Application Support/LangAutoSwitcher/keymap.json` in your editor. Change any pair (for example remap `v` to `в` instead of `ж`), save the file, then pick **Reload Keymap** from the same menu — your overrides apply immediately. **Reset Keymap to Defaults** restores everything.

---

## Requirements

- macOS 14.0 (Sonoma) or later
- Apple Silicon or Intel Mac

## Privacy

LangAutoSwitcher runs entirely on your Mac. It does **not**:

- send any text anywhere
- collect analytics or telemetry
- log your keystrokes to disk

The dictionaries ship bundled inside the app.

The **only** network connection the app makes is a daily HTTPS request to its appcast (`https://bulgariamitko.github.io/lang-auto-switcher/appcast.xml`) to see whether a new version is available — handled by the open-source [Sparkle](https://sparkle-project.org) framework. You can disable update checks at any time in the Sparkle prompt that appears on the first launch.

---

## Build from source

Requires Xcode, [XcodeGen](https://github.com/yonaskolb/XcodeGen), and [Rust](https://rustup.rs):

```bash
brew install xcodegen
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
rustup target add x86_64-apple-darwin aarch64-apple-darwin

xcodegen generate
xcodebuild -project LangAutoSwitcher.xcodeproj -target LangAutoSwitcher -configuration Release build
bash install.sh
```

The Xcode build automatically invokes `scripts/build_rust.sh` to compile the cross-platform `langauto-core` Rust crate as a universal static library.

Then log out / log back in and add it from System Settings as above.

### Run tests

```bash
swift test_cases.swift # 163 Swift integration tests
cargo test # 23 Rust unit tests
```

## Architecture

```
langauto-core/ Rust crate — phonetic, dictionaries, detection, autocorrect
langauto-linux/ Linux IBus shim (skeleton)
langauto-windows/ Windows shim (skeleton)
LangAutoSwitcher/ macOS Swift app (links langauto-core as static library)
```

All shared logic lives in `langauto-core`. Each platform writes its own thin shim that links the core. See [langauto-core/README.md](langauto-core/) for the C ABI.

---

## Adding your own language

The architecture supports any Latin ↔ non-Latin language pair. To add one:

1. Add mappings to `map_char()` in `langauto-core/src/phonetic.rs`
2. Drop a word list (one word per line, in the target script) into `LangAutoSwitcher/Resources/`
3. Wire it up in `langauto-core/src/detector.rs`
4. Add test cases to `test_cases.swift` and `langauto-core/src/*/tests`
5. Open a PR

Good candidates: **Russian**, **Ukrainian**, **Serbian** (other Cyrillic languages), **Greek**, **Georgian**, **Armenian**.

## Contributing

Pull requests welcome. For bug reports, please include:
- macOS version
- What you typed
- What you expected vs. what appeared

## License

MIT — do whatever you want with it, including for commercial use.

---

If LangAutoSwitcher saves you time, star ⭐ the repo and share it — that's how other Bulgarian Mac users find it.