Hi,
I spotted strange behaviour of verifiers/verification in Studio.
Pre-conditions
- The “Enable verification of segment” check box is ticked.
- Verifier is not enable on verifier list.
- I don’t check in plugin code if my verifier is Enabled
<SettingsGroup Id="LanguageTool Plugin"><Setting Id="Enabled">False</Setting></SettingsGroup>
Behaviour
When I run verification with F8 key Studio doesn’t execute verification and it is intended and correct behaviour.
But when I confirm segment Studio execute verification and it is not behaviour I wanted.
Question
What is the cause of such inconsistent behaviour?
Workaround
Because this is a verifier it would be better to explicitly disable a verifier. Verifier should be enabled by default. It means verification should be executed even if there is no <SettingsGroup Id="LanguageTool Plugin"> in project settings/sdlproj file. Projects created on machines without given verifier will not have such settings. It is more safe to run verification than not to run. User may not be aware that verification wasn’t executed and could think there are no errors.
That is way I add something like that to my code to check if <SettingsGroup Id="LanguageTool Plugin"> contains Setting Id="Enabled.
I think it is good approach and it may be implemented for example to Number Verifier. I know many translators reported that Number Verifier "doesn’t run".
var settingBundle = _sharedObjects.GetSharedObject<ISettingsBundle>("SettingsBundle");
var settingGroup = settingBundle.GetSettingsGroup(SettingsId);
if (settingGroup.ContainsSetting("Enabled"))
{ _enabled = settingGroup.GetSetting<bool>("Enabled");}
else
{ _enabled = true;}
Best regards,
DArek