Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

English to German

by kutty1 (Initiate)
on Jul 03, 2007 at 06:42 UTC ( [id://624601]=perlquestion: print w/replies, xml ) Need Help??

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

This node falls below the community's threshold of quality. You may see it by logging in.

Replies are listed 'Best First'.
Re: English to German
by Zaxo (Archbishop) on Jul 03, 2007 at 07:04 UTC

    Apache has language selection features for serving multilingual sites. See their manual.

    Perl is a computer language that is indifferent to what language encoding it presents. Recent versions are pretty good at UTF-8 in tricky situations.

    In serving dynamic web pages, pay close attention to the encoding the headers proclaim.

    After Compline,
    Zaxo

Re: English to German
by lima1 (Curate) on Jul 03, 2007 at 07:50 UTC
    Instead of printing strings directly, write a simple wrapper:
    print mt("Hello World!");
    This method searches your "dictionary" for a translation. The easiest solution is a hash:
    package MyNamespace::MT::German; ... sub mt { my ( $self, $phrase ) = @_; my %translations = ( 'Hello World!' => 'Hallo Welt!', ); return $translations{$phrase} || $phrase; );
Re: English to German
by regexes (Hermit) on Jul 03, 2007 at 06:52 UTC
    uuh.. translate it?
    Sorry, but I don't understand exactly what you are asking here. Even if you code some kind of mechanism, somebody must still have done the text translation beforehand. Maybe somebody knows something I don't?

    regexes
      Maybe somebody knows something I don't?

      This is absolutely certain, no question about it (not just for you, but for anyone :)

        of course... :-)

        The only true wisdom is in knowing you know nothing.
        --Socrates, attributed.
Re: English to German
by GrandFather (Saint) on Jul 03, 2007 at 11:41 UTC

    Yes. Oui. Ja. Ναι. Sė. Да. Sim.

    If you want a quick and (very likely) nasty translation you could use online automated translation tools such as http://world.altavista.com/. If you want a usable translation that people have some chance of using without falling off their chair laughing then you need a fluent speaker of both languages to translate the text for you.

    I'm not sure I see the relevance of this to Perl however. Perhaps you need to give us a little more information?


    DWIM is Perl's answer to Gödel
Re: English to German
by fenLisesi (Priest) on Jul 03, 2007 at 08:26 UTC
Re: English to German
by kyle (Abbot) on Jul 03, 2007 at 17:06 UTC

    You may find it useful to look at Data::Phrasebook. Even though it's often used for getting SQL code out of your Perl, it can also be used to get natural language out too.

    Template might also be handy.

    Knowing nothing at all about your current application, it's hard to respond constructively.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (2)
As of 2024-12-14 15:58 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Which IDE have you been most impressed by?













    Results (70 votes). Check out past polls.