Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Sublime Text 3 (and 2): newly installed dictionaries do not work

I'm a well-experienced mac user but no programmer. I'm playing with Sublime Text 3 (and 2) to work with LaTeX.

I installed the German dictionaries from https://github.com/SublimeText/Dictionaries. All of them except the AT version (German, DE, CH - installed all three files each, .aff, .dic, .txt, 9 files total). Downloaded and put them in the right folder.

Yes, I can select them under View -> Dictionary -> Language - German -> German (German_de_DE, German_de_CH) Yes, spell checking is enabled.

To test I create a file with

Haus (German correct) haus (German incorrect)

dog (en correct dooog (en incorrect)

With the English dictionary active everything is underlined red except "dog". With the German dictionary activated EVERYTHING is underlined red as wrong. (Everything I type in German remains marked wrong). This is true for all three installed German dictionaries. And for both ST3 and ST2.

I'm at the end of my wits here. Can anyone help?

like image 594
user2702430 Avatar asked Aug 21 '13 07:08

user2702430


4 Answers

In addition to Joshua Dunn answer, check that the first line of the .aff file is

SET UTF-8

For future reference, my workflow to add dictionaries to ST3 is:

To add a new language:

  • Download the language file from the appropiate OpenOffice extension

  • Rename the "some.oxt" file to "some.zip"

  • Unzip the file

  • Look for two files: "lang.aff" and "lang.dic". For example es_ES.aff and es_ES.dic

  • Open the "lang.aff" to check the encoding used. Such the line: SET ISO-8859-1

  • Convert that file to UTF-8 from the used encoding

  • Convert "lang.dic" to UTF-8 from the used encoding.

  • Change SET ISO-8859-1 to SET UTF-8

  • In ST3, click on Preferences -> Browse Packages

  • Create a new folder, for example Language - Spanish

  • Move lang.dic and lang.aff to that folder

  • Activate the dictionary in ST3 (View -> Dictionary -> Language - Spanish -> es_ES)

  • Press F6 to enable spell check

adapted from the github repo for SublimeText/Dictionaries

like image 160
amrtn Avatar answered Oct 01 '22 14:10

amrtn


I had the same problem and found a partial solution:

  1. Download the german dictionary from http://extensions.openoffice.org/en/project/german-de-de-frami-dictionaries

  2. Change the ending from .oxt to rar and extract the files

  3. Compress the files de_DE_frami/de_DE_frami.aff and de_DE_frami/de_DE_frami.dic to Language - German.zip

  4. Rename the file to Language - German.sublime-package

  5. Move the file to /Applications/Sublime Text.app/Contents/MacOS/Packages/

  6. Press F6 or Enable Spell Checking with View -> Spell Check

  7. Activate german language pack with View -> Dictionary -> Language - German _> de_DE_gami

My problem is, that even I saved my files as UTF-8 words with the letters üöäß are marked red. Any solutions therefore?

like image 23
neonmate Avatar answered Oct 01 '22 16:10

neonmate


I believe the dictionary feature of Sublime uses only UTF-8 encoded dictionaries. I am unsure whether or not German dictionaries (or even the one you are using) has the same encoding. I have always used UTF-8 dictionaries so I have not ran into this problem.

You can probably re-encode the dictionary you are using (with a chance of anomalies) using File -> Save With Encoding -> UTF-8 in Sublime while having the dictionary open.

Be sure to run the tests again to ensure it works for you. :)

*Source: http://www.sublimetext.com/docs/2/spell_checking.html*

like image 29
Joshua Dunn Avatar answered Oct 01 '22 15:10

Joshua Dunn


I had the same problem. I downloaded dictionary files from https://github.com/SublimeText/Dictionaries and saw German language in menu (View -> Dictonary) but everything was underlined red and there was no error message on console.

My fault was that on Git Hubs webpage I right clicked on German_de_DE.dic and selected Save link as. This - of course - saves the Git Hub page. I figured it out while checking the encoding of the file.

file German_de_DE.aff 
German_de_DE.aff: HTML document, UTF-8 Unicode text, with very long lines

HTML? Something went wrong! I downloaded the files from GitHub using RAW Button and everything works as expected.

like image 35
mara Avatar answered Oct 01 '22 15:10

mara