Hi<br><br>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).<br>The code is still available in the sourceforge cvs repository:
<br><br><a href="http://haskell-i18n.cvs.sourceforge.net/haskell-i18n/" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">http://haskell-i18n.cvs.sourceforge.net/haskell-i18n/</a><br><br>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.
<br><br>regards<br><br>Stefan<br><br><div><span class="gmail_quote">2006/11/15, Johannes Waldmann &lt;<a href="mailto:waldmann@imn.htwk-leipzig.de" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">waldmann@imn.htwk-leipzig.de
</a>&gt;:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
What methods and tools are there for i18n of Haskell programs?<br><br>(I.e. I want output in several languages,<br>with the language configurable at runtime,<br>and I want to add languages without recompilation.)<br><br>
a typical source text (for my application) is here
<br><a href="http://141.57.11.163/cgi-bin/cvsweb/tool/src/Graph/Circle/Plain.hs?rev=1.2" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">http://141.57.11.163/cgi-bin/cvsweb/tool/src/Graph/Circle/Plain.hs?rev=1.2
</a><br>it contains (German) text strings all over the place.
<br><br>In Java/Eclipse, I would &quot;Source -&gt; Externalize Strings&quot;<br>and this replaces each string by something like<br>Messages.getString(&quot;Foobar.0&quot;)&nbsp;&nbsp;where&nbsp;&nbsp;Messages&nbsp;&nbsp;is a global variable<br>(constructed at program start from reading a properties file)
<br><br>In Haskell, I see at least two problems:<br>a) reading the file is in IO<br>b) there are no &quot;global variables&quot;. implicit parameters perhaps?<br>c) when I'm trying to be clever, I use &quot;deriving Show/Read&quot; or similar.
<br>then i18n should rename the constructors/accessors? I rather not.<br><a href="http://141.57.11.163/cgi-bin/cvsweb/tool/src/Grammatik/Type.hs.drift?rev=1.6" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
http://141.57.11.163/cgi-bin/cvsweb/tool/src/Grammatik/Type.hs.drift?rev=1.6
</a><br><br>Best regards,<br>--<br>-- Johannes Waldmann -- Tel/Fax (0341) 3076 6479/80 --<br>---- <a href="http://www.imn.htwk-leipzig.de/%7Ewaldmann/" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
http://www.imn.htwk-leipzig.de/~waldmann/</a> -------<br><br>_______________________________________________
<br>Haskell mailing list<br><a href="mailto:Haskell@haskell.org" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">Haskell@haskell.org</a><br><a href="http://www.haskell.org/mailman/listinfo/haskell" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
http://www.haskell.org/mailman/listinfo/haskell</a><br></blockquote></div>
<br>