Skip to content

Instantly share code, notes, and snippets.

@jeff-phil
Created January 16, 2024 22:30
Show Gist options
  • Save jeff-phil/c95b72a14d3b4310de7c96e05b3cdc48 to your computer and use it in GitHub Desktop.
Save jeff-phil/c95b72a14d3b4310de7c96e05b3cdc48 to your computer and use it in GitHub Desktop.
Enchant and Apple Spell discussion
de_DE de Deutsch
en en English
en_US en_US English
en_US en English
en_AU en_AU Australian English
en_CA en_CA Canadian English
en_GB en_GB British English
es_ES es Español
fr_FR fr Français
it_IT it Italiano
nl_NL nl Nederlands
pt_PT pt Português
pt_BR pt_BR Português do Brasil
sv_SE sv Svenska
hu_HU hu Magyar (MySpellX)
*:AppleSpell,aspell,hunspell
en*:AppleSpell,aspell,hunspell
en_US:AppleSpell,aspell,hunspell
*:aspell,AppleSpell,hunspell
en*:aspell,AppleSpell,hunspell
en_US:aspell,AppleSpell,hunspell
#!/bin/sh
echo "Changing to ~/.config/enchant directory"
cd ~/.config/enchant
echo "Backing up enchant.ordering to enchant.ordering.bak"
cp enchant.ordering enchant.ordering.bak
echo
echo "Copy enchant.ordering.applespell enchant.ordering"
cp enchant.ordering.applespell enchant.ordering
echo "\`enchant-lsmod-2 -lang en' should print: \`en (AppleSpell)'"
enchant-lsmod-2 -lang en
echo "\`enchant-lsmod-2 -lang en_US' should print: \`en_US (AppleSpell)'"
enchant-lsmod-2 -lang en_US
echo
echo "Copy enchant.ordering.aspell to enchant.ordering"
cp enchant.ordering.aspell enchant.ordering
echo "\`enchant-lsmod-2 -lang en' should print: \`en (aspell)'"
enchant-lsmod-2 -lang en
echo "\`enchant-lsmod-2 -lang en_US' should print: \`en_US (aspell)'"
enchant-lsmod-2 -lang en_US
echo "Restoring enchant.ordering.bak to enchant.ordering"
cp enchant.ordering.bak enchant.ordering
@jeff-phil
Copy link
Author

This is to validate and test enchant-2 ordering on macOS.

Place all the files in ~/.config/enchant, or change where needed. Add execute to the enchant_validate-en_US.sh script and run.

My current versions:

#  sw_vers
ProductName:		macOS
ProductVersion:		14.2.1
BuildVersion:		23C71

# brew --version
Homebrew 4.2.4-26-g3ed42ac
Homebrew/homebrew-core (git revision 4a83d95a5a0; last commit 2024-01-16)
Homebrew/homebrew-cask (git revision 1ee0877cb9; last commit 2024-01-16)

# enchant-lsmod-2 -version
enchant-lsmod-2 2.6.5

Output from enchant_validate-en_US.sh:

Changing to ~/.config/enchant directory
Backing up enchant.ordering to enchant.ordering.bak

Copy enchant.ordering.applespell enchant.ordering
`enchant-lsmod-2 -lang en' should print: `en (AppleSpell)'
en (AppleSpell)
`enchant-lsmod-2 -lang en_US' should print: `en_US (AppleSpell)'
en_US (AppleSpell)

Copy enchant.ordering.aspell to enchant.ordering
`enchant-lsmod-2 -lang en' should print: `en (aspell)'
en (aspell)
`enchant-lsmod-2 -lang en_US' should print: `en_US (aspell)'
en_US (aspell)
Restoring enchant.ordering.bak to enchant.ordering

@jdtsmith
Copy link

Some debugging possible with env G_MESSAGES_DEBUG=libenchant enchant-lsmod-2 -list-dicts

@jeff-phil
Copy link
Author

Does above enchant_validate-en_US.sh not give you the same results?

And/or what do you see indicating that enchant.ordering is not working?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment