Skip to content
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

version 0.1.0 target #1

Closed
5 tasks done
glensc opened this issue May 12, 2017 · 5 comments
Closed
5 tasks done

version 0.1.0 target #1

glensc opened this issue May 12, 2017 · 5 comments

Comments

@glensc
Copy link
Member

glensc commented May 12, 2017

rewrite tsmarty2c to something maintainable.
(originally in smarty-gettext/smarty-gettext#18)

@glensc
Copy link
Member Author

glensc commented May 12, 2017

(originally in smarty-gettext/smarty-gettext#18 (comment))

geekwright/po - looks like it already has smarty parser: https://github.com/geekwright/Po/blob/master/src/PoInitSmarty.php

it uses $smarty->getTags, but that returns just tag, and tag attributes, what's between the attribute is not known. {t arg=1}text{/t} <- text is not returned by that method.

@petski
Copy link

petski commented May 16, 2017

use some library from Packagist to write .po files

Have you seen https://github.com/oscarotero/Gettext ?

@petski
Copy link

petski commented May 16, 2017

FWIW: because this project isn't finished yet, I currently use this work-around:

$smarty->clearCompiledTemplate();
$smarty->compileAllTemplates('.html', true);

Then I do something like this on the shell to get my .po(t) file:
xgettext --output=/tmp/smarty.pot ... --language=PHP $smarty->getCompileDir() . '/*.html.php';

This approach actually works quite good. Unfortunately, the comment for each msgid references a line in the compiled template instead of the actual template. (Which isn't an issue for me at this moment).

If the latter would be an issue for the end-user, there might be a way to hook into the smarty compiler and keep track of a compiled_file -> template_file map.

@glensc
Copy link
Member Author

glensc commented May 16, 2017

i have full cycle working with geekwright/po here locally, just haven't got around naming classes properly, so not published :)

for smarty parser, it's commited, waiting for #2 to be merged.

i'll check https://github.com/oscarotero/Gettext

@glensc
Copy link
Member Author

glensc commented Sep 10, 2017

0.1.0 has been released.

providing .phar and more features can come later! :)

@glensc glensc closed this as completed Sep 10, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants