Sublime Forum

Q: Is is possible to deactivate the spellcheck for Japanese lines?

#1

HI,
I use Sublime Text mainly for Japanese to French translation. I simply put the Japanese source sentences in ST, then translate the lines one by one like this:

Japanese source line 1
French target line 1
Japanese source line 1
French target line 2

The spellcheck is activated (I use the French one, from the available French spellcheck package).
I wonder if it’s possible to do not apply the spellcheck to the Japanese lines (I get red underlines all over the Japanese lines, which is a bit annoying).

0 Likes

#2

Press Cmd + , if you use macOS or Ctrl + , if you use Linux and Windows

Multiply and add languages to the dictionaries.

If not, try https://github.com/gtarawneh/languagetool-sublime.

See if you have aff, dict and txt of Japanese languages.

I have only dict file of Japanese.

1 Like

#3

Thank you gusbemable, but I’m completely lost.
I’m on MacOS.
Cmd + only makes a zoom on the text.
And I have no idea how to add a language to the dictionaries…

1 Like

#4

I mean Cmd + comma, and not Cmd + plus. Sorry for misunderstanding my explanation and I had to clarify it.

1 Like

#5

Press Cmd + comma or go to Sublime Text > Preference > Settings, see how it is:

{
	"color_scheme": "Packages/star-wars-syntax/an-old-hope.tmTheme",
	"dictionary": "Packages/Language - English/en_GB.dic",
	"font_size": 18,
	"ignored_packages":
	[
		"Edit Preferences",
		"JavaScript",
		"Vintage"
	],
	"skin": "DA UI/Elegant",
	"theme": "DA.sublime-theme"
}

Replace ``“dictionary”: “Packages/Language - English/en_GB.dic”,for“dictionary”: “Packages/Language - English/en_GB.dic”, Packages/Language - French/fr.dic", Packages/Language - Japanese/ja.dic"```.

1 Like

#6

Thank you gusbemacbe, now I understand. :slight_smile:
Any idea where I can download the ja.dic file from?

1 Like

#7

There is no ja.dic in internet.

I hacked and extracted the Japanese dictionary from Google Japanese keyboard and built myself it. I didn’t build Japanese grammar (.aff) yet. Here is the shared file: (I removed the shared file)

After downloading, please advice me, so I will remove the link, because the dictionary is in beta.

1 Like

#8

Thanks a lot gusbemacbe, I downloaded the file.
Now I have to understand the last step : where to paste the dic file in Sublime Text…

1 Like

Is there a better way to turn off spell check for Japanese characters?
#9

Sorry, I went to bed and I didn’t notice you have sent earlier.

If you use macOS, go to Finder, press Cmd + Shift + G and copy and paste /Users/yourname/Library/Application Support/Sublime Text 3/Packages/User, and create new folder folder and rename it as Dictionaries or Dictionary. Copy the ja.dict to this folder. Restart Sublime Text.

If you use Linux, go to /homeyourname/.config/sublime-text-3/Packages/User.

If you use Windows, go to %APPDATA%\Sublime Text 3 or C:\Users\%yourname%\AppData\Roaming\Sublime Text 3\Packages (equals %appdata%\Sublime Text 2\Packages.

Ad follow the same steps.

1 Like

#10

Thanks you gusbemacbe,
I figured it out by myself yesterday, but it makes ST crash every time I add the dic file.
I finally installed the Desktop version of LanguageTool, and will see what I can do with it.
Thanks again for your help.

1 Like

#11

If LanguageTool installed the dictionaries and created the folder of dictionaries, check its folder at /Users/yourname/Library/Application Support/Sublime Text 3/Packages/.

If it doesn’t work, you need to hack and merge the English dictionary.

The English dictionary isn’t listed in that package, because it is inside Sublime Text3.app

Backup Sublime Text 3.app before.

Go to Finder, press Cmd + Shift + G and copy and paste /yourname/Applications/Sublime Text.app/Contents/MacOS/Packages/Language - English.sublime-package

Do not open the file Language - English.sublime-package with Sublime Text, but with TextEdit or Atom, and also open the ja.dict with Atom or TextEdit, copy everything from the file ja.dict and paste on the end of the file Language - English.sublime-package. Save it and open the app. Test two sentences in English and Japanese, and see if it works.

If it doesn’t work, restart to the backup of Sublime Text3.app, search at Package Control: Install Package and type “French”, you will install the French dictionary which will appear in the packages folder of Sublime Text and copy the ja.dict to the folder of French dictionary.

1 Like

#12

Hi,
That’s the problem: I don’t have any Language folder in …/Applications/Sublime Text.app/Contents/MacOS/Packages/.
Though I do have access to the English and French dics in ST.

1 Like

#13

And did it work for you, Higashi?

1 Like

#14

I think a simpler solution based on your file layout would be to write a syntax definition to scope alternate lines differently, so you can update your spelling selector preference to ignore the Japanese lines

2 Likes

Is there a better way to turn off spell check for Japanese characters?
#15

gusbemacbe:And did it work for you, Higashi?

No. I meant that I have access (I can use) the English and French dics, but I cannot find them in …/Applications/Sublime Text.app/Contents/MacOS/Packages/.

kingkeith: a simpler solution based on your file layout would be to write a syntax definition to scope alternate lines differently…

I have no idea how to to this. I also thought that I could find a way to spellcheck only the line where the cursor is, but still, I don’t know how to do. That would be a quite efficient solution…

1 Like

#16

Got it!
Inspired by kingkeith, I selected C in View - Syntax.
Then all I have to do is to start the French line with //, all the other lines are ignored by the spellcheck.
Thank you to both of you :slight_smile:

1 Like

#17

Does it work for print(“blablabla in Japanese”) too?

1 Like

#18

I’m just a translator, not a programmer, so I’m not sure to understand.
If you’re just asking if the Japanese sentence is ignored by the spellcheck after print(… yes it is.

1 Like

#19

The only problem I noticed until now is with this character: ’

Everything after this character will be checked by the spellcheck. Not really a problem, since it’s not really used in Japanese.

1 Like

#20

Do you mean print?

1 Like