[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[ESD-translators] Proposition for a templating system
From: |
Thérèse |
Subject: |
[ESD-translators] Proposition for a templating system |
Date: |
Thu, 28 Aug 2014 15:53:23 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Icedove/24.7.0 |
Hello everybody,
This list is a really nice gift. Many thanks to whoever was involved in
setting it up!
It seems to be the appropriate place to discuss the choice of a
templating system. Zak talked to me about scaling up a system similar to
what I use [0]. So, as a proof of concept, I did that on a new Git
branch, "templates".
This branch has an additional folder in each language directory, called
"kitchen". [Why this name? Because the kitchen is where the foods which
will be served at the dining room table are prepared]. The kitchens
contain what is necessary to build the final pages:
- 4 templates: index.t.html (which generates the 3 main pages)
next_steps.t.html
confirmation.t.html
infographic.t.html
- 4 includes: header.i.html
translist.i.html
footer.i.html
javascript.i.html
- A link to pre-commit-install, a script which will install a pre-commit
hook for your language. When a template or include is committed, the
hook builds the corresponding pages and adds them. They are then
committed along with the template or include.
There is also a new directory: enc/esd-tools. It contains a few scripts,
and colored diffs showing the differences between versions of the
original pages. One of the scripts is pre-commit-install (that's what
the links point to). Another one is assemble-all-pages; it does the same
thing as the pre-commit hook, but you have to run it manually.
Each language has its own templates and includes. I made them from the
existing translations, but of course they need to be checked by the
translators. Don't be surprised if you see a few differences in the
markup, I fixed it so the pages would validate as correct XHTML (with a
few tweaks to accommodate the new HTML5 tags). If someone, someday,
wants to make POs from the translations, at least Po4A won't scream at
her for tags that don't match.
The system works entirely from the client side, so it can be used right
away. The English templates have been updated with the latest bug fix
(2014-08-27 Fixing a typo). If Zak wants to modify them directly from
now on, so much the better. Otherwise I will update them whenever the
pages are modified.
If this system is considered viable, the templates branch can be rebased
over master. And if some day someone comes up with a better system, it's
easy to delete the kitchen and esd-tools folders.
Best,
Thérèse
[0] http://libreplanet.org/wiki/GPG_guide/Site_and_Repo_Design_Ideas
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [ESD-translators] Proposition for a templating system,
Thérèse <=