Tips_and_Hacks/fix corrupt project/Fixing a corrupt translatio...

4.0 KiB

If you receive a .tstudio file that is corrupt and can't be opened by translationStudio, the first step to take should be to try to get another copy of the data.

  • On Windows, the original (working) files for translationStudio are in %AppData%\..\local\translationStudio\targetTranslations. Backups are in %UserProfile%\translationStudio\automatic_backups and the default export folder is %UserProfile%\translationStudio\backups.
  • On Android, the original (working) files for translationStudio are in Internal Storage/translationStudio and the default export folder is /storage/emulated/0/Download/translationStudio.
  • On Mac, the original (working) files for translationStudio are in ~/Library/Application Support/translationstudio/targetTranslations. Backups are in ~/translationStudio/automatic_backups and the default export folder is ~/translationStudio/backups.
  • On Linux, the original (working) files for translationStudio are in ~/.config/translationstudio. Backups are in ~/translationStudio/automatic_backups and the default export folder is ~/translationStudio/backups.
  • Note that on Mac and Linux systems file names and paths are case-sensitive, and the working files are in a folder written all in lowercase: translationstudio. Also note that if you are using the terminal, the space in Application Support will need to be escaped: ~/Library/Application\ Support/translationstudio/targetTranslations/.

If you are unable to re-export the project, or the backup in automatic_backups is corrupt, and you are unable to access the files in the working directory, you can try to repair the project file. A project file is a zip file, although its extension is .tstudio. If the project is not corrupt, you can unpack it by using unzip _projectname_.tstudio at the command line in Linux or MacOS. Because it is a zip file, even a corrupt project may be repaired using the built-in zip program. zip -F causes zip to try to fix the archive file. Ideally, you will copy this fixed data into a new file, in case you want to do more work on the original file. For example, if the project file ln_act_text_reg.tstudio is corrupt, I would try to fix it by typing zip -F ln_act_text_reg.tstudio --out ln_act_text_reg.zip. You could also use ln_act_text_reg_fixed.tstudio for the new file name. Notice that there are two dashes before the out parameter, but only one before the F. If the project is still not readable after this process (by uncompressing — if the manifest.json has been damaged the tstudio file won't be usable by translationStudio even if the archive is now correct) you can try again by doubling the F. Thus, zip -FF ln_act_text_reg.tstudio --out ln_act_text_reg.zip. This will scan the project more deeply, and may succeed where the single fix fails. Once you have properly extracted the data, you may need to do some work to get translationStudio to work with it. What has worked for me, since I don't completely understand the translationStudio manifest format, yet, is to create a project in translationStudio for the same language and book as the damaged file. Then, I quit translationStudio and copy the data from the unzipped project file into the appropriate folders in the working directory. (Each chapter has its own folder.) On Linux and Windows you can just drag the files from the uncompressed zip onto the appropriate working directory and the operating system will take care of updating the contents of each folder. On MacOS the finder will delete the target folders first, copying the new data without preserving the old. In this case, open each folder and copy the contents one chapter at a time. You will probably find that at least some of the work done by the translators has been lost, and the new project should be checked by people who speak the target language, but if the project is not too badly corrupted you can save a lot of work this way.

Copyright © 2017 John Wood for Wycliffe Associates Tech Advance. Available under Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)