Hey everyone,
I got a project which is an existing and running website completely built in perl. No html, CGI-only. My perl CGI-scripts looking like:

#!/usr/bin/perl # Includes use strict; use warnings; ... print "Content-type: text/html\n\n"; my $sHTML = qq{ <html> <header> <title>Some title</title> </header> <body> }; $sHTML .= &MyPackages::MyFunctions(); $sHTML .= qq{ <p>SomeText</p> </body> </html> };


My task is to make this website multilingual. I'm actual doing research and try to find some great concepts which would fit to me. So I just wanted to ask you if anyone of you got some ideas for me how to do this.

I know some ways to do this if you're having html files and using PHP for dynamic content. I read about a simple database solution (get text from db) or a way to use the html-lang attribute. For now I would say the html-lang attribute won't work in my case, because usually you build multiple directory structures to store pages in each lang. In my case due to CGI this would mean any change on the website needs to be done on X-files. In my opinion this is a very bad idea...

I also found this A multilingual solution for PERL CGI web applications solution which was looking okay. But in case that I do use a database, I could also just store it there, which will be more effective I think.
Then I found some people using a perl Modules (Template-Toolkit, i18n, Locale::Maketext::Simple, Template::Multilingual, ...) and I took a look on them but right now I don't know if I can even use them in my case. How would this looks like if you got an built page like I got (example shown above)?
I'd like to add a information for this website, it is an multiple-client multiuser website.

Thank you so far.
Best regards.


Update:
Do you got an idea how do I use this if I got a dynamic website? Do I have to edit the template every time? Example: My website gets data out of a database to fill tables.

Ohh, just found: http://www.template-toolkit.org/docs/tutorial/Web.html#section_Dynamic_Content_Generation_Via_CGI_Script this - I'll try to do that

Update 2:
Okay, it's cool how it works, but which way do you think is better? Using differet templates for each language or still using 1 template and just retrieve information texts out of the database?

In reply to Concepts of multilangual CGI-Website? by Yaerox

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.