Issue #3301239 by @immaculate.x : Check if the file is correctly opened before trying to write the translation file contents to it.
Closes #3301239