Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

How to build a static multilanguage site with TT?

by danmcb (Monk)
on Nov 28, 2008 at 05:20 UTC ( [id://726518]=perlquestion: print w/replies, xml ) Need Help??

danmcb has asked for the wisdom of the Perl Monks concerning the following question:

I am making up a website that contains only static pages, using Template Toolkit. Original pages are in Dutch, but an English version is also required. So I will have template pages that look like this:

<p>Ik woon in Antwerpen.</p>

I need an easy way to rip these strings out of the xhtml-like templates (no worries if the odd span or b tag gets left in, but paragraphs should be intact), and writes them into a file(s) to be translated. The template also needs to be re-written as (something like) ...

<p>[% _tx(Ik woon in Antwerpen.) %]</p>

... so that TT can make the relevant substitution at the final pass

Now, I am far from the first to travel this road ... so I don't want to be making any new wheels. Does anyone know where I can borrow some old ones that work well enough?

Replies are listed 'Best First'.
Re: How to build a static multilanguage site with TT?
by Anonymous Monk on Nov 28, 2008 at 06:37 UTC

      I have done this recently. I build the templates with id's instead of text, and then put the text in an excel spreadsheet. Each col is a language. I use CPAN modules to pull the translations out of the spreadsheet and generate the pages.

      The beauty of doing this in Excel is that you can throw your texts to humans and most of them will be able to cope with this format.

      I have the code at home, will look it out for you if you wish. It may be a bit gnarly but it is very functional.

      (Funnily enough, ik woon in Antwerpen ... yes really ...)

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://726518]
Front-paged by ysth
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having an uproarious good time at the Monastery: (4)
As of 2024-04-19 13:41 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found