
tor 2002-08-15 klockan 10.28 skrev Ketil Z Malde:
I just want to repeat something somebody suggested, and which I thought was a really neat idea: Have string constants in programs be replaced by (Prelude.fromString "..") or similar, like numerical constants are handled already.
This was suggested in order to simplify the use of PackedString, but I think it might come in handy for translation issues, too. Granted, it's not a complete printf with argument permutation and all, but at least it should be extremely simple, and, hey, it'll probably suffice for *my* uses :-)
(Naturally, the idea is that Prelude.fromString can be repaced by a function that looks the string up in a translation table, instead of using the default value. Any reason this won't work?)
It would probably work, but doing it like this will probably doesn't be a good solution for translation. Why? Because not all strings should be translated. The programmer has to mark the strings that should be translated, by using a function like gettext (or __). Using it for PackedString should be good, something like template Haskell could solve this without requiring more language extensions. Regards, Martin -- Martin Norbäck d95mback@dtek.chalmers.se Kapplandsgatan 40 +46 (0)708 26 33 60 S-414 78 GÖTEBORG http://www.dtek.chalmers.se/~d95mback/ SWEDEN OpenPGP ID: 3FA8580B