2

I wrote a text file in Portuguese. I have changed my dictionary to portugues. I tried to spell-check buffer and I get the following error message:

Starting new Ispell process aspell with portugues dictionary...
ispell-init-process: Error: Expected language "pt_PT" but got "en".

2 Answers 2

1

How did you change the dictionary to Portuguese ? You'd need something like this :

(setq ispell-program-name "/usr/bin/hunspell") (setq ispell-local-dictionary "pt_BR") (flyspell-mode 1)

And also install the Portuguese dictionary for hunspell.

This is assuming Linux, Brazilian Portuguese, and hunspell as your preferred program. If anything is different, you'd have to chamber that or provide details here.

1
  • Thank you. I forgot I had solved this problem before with this code in init.el: ;; Portuguese dictionary (with-eval-after-load "ispell" (setq ispell-program-name "hunspell") (setq ispell-dictionary "en_GB,en_US,pt_PT") ;; ispell-set-spellchecker-params has to be called ;; before ispell-hunspell-add-multi-dic will work (ispell-set-spellchecker-params) (ispell-hunspell-add-multi-dic "en_GB,en_US,pt_PT"))
    – sbac
    Aug 14, 2018 at 14:35
0

This message is shown when Emacs is trying to get the version of your aspell by doing

aspell -a -m

(in ispell-start-process).

What this message is trying to tell you is that your personal dictionary is expected to be for the languare pt_PT, but it has en in its top row.

The personal dictionaries are named as

~/.aspell.LANG_NAME.prepl
~/.aspell.LANG_NAME.pws

On windows, depending on your config, this ~ may mean %HOME%, %APPDATA% or cygwin’s /home/USERNAME. I think fixing the top line should deal with it.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.