mirror of
https://github.com/weechat/weechat.git
synced 2026-07-07 10:13:12 +02:00
spell: allow overriding dictionaries locations
Works for aspell and myspell (hunspell) when using enchant.
This commit is contained in:
committed by
Sébastien Helleu
parent
d91039ebd0
commit
6b19987e7f
@@ -157,6 +157,9 @@ spell_command_speller_list_dicts (void)
|
||||
NULL);
|
||||
#else
|
||||
config = new_aspell_config ();
|
||||
#ifdef ASPELL_DICT_DIR
|
||||
aspell_config_replace (config, "dict-dir", ASPELL_DICT_DIR);
|
||||
#endif
|
||||
list = get_aspell_dict_info_list (config);
|
||||
elements = aspell_dict_info_list_elements (list);
|
||||
|
||||
|
||||
@@ -107,6 +107,9 @@ spell_completion_dicts_cb (const void *pointer, void *data,
|
||||
completion);
|
||||
#else
|
||||
config = new_aspell_config ();
|
||||
#ifdef ASPELL_DICT_DIR
|
||||
aspell_config_replace (config, "dict-dir", ASPELL_DICT_DIR);
|
||||
#endif
|
||||
list = get_aspell_dict_info_list (config);
|
||||
elements = aspell_dict_info_list_elements (list);
|
||||
|
||||
|
||||
@@ -65,6 +65,9 @@ spell_speller_dict_supported (const char *lang)
|
||||
rc = 0;
|
||||
|
||||
config = new_aspell_config ();
|
||||
#ifdef ASPELL_DICT_DIR
|
||||
aspell_config_replace (config, "dict-dir", ASPELL_DICT_DIR);
|
||||
#endif
|
||||
list = get_aspell_dict_info_list (config);
|
||||
elements = aspell_dict_info_list_elements (list);
|
||||
|
||||
@@ -174,6 +177,9 @@ spell_speller_new (const char *lang)
|
||||
/* create a speller instance for the newly created cell */
|
||||
config = new_aspell_config ();
|
||||
aspell_config_replace (config, "lang", lang);
|
||||
#ifdef ASPELL_DICT_DIR
|
||||
aspell_config_replace (config, "dict-dir", ASPELL_DICT_DIR);
|
||||
#endif
|
||||
#endif /* USE_ENCHANT */
|
||||
|
||||
/* apply all options */
|
||||
|
||||
@@ -1180,6 +1180,9 @@ weechat_plugin_init (struct t_weechat_plugin *plugin, int argc, char *argv[])
|
||||
broker = enchant_broker_init ();
|
||||
if (!broker)
|
||||
return WEECHAT_RC_ERROR;
|
||||
#ifdef ENCHANT_MYSPELL_DICT_DIR
|
||||
enchant_broker_set_param(broker, "enchant.myspell.dictionary.path", ENCHANT_MYSPELL_DICT_DIR);
|
||||
#endif
|
||||
#endif /* USE_ENCHANT */
|
||||
|
||||
if (!spell_speller_init ())
|
||||
|
||||
Reference in New Issue
Block a user