poedit
poedit copied to clipboard
Allow user to locate source tree
version 1.8.11 - Mac
[ ] Not possible to enter absolute path [ ] Not possible to enter arbitrary path [ ] It's unclear what the base path is - should be explicitly the .po file location
The only way that appears to work on Mac is to start poedit from command line explicitly and the current path is then used as base path.
[ ] Not possible to enter absolute path
And intentionally so. Using unportable absolute paths is an incredibly misguided, bad idea. Such files were always malformed and regularly broke things, and 1.8 simply has better UI that doesn’t allow you to break things like that.
[ ] Not possible to enter arbitrary path
I don’t know what you mean by this. You can choose any (i.e. “arbitrary”) path, so this doesn’t appear to be true at first reading, which must mean I misunderstand you?
[ ] It's unclear what the base path is - should be explicitly the .po file location
It should not (if it were that, it would have never existed as a setting in older Poedit versions, would it?). It’s the common base of all the search paths. As for it being unclear, it’s shown in the UI — how could it be any more clear than that?
As a rule of thumb: Don’t worry about this stuff. Just add the paths you want searched and it will do the right thing.
The only way that appears to work on Mac is to start poedit from command line explicitly and the current path is then used as base path.
Not true, see above. Maybe it’s an unintended effect on some malformed PO file, though.
OK. Thanks for a super quick response. I agree on the absolute path - the point came from not being able to get the relative paths to work.
What I meant "arbitrary" was that picking a path depends on its existence. I can't configure the path and later copy source code there. But maybe this is a fringe use case.
The specific use case I have (and it's not obvious to me how to make it work).
I have a x.po
file with hints for source code in the format ../src/main.c
I'm editing a file which is outside of that assumed tree.
My assumption was that I can add a search path to point to where the x.po
lives originally and have poedit show the source code correctly.
(I'm editing the po
file on a local disk and have the source code on a mounted r/o directory).
(Not so quick now — sorry, I overlooked the GH notification.)
I can't configure the path and later copy source code there. But maybe this is a fringe use case.
I’d indeed say it is. OTOH, the problem with entering non-existent paths and then being confused why update report errors was far more common.
My assumption was that I can add a search path to point to where the x.po lives originally and have poedit show the source code correctly.
No, the source paths are for extraction from source code (see the description at the top of the respective properties tag). There’s no way to do what you want in Poedit. This would need to be set in the file viewer window and I think it would nice to have that ability, but honestly, it’s such a rare case that I’m very unlikely to get to it anytime soon, realistically speaking.
@DjangoFR Please actually read the issue before you add a random comment with tons of exclamations points to it. You're welcome to submit a PR if you think you can improve the situation, but your comment adds nothing to the issue.
I have the same problem. I assumed the source paths were used like the PATH
environment variable.
I think if you extract from source code using those folders, it makes sense to also detect said folders in the file view.
My understanding is that it boils down to adding an extra loop to look through all the search paths here:
https://github.com/vslavik/poedit/blob/master/src/fileviewer.cpp#L305
Which requires adding an extra member for the list of search paths here:
https://github.com/vslavik/poedit/blob/master/src/fileviewer.h#L64
And loading said member here:
https://github.com/vslavik/poedit/blob/master/src/fileviewer.cpp#L321
(probably through calling to GetSourceCodeSpec
, or maybe creating another method for just retrieving the search paths).
Seems (theoretically) fairly simple if anyone's up for submitting a PR.
I assumed the source paths were used like the PATH environment variable.
You assumed wrongly, with no basis in the UI or the docs and contrary to how gettext tools (not Poedit) work.
Seems (theoretically) fairly simple
@vToMy Then make a PR. If you are not up to it, to quote you, then please don't pollute issues with pointless comments. Such advise how to implement it, based on cursory skimming of the code, is not valuable and is, as a matter of fact, bad.