-
Notifications
You must be signed in to change notification settings - Fork 32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Permissions issues? Missing folders? #12
Comments
Looks like there might be a bug in Poedit, so I have just another quick question for you. Which version of poedit have you successfully used with your script? |
@Saeven Hehum...strange. I used it with 1.5.4-1. |
Sorry to be daft, I'm partway trying to ascertain that I'm not crazy. Can you tell me what you have in your catalog preferences in the sources path section? |
Also, what OS were you using 1.5.4-1 with? |
I suggest to test with simplest data possible, one simple string. I'm using Ubuntu 13.04. |
Sorry to be a pain, but could you share a sample catalog config in sources path? |
Unfortunately, I have no. But you can try with one string catalog. |
Same issue here - I'm on Mac OS X |
@arekkas Can you debug it? |
it seems like poedit is telling xgettext to use a file that is inside a directory, poedit has not created yet. Which is weird, because the other parsers work. |
The problem is, I can't really see why the command fails in poedit, only when executing it directly from cmd I see the error messages. However, when I modify the |
You can go into |
True, I'll have a closer look tomorrow |
I had the same, or similar issues, as described here (and in other issues here). I'm on OSX. After picking Twig-Gettext-Extractor apart and rebuilding it again I found out that I only had to do three things (2 of them not described in the readme.md file).
It seemed that PHP didnt find "gettext" because PHP wasn't allowed to look in /opt/local/bin. That caused all other issues I had basically. But it was very hard to debug. Ping @umpirsky FYI. :) It would be nice though if the twig-gettext-extractor could run as a service in a symfony/console command instead though. I tried to do that but I have yet to solve how that could be done. Or maybe if you could create a twig-gettext-extractor file that included the vendor/bin/twig-gettext-extractor file and only had to contain your custom extensions. This way makes it a bit less easy to keep up to date if/when Twig-Gettext-Extractor updates. But, well. It works now at least... I think. :) |
@feedmeastraycat Thanks for sharing this man! I didn't understand point 2. Did you copy extractor to poedits dir? I would like to keep this decoupled from Symfony. People use it with other frameworks too. But I would like to see people integrating it with frameworks too. |
@umpirsky No. My .pot file is located in /src/locale/ inside the project so I put base path to "../../" in Catalog > Properties > Sources path within Poedit. Then I have added "./src/views" in "Paths". And then I have "./twig-gettext-extractor" when I setup the twig parser. It seems that Poedit (1.6.5) understands that "./twig-gettext-extractor" is within the base path. I had to copy twig-gettext-extractor from /vendor/bin/ because I needed to add some more extensions. Here is a screenshot of my parser setup: Here is a screenshot of my pot-file catalog properties: Im still unsure if the example of The only problem I have now is that I want to use the I understand that you wanna keep it decoupled from Symfony though. Makes sense. I will probably revisit that again and see if I can put it into the console. |
You should replace with the full path to where your project lives. 😸 But I agree, it is not handy for project switching. Thanks for the effort, really appreciate it. |
@umpirsky Ok. Thanks. :) I wasn't sure from the readme if it was a placeholder or some poedit var. :D But cool. Now I know. But I'll keep |
I finally got it working, you need to execute POEdit (on Mac) like this: Source: http://circlical.com/blog/2013/11/5/localizing-your-twig-using-zend-framework-2-applications |
Works like a charm now, even with ZF2 :) |
@arekkas Thanks for sharing. If this works on Mac I will accept PR with MacOS section instruction. |
I'm on OSX Yosemite and the issue of missing folder under "/var" still continue. There are many OSX users that have same problem? Thank so much! |
@barmarko27 Have you tried #12 (comment)? |
@umpirsky Yes, but don't work! It seems that Poedit can't delete the temp file. Poedit Command Line Execution: Thanks for your support! |
@arekkas Any idea why it does not work for @barmarko27? Thanks. |
With the latest POedit version, you don't need You'll also need to make sure that the path to |
@arekkas Yes the path to twig-gettext-extractor is correct. It seems that Poedit can't delete temporary folder after execution of Twig Parser. Thanks for helping me! |
Is it a permission problem? |
@barmarko27 did you start POEdit without |
Platform: MacOS Yosemite 10.10.4 (14E46) When I starting Poeditor without parameters and trying to update translation from source, poeditor throws described error. With --keep-temp-files or with WXTRACE=poedit,poedit.tmp,poedit.execute exception is different: Can't remove directory '/var/folders/7f/hv40gb8x4cgg0v7wsbkm4djr0000gn/T/poeditQ3Mdg2' (error 66: Directory not empty) Any idea? |
Doesn't look like a real path to me ;) |
Yes, real path has sensitive client data in names. But trust me - path is correct. |
I see :) |
In trace everything looks fine... Trace data before exception: Trace: (poedit.tmp) new temp file /var/folders/7f/hv40gb8x4cgg0v7wsbkm4djr0000gn/T/poeditmG51sW/14extracted.pot |
Just checked content of /var/folders/7f/hv40gb8x4cgg0v7wsbkm4djr0000gn/T/poeditmG51sW/ directory and 14extracted.pot not exists in there. |
same problem here. Trace: (poedit.tmp) removing temp file /var/folders/cz/3_w92y755tg8ksbss737427m0000gn/T/poeditwRmF08/0extracted.pot |
Having the same problem:
Any Updates on this? |
@jeremyzahner MacOS? |
Yes! Sorry for leaving out that detail ^^ |
@jeremyzahner The problem is that I am a Linux user myself and project is tested on OSX by other users. Have you tried @arekkas suggestion from #12 (comment) ? |
I can confirm this issue with recent POEdit versions. It works neither with |
Sorry, it’s not really clear what you’re asking about — this issue is a bit of a mess to read through and I can’t quite make sense of all it. If you have a reproducible test case (one that doesn’t take half an eternity to setup), by all means, send it to me to have a look. Without that, just a few assorted observations:
(BTW, I’m reworking extractors completely for the next major version (don’t worry, there will be “legacy” compatibility) and am soliciting any extractors-related feedback from, you know, real users of custom extractors — feel free to ping me at the above email address). |
This will fix our issue 100%. It would be great if you could implement that! |
I feel like I might have not been as clear as I thought I was, so let me repeat myself in the interest of being absolutely clear: DO NOT EVER USE It doesn’t solve anything and is not meant to be used by end users! If it does seem to help you with something, please show me a reproducible test case of what it solves, using the latest Poedit version, and I’ll fix that, because that would uncover some serious issue — but to be frank, I simply don’t see how could anything of the sorts be possible. |
Well I believe that the issue is as follows: twig-gettext-extractor converts *.twig (no native POEdit/xgettext support) files to *.php files. These get stored in a temp dir and then iterated by xgettext. Somewhere inbetween, these files get deleted which is why xgettext is saying that they don't exist. This issue was "resolved" by telling POEdit to keep the files. That's at least what I think is happening. |
I see two problems with that theory:
I’m more and more confused by the minute :-/ |
I'm sorry but I'm not sure if I can help you further. I ran into this issue some years ago and found the |
Thanks for your response and willing to help @vslavik, I really appreciate it. One thing is sure. I am 100% sure cache directories of Twig and Poedit are not shared. No doubt about that. I never encouraged people to use I agree this issue is too verbose and hard to read, so for the sake of sanity let's just wait for some Mac user to come up with proper and easy to reproduce test case. Now we have @vslavik who is willing to take a look and I am very thankful. 👍 |
Still a mystery, then. Let’s wait for more details as you say, then.
Of course! I just wanted to clarify this for readers of this issue. |
Keep temp files did indeed fix things for me once upon a time: It was in a debug command that @vslavik had recommended during a test run. |
According to the archive it was the act of running Poedit from command line that did, not the flag itself:
That makes sense to me: it’s a very different runtime environment (in particular, your shell customizations are loaded, unlike when launching from Finder) and e.g. it could be that you can’t even successfully run some php scripts in the Finder-launched environment. Maybe that’s indeed what’s going on here. Thanks for this link, I forgot all about it! |
Make sure TempDirectory dtor always removes Poedit's temporary directory completely, without errors. There were two subtle bugs in the old code: 1. Poedit would try to rmdir the directory even with --keep-temp-files. This would fail because the files weren't deleted. 2. If something created unexpected extra files, rmdir would fail too. Fix both by recursively deleting the directory with its content, instead of doing the same thing manually, but only for recognized files. As a bonus, make the code slightly simpler. See umpirsky/Twig-Gettext-Extractor#12
@vslavik Thanks, in which version of Poedit will vslavik/poedit@849367f be included, just for the reference for people that step across this issue? |
The next one (1.8.7), but this rmdir thing is a red herring, this change only affects debugging use and misbehaving extractors (which yours isn’t). |
Any of you developers using this on OSX? I'm running into an issue where the call to your library:
Fails with this error message:
So attempting to run that command directly leads to:
All PHP these PHP scripts are owned by Me:admin on my filesystem. Seen this before?
The text was updated successfully, but these errors were encountered: