umpirsky / Twig-Gettext-Extractor

The Twig Gettext Extractor is Poedit friendly tool which extracts translations from twig templates.
MIT License
113 stars 32 forks source link

my twig files are not parsed #9

Closed nicosomb closed 7 years ago

nicosomb commented 11 years ago

Hello,

I've installed Twig & Twig-Gettext-Extractor via composer.

Here is my composer.json:

{
    "require": {
        "twig/twig": "1.*",
        "twig/extensions": "1.0.*@dev",
        "umpirsky/twig-gettext-extractor": "1.1.*"
    }
}

When I use Poedit, the strings are well displayed. I can translate it, my po / mo files are created. But the po file says to me that the string was found in a cache file:

#: /tmp/cache/51fd25b76ee97/72/75/7c1ff7f7c9c14f7baaedd47772e2.php:31
msgid "installation"
msgstr "installation"

I believed Twig-Gettext-Extractor would parse twig files, and not cache one.

Can you explain me where I'm wrong please ?

nicosomb commented 11 years ago

More infos.

I execute this command in a terminal :

/var/www/poche-i18n/vendor/bin/twig-gettext-extractor --sort-output --force-po -o %o %C %K -L PHP --files %F

Here is the result :

xgettext: Erreur lors de l'ouverture de « %C » en lecture: Aucun fichier ou dossier de ce type
PHP Fatal error:  Uncaught exception 'RuntimeException' with message 'Gettext command "xgettext --sort-output --force-po -o %o %C %K -L PHP /tmp/cache/51fd28213a2bb/bb/cc/dbe7e06204ea603fb57711d32746.php" failed with error code 1 and output: ' in /var/www/poche-i18n/vendor/umpirsky/twig-gettext-extractor/Twig/Gettext/Extractor.php:79
Stack trace:
#0 /var/www/poche-i18n/vendor/umpirsky/twig-gettext-extractor/twig-gettext-extractor(58): Twig\Gettext\Extractor->extract()
#1 {main}
  thrown in /var/www/poche-i18n/vendor/umpirsky/twig-gettext-extractor/Twig/Gettext/Extractor.php on line 79

If I do only this command :

xgettext --sort-output --force-po -o %o %C %K -L PHP /tmp/cache/51fd28213a2bb/bb/cc/dbe7e06204ea603fb57711d32746.php

The result :

xgettext: Erreur lors de l'ouverture de « %C » en lecture: Aucun fichier ou dossier de ce type
nicosomb commented 11 years ago

Hi,

Did you see my issue?

umpirsky commented 11 years ago

@nicosomb Hi, sorry for not responding. I'm too busy now.

You can try to debug it, check if file is created by extractor and why xgettext cant open it.

nicosomb commented 11 years ago

ok, thank you for your answer.

umpirsky commented 11 years ago

@nicosomb If you find more info, or have question, feel free to share them here, I will answer and try to help as much as I can.

nicosomb commented 11 years ago

OK, I will try to do my best ;-)