Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re: How do I pretend a reference isn't a reference

by sflitman (Hermit)
on Nov 06, 2008 at 04:24 UTC ( [id://721898]=note: print w/replies, xml ) Need Help??


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

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others meditating upon the Monastery: (3)
As of 2024-04-24 15:22 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found