Jeff Epler wrote: > > On Mon, Feb 25, 2002 at 01:18:57PM -0800, Neil Schemenauer wrote: > > Jeff Epler wrote: > > > But how do you internationalize your program once you use $-subs? > > > > So don't use them. What's the problem? > > The problem is when I have to internationalize a program some schmuck > wrote using $-subs throughout. I think you go through and remove the "$" signs (probably at the same time you are removing "_") and use a runtime function to do the translation (probably the same function doing the interpolation). Then you take on the responsibility yourself for making sure that the original string is a constant (not a user-supplied variable) and that the replacement strings come from somewhere secure. So: a = $"Hello there $name" becomes: a = _("Hello there $name") I think Barry's gettext already does that or something, doesn't it? Paul Prescod
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4