mmontone / djula

Common Lisp port of the Django templating language
http://mmontone.github.io/djula/djula
MIT License
152 stars 21 forks source link

accessing djula internals. #37

Closed aarvid closed 7 years ago

aarvid commented 7 years ago

I have a one-off project to generate and update cl-locale's message.lisp dictionary files from Djula Html Template files. I have decided to clean it up and release it figuring others could use it.

Currently the project uses the internal function djula::parse-template-string and searches for :unparsed-translation-variable to find the strings that need to be translated.

Is there a better way without accessing this internal function?

mmontone commented 7 years ago

Hello.

I don't think there's a better way. Your approach sounds correct. That's what I would do. Match translation variables on the parsed template representation.

Note that I've changed the internal parsing of translations. It is not :unparsed-translation-variable anymore. I've switched it to :unparsed-translation. Please look at the last commit of the repo.

mmontone commented 7 years ago

You may want to release it as a separate project, or you can integrate it directly to Djula and make a pull request. I think it would be a useful thing in general to be integrated into Djula.

aarvid commented 7 years ago

I will look into integrating it into djula given that it uses an internal function liable to change.

aarvid commented 7 years ago

merged