[Haskell] I18N, external strings
haskell at aeschbacher.ch
Wed Nov 15 04:35:09 EST 2006
there is a project for i18n on sourceforge. It contains for example bindings
to the gettext library which could be helpful. I'm not sure though how up to
date this project is (project page looks very empty).
The code is still available in the sourceforge cvs repository:
Another possibility is to load the lookup tables in the IO monad and then
use a Reader Monad to make your lookup table available in your code.
2006/11/15, Johannes Waldmann <waldmann at imn.htwk-leipzig.de>:
> What methods and tools are there for i18n of Haskell programs?
> (I.e. I want output in several languages,
> with the language configurable at runtime,
> and I want to add languages without recompilation.)
> a typical source text (for my application) is here
> it contains (German) text strings all over the place.
> In Java/Eclipse, I would "Source -> Externalize Strings"
> and this replaces each string by something like
> Messages.getString("Foobar.0") where Messages is a global variable
> (constructed at program start from reading a properties file)
> In Haskell, I see at least two problems:
> a) reading the file is in IO
> b) there are no "global variables". implicit parameters perhaps?
> c) when I'm trying to be clever, I use "deriving Show/Read" or similar.
> then i18n should rename the constructors/accessors? I rather not.
> Best regards,
> -- Johannes Waldmann -- Tel/Fax (0341) 3076 6479/80 --
> ---- http://www.imn.htwk-leipzig.de/~waldmann/<http://www.imn.htwk-leipzig.de/%7Ewaldmann/>-------
> Haskell mailing list
> Haskell at haskell.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Haskell