Hi susox,
You are modifying the right file and your approach is also correct.
A more efficient way of achieving your requirement is to add the following code to the file class-wdm-contact-form-7-public.php
$current_website_language_code = substr(get_locale(), 0, 2);
if($current_website_language_code!=$language_code){
$language_code=$current_website_language_code;
}
The above code will serve your requirement and will change the captcha to whatever language your website is set of.