We work with a number of translators. Most of them directly connect to our translation projects through Subversion. And some of them place the files on c: disk, some on h:, some on t:, and some somewhere deep in their directory hierarchy.
We use *.project files like these:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<omegat>
<project version="1.0">
<source_dir>__DEFAULT__</source_dir>
<target_dir>__DEFAULT__</target_dir>
<tm_dir>../../global/tm/</tm_dir>
<glossary_dir>../../global/glossary/en2es/</glossary_dir>
<dictionary_dir>../../global/dictionary/</dictionary_dir>
<source_lang>EN-US</source_lang>
<target_lang>ES</target_lang>
<sentence_seg>true</sentence_seg>
<support_default_translations>true</support_default_translations>
</project>
</omegat>
Please note that tm_dir, glossary_dir and dictionary_dir are relative paths. Since a translator sometimes open the project through Edit Project to allow the paths to be found, the relative paths are rewritten to the following when Edit Project is closed:
<tm_dir>H:/ws/translate/global/tm/</tm_dir>
<glossary_dir>H:/ws/translate/global/glossary/en2es/</glossary_dir>
<dictionary_dir>H:/ws/translate/global/dictionary/</dictionary_dir>
It would be handy if only entries that are touched by Edit Project were written back to the *.project file and the relative paths are kept as long as possible.
In the context of a local usage, absolute paths are more robust, when project are moved, than relative paths.
So, switching the behaviour to relative paths would require an option, keeping the current behaviour as the default one.
Didier
Agree. Did some analysis some time ago. See at end of comment.
Proposal:
Maybe change the number 2 (current code) or number 5 (sample code) into a constant that might be user changable in the future?
And then include a patch similar to sample code below?
Please note that current code does not handle the scenario with more than 1 step correctly, since it does not test on root==null.
In ProjectFileStorage.java I have found that there is already some relative addressing. Suggested change:
Last edit: Aaron Madlon-Kay 2016-09-07
<<
In ProjectFileStorage.java I have found that there is already some relative
addressing.
>>
Yes, if the path is one level above the project.
<<Maybe change the number 2 (current code) or number 5 (sample code) into a
constant that might be user changable in the future?>>
I would agree to integrate (after testing, of course) a patch based on a constant with value=2.
Didier
Ok. For our work, I would need value=3, but when the patch helps others with value 2 better, I have no problem having a permanent local change that just has to change one line reading '<=2' to '<=3'. Can you integrate it and test?
For such things, it's better to define a constant.
Please send me the patch privately.
Didier
Patch on it's way.
Implemented in TMX (/trunk).
Actually, 5 levels of relative addressing are kept.
After that, absolute addressing is restored.
Didier
Implemented in the released version 3.0.7 of OmegaT.
Didier