ctrl+shift+p filters: :st2 :st3 :win :osx :linux
Browse

Switch​Dictionary

by Naereen ST3 OS XLinux

Tiny ST3 :memo: plug-in to easily switch :twisted_rightwards_arrows: between spell-check for French :fr: or English :gb:, and auto-detect the language

Details

Installs

  • Total 571
  • Win 0
  • OS X 241
  • Linux 330
Sep 19 Sep 18 Sep 17 Sep 16 Sep 15 Sep 14 Sep 13 Sep 12 Sep 11 Sep 10 Sep 9 Sep 8 Sep 7 Sep 6 Sep 5 Sep 4 Sep 3 Sep 2 Sep 1 Aug 31 Aug 30 Aug 29 Aug 28 Aug 27 Aug 26 Aug 25 Aug 24 Aug 23 Aug 22 Aug 21 Aug 20 Aug 19 Aug 18 Aug 17 Aug 16 Aug 15 Aug 14 Aug 13 Aug 12 Aug 11 Aug 10 Aug 9 Aug 8 Aug 7 Aug 6
Windows 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
OS X 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0
Linux 0 0 0 0 0 0 3 0 0 0 1 0 0 0 0 0 0 0 0 1 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0

Readme

Source
raw.​githubusercontent.​com

SublimeText3 SwitchDictionary - EARLY STAGE

WARNING

This plug-in is still in active development and is in early stage!

made-with-python made-for-st3 Package Control total downloads Package Control month downloads Package Control week downloads Package Control day downloads

About

It is a tiny Sublime Text 3 plug-in (not tested on ST 2), that add commands and shortcuts to switch between: no spell-check, spell-check for French, and spell-check for English.

This plugin also implements a small automatic language checker to detect if the document is in French or in English (and embeds a more sophisticated one), but the dictionary is loaded only with a keyboard shortcut, it is not turned on automatically.

Note: It is restricted to only French vs English for now. I hope it will soon be better, allowing you to define your own list of dictionaries.

Demo (gif screencast)

demo of Sublime Text 3 'SwitchDictionary' plugin (gif)


Commands

enable_english_spellcheck

  • It enables spell-check, and sets the dictionary to English
  • It is associated to the key chain ctrl+k, ctrl+e

enable_french_spellcheck

  • It enables spell-check, and sets the dictionary to French
  • It is associated to the key chain ctrl+k, ctrl+f

switch_spellcheck

  • It cycles between English, French, and None
  • It is associated to the key chain ctrl+k, ctrl+s and also to ctrl+alt+s (s for switch)

auto_switch_spellcheck

  • It uses langdetect.detect to (try to) automatically detect the language of the current file. I also manually added a small check (with French accents), as langdetect is failing on some very small files
  • Right now, the detected language is only used to know if it is French / or not French (English or other language). TODO I need to generalize this
  • It sets to French if the file is in French (or as a high probability of being written in French), and sets to English otherwise
  • It is associated to ctrl+alt+a (a for auto)
  • Warning: it requires the current file (edited file) to be saved on the disk, as it uses the content of the file to guess the language

disable_spellcheck

  • It simply disables the spell-check
  • It is NOT associated to any key (tip: use the default command, associated to F6 by default)

Accessing commands through…

:notebook: The Command Palette !

Press ctrl+shift+p (Windows, Linux) or cmd+shift+p (OS X) to open the Command Palette, and then search for:

  • Switch Dictionary: disable (None),
  • Switch Dictionary: to English,
  • Switch Dictionary: to French,
  • Switch Dictionary: None ↔ French ↔ English.
  • Auto Switch Dictionary (guess).

:mouse: The Encoding Menu !

In the status bar, you should have a menu showing the encoding of the current file (by default it is UTF-8). Click on the menu, and you can click on:

  • Switch Dictionary – Disable (None)
  • Switch Dictionary – to English
  • Switch Dictionary – to French
  • Switch Dictionary – None ↔ French ↔ English
  • Auto Switch Dictionary (guess)

:musical_keyboard: Shortcuts !

By default, the following shortcuts are available

  • ctrl+k, ctrl+e : Switch Dictionary – to English
  • ctrl+k, ctrl+f : Switch Dictionary – to French
  • ctrl+k, ctrl+s or ctrl+alt+s : Switch Dictionary – None ↔ French ↔ English
  • ctrl+alt+a : Auto Switch Dictionary (guess)

:question: How to install it ?

:ok_hand: With Package Control

If you have Package Control installed in Sublime Text 2/3, just press ctrl+shift+p (Windows, Linux) or cmd+shift+p (OS X) to open the Command Palette.

  1. Start typing install to select Package Control: Install Package,
  2. Then search for SwitchDictionary and select it. That's it!

The package is now available on packagecontrol.io !

Package Control total downloads Package Control month downloads Package Control week downloads Package Control day downloads

:floppy_disk: Manually, with git

You can also install this package manually by entering the Packages directory of Sublime Text 3 (through the menu: “Preferences” > “Browse packages”), and issuing this command on a terminal:

cd ~/.config/sublime-text-3/Packages/  # adapt the path on Windows or Mac OS X
git clone https://github.com/Naereen/SublimeText3_SwitchDictionary

Check it

You can check it was well installed by hitting ctrl+k, ctrl+s (it should enable English spell checking).


:boom: TODO !

  • [x] Test it on another laptop : DONE on another Linux laptop
  • [x] Test it on Mac OS X : DONE on a Mac OS laptop, TODO on Windows
  • [x] Implement a smart detection, to know if a file is in French or in English
  • [ ] Be more general, allow a user to define his own favorite dictionaries
  • [ ] Finish it completely
  • [ ] Include a second screencast showing the “automatic language detection” feature (new in v0.0.3)
  • [x] Publish it on Package Control, OK. I was waiting for this pull request to be merged.

:hourglass: Future Features

  • Be more general: allow users to define manually a list of dictionary (path, and name), and add one command for each dictionary, and make the switch_spellcheck command cycle between them!

:scroll: License ? GitHub license

This plug-in is published under the terms of the MIT license (file LICENSE.txt), © Lilian Besson, 2016.

Maintenance Ask Me Anything ! Analytics made-with-python made-for-st3

ForTheBadge uses-badges ForTheBadge uses-git

ForTheBadge built-with-love