in reply to How do I pretend a reference isn't a reference

I wonder if you'd be better off using a source translator like Damian Conway's Filter::Simple. Then you could use more natural Perlish syntax, and just replace any "..." literal with the translation based on your module recognizing the literal text and replacing it from your hash for the current language (maybe stored in an environment variable). Then you wouldn't have runtime issues at all, all the translating would be at compile time...but you could have a runtime interface to your module for on-demand translation also, of course.

HTH,
SSF

  • Comment on Re: How do I pretend a reference isn't a reference

Replies are listed 'Best First'.
Re^2: How do I pretend a reference isn't a reference
by clinton (Priest) on Nov 06, 2008 at 10:08 UTC

    That wouldn't help for a few reasons:

    • I don't want to translate all strings, so strings to be translated should be explicitly labelled.
    • This is a webapp, so the current language could change for each request, so strings shouldn't be translated at compile time
    • The app is 60,000 lines of code, plus CPAN modules - running a filter over that would be slow and error prone.

    clint