Loco Translate: File modification is disallowed by your WordPress config.

On some WordPress installations Loco Translate may forbid the editing of language files by giving you a warning “Locked: File modification is disallowed by your WordPress config.“. This usually happens when you’ve used the constant DISALLOW_FILE_MODS in your WordPress configuration file (wp-config.php) to disallow any modifications in the files of your website.

In order to fix this issue, please add this code snippet to your theme functions.php file or place it in a must-use plugin:

<?php
add_filter('file_mod_allowed', function($allow_file_mod, $context){
  if(in_array($context, ['download_language_pack'])){
    return true;
  }
  return $allow_file_mod;
}, 10, 2);
?>
About the author
I'm a full-stack WordPress developer with a 10+ years of solid experience in the core web development languages, development processes / techniques, web security, Linux server management and with pretty good understanding about proper semantics, UX/UI, technical SEO, good design and basic knowledge of company leadership. On top of that - a distant 5+ years experience as a computer and electronics repair technician which often enables me to understand also how the things work at the hardware level.