Ask a Question related to PERL Miscellaneous, Design and Development.
-
A. Sinan Unur #1
Re: Translation with PERL?
[email]jmckinley@netbotz.com[/email] (Jon) wrote in news:43e4cdd3.0307141337.18259da7
@posting.google.com:
If you had been using ResourceBundles backed by property files, take a> I've been using Perl for the past two years on my companies website.
> I've also enlisted Embeded perl (mod_perl) which is very, very cool!
>
> I've been tasked with redesigning the site again and I must keep
> translation in mind. I've been involved before with translating a
> website that ran off JAVA, jsp pages and webshere. The translation was
> done with property files holding each language as well as image urls.
> My questions is can something like this be done with perl and apache.
> Can a property file be just a text file that is referenced for
> different languages?
look at the Config::Properties module:
[url]http://search.cpan.org/author/SALVA/Config-Properties-0.51/Properties.pm[/url]
Sinan.
--
A. Sinan Unur
[email]asu1@c-o-r-n-e-l-l.edu[/email]
Remove dashes for address
Spam bait: mailto:uce@ftc.gov
A. Sinan Unur Guest
-
Position translation
Thanks for this site, it has alot of information. I have a tag <sometag top=53 left=162> I was able to trnslate it into <input... -
Translation Patch?
There are any translation patch to the 3.0 version? -
DCR File Translation
Hi, I was looking at the source code of the HTML file created, when publishing my movie, and it has <OBJECT CLASSID...> What does that actually... -
qtvr translation
hello, anyone knows what's the script to "translate" a qtvr panorama whit the help of a button? thanks Pim, Holland -
Translation
I use the Dutch version of Elements V2 for about half a year now. Today I noticed for the first time something funny in the filter menu. Obviously... -
Bart Lateur #2
Re: Translation with PERL?
Jon wrote:
Yes.>The translation was
>done with property files holding each language as well as image urls.
>My questions is can something like this be done with perl and apache.
>Can a property file be just a text file that is referenced for
>different languages?
As someone else pointed out, you can use modules to manipulate config
files to load the data. I myself would take a good look at YAML, which
provides a neat way to store perl data structures in rather plain text
files. Or you could use tabs separated text files (or CSV), and edit the
data in a spreadsheet like Excel.
If this is for mod_perl, it might be interesting to cache the data in an
itnernal global data structure (untested, but I think it should work).
That is: violate the strict separation of data spaces between scripts on
purpose, and use a global variable.
You can hang whole hashes off a subkey, for example
$text{NL}{title}
could hold the title for Dutch... while *all* translations for Dutch
hang under $text{NL}, which is a hash ref.
In this case, unless you want to have to restart the server every time a
translation changes, you should include a make-like system that check
the date of the last update of a file, and reload the data if the data
file had been changed. Be careful to include locking, you don't want to
reload the same data structure in two scripts at approximately the same
time.
--
Bart.
Bart Lateur Guest
-
Jon #3
Re: Translation with PERL?
Bart Lateur <bart.lateur@pandora.be> wrote in message news:<b1i7hv842prlkpshg45d4q1p3kap7qk3fp@4ax.com>. ..
> Jon wrote:
>>> >The translation was
> >done with property files holding each language as well as image urls.
> >My questions is can something like this be done with perl and apache.
> >Can a property file be just a text file that is referenced for
> >different languages?
> Yes.
>
> As someone else pointed out, you can use modules to manipulate config
> files to load the data. I myself would take a good look at YAML, which
> provides a neat way to store perl data structures in rather plain text
> files. Or you could use tabs separated text files (or CSV), and edit the
> data in a spreadsheet like Excel.
>
> If this is for mod_perl, it might be interesting to cache the data in an
> itnernal global data structure (untested, but I think it should work).
> That is: violate the strict separation of data spaces between scripts on
> purpose, and use a global variable.
>
> You can hang whole hashes off a subkey, for example
>
> $text{NL}{title}
>
> could hold the title for Dutch... while *all* translations for Dutch
> hang under $text{NL}, which is a hash ref.
>
> In this case, unless you want to have to restart the server every time a
> translation changes, you should include a make-like system that check
> the date of the last update of a file, and reload the data if the data
> file had been changed. Be careful to include locking, you don't want to
> reload the same data structure in two scripts at approximately the same
> time.
Very Cool Guys. Thanks. I've been looking into the Config modules,
didn't even know they were there. Look like they'll do the job. Thanks
again.
Jon Guest
-
Rich #4
Re: Translation with PERL?
Jon wrote:
Hi Jon,> I've been using Perl for the past two years on my companies website.
> I've also enlisted Embeded perl (mod_perl) which is very, very cool!
>
> I've been tasked with redesigning the site again and I must keep
> translation in mind. I've been involved before with translating a
> website that ran off JAVA, jsp pages and webshere. The translation was
> done with property files holding each language as well as image urls.
> My questions is can something like this be done with perl and apache.
> Can a property file be just a text file that is referenced for
> different languages? I'm just hoping some of you out there can give me
> a little advice before I start this project. Any ideas or help are
> greatly appreciated.
>
> Jon
Locale::Maketext with Locale::Maketext::Lexicon is the most sophisticated
way to go ATM. You could then use .po[t] format files which are supported
by translation tools such as kbabel.
Another poster suggested something based round YAML - I like YAML, but I
don't think YAML.pm handles utf8 encoding yet, which would probably be a
show stopper.
Cheers,
--
Rich
[email]scriptyrich@yahoo.co.uk[/email]
Rich Guest



Reply With Quote

