.. | ||
config | ||
collect_omegat_project_data.py | ||
common.py | ||
merge_omegat_glossaries.py | ||
README.md |
Little Tools for Working with OmegaT
The scripts in this directory are described below.
Collect OmegaT Project Data
Overview
This script finds all OmegaT projects in a user-specified folder and its subfolders, and copies the default main memory ("project_save.tmx") and glossary ("glossary.txt") files to a destination folder selected by the user. The copying operation creates a subfolder for each project in that destination folder, renames both the memory and glossary files to match the project name, and copies then to the corresponding subfolder.
The original idea for the script came when my workplaced imposed a switch from OmegaT to a different CAT tool, and we were told to copy our existing memories and glossaries to a shared network folder.
The idea of manually going through various folders and subfolders, renaming each "project_save.tmx" and "glossary.txt" file to something more meaningful, and copying them to the shared folder was distinctively unappealing.
I managed to write an ugly, but functional script that did the bulk of the work. The script here is a rewrite based on the original idea.
Usage and Requirements
Simply run the program from the command line or your favourite IDE. Select the folder from which you want to copy OmegaT project memories and glossaries the first time a dialog pops up. In the second dialog select the destination folder. The name of the file being copied is output to the console while the script is running.
The script relies on the pathlib
module and should, in principle, work on Python 3.4 or later but has only been run under Python 3.10.
Limitations
- The default OmegaT project subfolder hierarchy is assumed. Projects in which the names or locations of the subfolders in the OmegaT project hierarchy will not be recognized.
- Glossaries other than the default "glossary.txt" file are not recognized or copied.
- The destination folder for the files must be exist before the script is run because the folder selection dialog does not offer an option to create a new directory.
Possible Improvements
Since I currently only use OmegaT on occasion for personal projects, progress on improvements is likely to be slow, but listing them here will ensure the ideas are not forgotten.
- Copy other reference glossaries in addition to the default glossary file.
- Accommodate user-defined project structures directory names, and choice of files to copy.
- Allow users to create the destination directory from the folder selection dialog.