code and messages

Discussion in 'Perl Misc' started by Me, Mar 10, 2005.

  1. Me

    Me Guest

    I recently started coding with perl again after a rather long spell with
    python and php. On one of the long running php projects (with people
    always changing their minds) that I worked, all the error messages that
    were visible to the end user were configurable. This was to meant avoid
    coding when messages needed to be changed. Even the email messages were
    configurable. The solution was not a neat one, and was at times a
    headache to maintain (and thats putting it mildly).

    What I would to find out is not neccesarily perl specific. But, perl is
    what I am focusing on. What tools/methods are available to allow for
    separation of "visible end user text" and code? I currently use template
    to seperate code from design, that is not what I am looking for?

    Taking it a step further, would be to say can I also get translation as
    well so that messages are not just in English? This is just a nice to have.


    Any suggestions? Comments?
     
    Me, Mar 10, 2005
    #1
    1. Advertising

  2. Me wrote:

    > Taking it a step further, would be to say can I also get translation as
    > well so that messages are not just in English?


    In C that's often done with gettext. There's a Gettext module on CPAN, but
    it looks to be abandoned - the last update was in 2000.

    sherm--

    --
    Cocoa programming in Perl: http://camelbones.sourceforge.net
    Hire me! My resume: http://www.dot-app.org
     
    Sherm Pendley, Mar 10, 2005
    #2
    1. Advertising

  3. Me

    Big and Blue Guest

    Me wrote:

    >
    > What I would to find out is not neccesarily perl specific. But, perl is
    > what I am focusing on. What tools/methods are available to allow for
    > separation of "visible end user text" and code? I currently use template
    > to seperate code from design, that is not what I am looking for?


    Well, something non-Perl specific and relativley easy to implement in
    Perl (and then use the same message from any other language).

    Put every message and mail message into a file whose name is mnemonic,
    then just read the contensts of that file name when required. Write a
    module to do the getting.

    > Taking it a step further, would be to say can I also get translation as
    > well so that messages are not just in English? This is just a nice to have.


    Allow for the files to be in a deault dir, or one named on after the
    locale.

    Ths is the sort of thing which gettext does, but it would be qute easy
    to implement on its own.

    --
    Just because I've written it doesn't mean that
    either you or I have to believe it.
     
    Big and Blue, Mar 10, 2005
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Lauchlan M
    Replies:
    2
    Views:
    733
    Lauchlan M
    Aug 26, 2003
  2. zorhel
    Replies:
    5
    Views:
    599
    Marina
    Aug 24, 2004
  3. Myriam Abramson

    color-code string messages?

    Myriam Abramson, Sep 17, 2003, in forum: Java
    Replies:
    2
    Views:
    359
    Roedy Green
    Sep 17, 2003
  4. Kenosis
    Replies:
    1
    Views:
    93
    Kenosis
    Jan 13, 2006
  5. John Stoffel

    Quieting DRb messages in fork() code

    John Stoffel, Feb 18, 2009, in forum: Ruby
    Replies:
    4
    Views:
    139
    John Stoffel
    Feb 19, 2009
Loading...

Share This Page