chelobaka / simple-latex-filter

Simple LaTeX filter for OmegaT
GNU General Public License v3.0
4 stars 1 forks source link

Custom configuration ignored by the filter #2

Closed marcocevoli closed 1 year ago

marcocevoli commented 1 year ago

Hi,

If I mark the option to load a custom configuration file and then edit the file (that is correctly created in OmegaT configuration folder), all edits to the JSON configuration file are ignored, even though I close and restart OmegaT.

Which folder is being monitored by the filter?

I'm 100% positive that my modifications are syntactically correct because I tried to edit the config.json inside the JAR file and load that edited JAR files, and - in doing so - my modifications are taken into account.

I really appreciate any help you can provide.

Marco

chelobaka commented 1 year ago

@marcocevoli did you enable user configuration in filter settings?

marcocevoli commented 1 year ago

Yes, I did. And the custom configuration JSON file is created correctly in the OmegaT user configuration folder. However, if I edit that file, the changes are not taken into account, as if the filter isn't reading the JSON file.

EDITED on 08/09/2023: I think that this issue depends on the location of the default user configuration folder. I vaguely remember that the location changed in the latest OmegaT versions, but I'm not sure. Fact is that any edits to the file are ignored (tested on several computers, same results).

chelobaka commented 1 year ago

Search for [SimpleLatexFilter] in OmegaT log. It should say where the plugin looks for configuration file. The path is not hardcoded but requested by the plugin from OmegaT. I run Linux and user configuration works for me, though it wasn't tested with other OSes.

marcocevoli commented 1 year ago

Thanks, Lev. I don't have specific information about the configuration file. I only have this info regarding SimpleLatexFilter:

04932: Info: Jar used for plugins: file:/C:/Program%20Files/OmegaT/plugins/SimpleLatexFilter-fat-0.3.jar (PLUGIN_LOAD_JAR)

I'm on Win 10.

chelobaka commented 1 year ago

There is another way. Open OmegaT scripts and run this to get configuration directory:

import static org.omegat.util.StaticUtils.getConfigDir;
getConfigDir();
marcocevoli commented 1 year ago

Thanks again. Indeed, with that code I get the same result as with Access Configuration Folder command. What puzzles me is this: if you check the checkbox, the custom configuration file is correctly created in that folder.

However, until now, the plugin didn't consider any changes to that file.

Now it works, so - apparently - I did something wrong before... If the issue occurs again, I'll let you know.