Jonns Mostovoys
unread,Jun 19, 2012, 2:17:44 AM6/19/12Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to erlydt...@googlegroups.com
Greetings, gentlemen.
I have a couple of questions —
1. is it possible to use unnamed arguments in custom tags? If 'yes' then how?
> {% f "42" %} as opposed to {% f x="42" %}
I have on the dtl side of things index_2.dtl template containing
> {% t "Test" %}
On the application side of things I try to make the following call
> erlydtl:compile("./site/templates/index_2.dtl", index_dtl, [{out_dir, "./site/ebin/"}, {custom_tags_modules, [saloon_lang]} %not doing it with rebar for a reason
And in the end I get the following parser error —
> site/src/saloon_main.erl:17:<0.5020.0>: erlydtl:compile: {error,{"./site/templates/index_2.dtl",
> [{{1,6},
> erlydtl_parser,
> ["syntax error before: ",["\"\\\"Test\\\"\""]]}]}}
When I change the template to
> {% t x="Test" %}
things begin to work :)
I thought that I should fix the grammar/AST generator myself, but fell into trying to trace the logics of machine-generated code,
and thus I'd be glad to hear about what am I doing wrong, what to do and where to lurk.
2. Wtf line 22 i18n/i18n_manager.erl? Was it tested? Why did it work?
3. Does anyone use {% trans ... %} feature? Is it me or its usage is currently a minefield (see 2.). If anybody uses trans, please
share your workflow because I have little to none ideas how to interconnect Erlang's gettext equivalent with erlydtl.
Thank you gentlemen for replies,
honoured to use such a great open source product,
Jonn Mostovoy.