Difference between revisions of "Talk:Internationalization of Haskell programs using gettext"

From HaskellWiki
Jump to navigation Jump to search
(Problems encountered on i18n of Haskell programs.)
 
m (Talk:Internationalization of Haskell programs moved to Talk:Internationalization of Haskell programs using gettext: Allowing for listing other approaches to i18n on the general page.)
 
(2 intermediate revisions by one other user not shown)
Line 1: Line 1:
  +
I think the gettext function <hask>__</hask> should add decodeString from Codec.Binary.UTF8.String for many locales to be displayed correctly, such as zh_CN.
On my Ubuntu 10.10, it works if I change `LOCALE=de_DE.UTF-8 ./Main` to `LANG=de_DE.UTF-8 ./Main`. But the output is garbled when I'm doing Simplified Chinese, with LANG set to zh_CN.UTF8.
 
  +
  +
<haskell>
  +
  +
import Codec.Binary.UTF8.String (decodeString)
  +
  +
__ :: String -> String
  +
__ = decodeString . unsafePerformIO . getText
  +
  +
</haskell>
  +
  +
See my post on [http://stackoverflow.com/questions/5011873/how-to-do-i18n-and-create-windows-installer-of-haskell-programs "stackoverflow"].

Latest revision as of 09:45, 3 October 2011

I think the gettext function __ should add decodeString from Codec.Binary.UTF8.String for many locales to be displayed correctly, such as zh_CN.

import Codec.Binary.UTF8.String (decodeString)

__ :: String -> String
__ = decodeString . unsafePerformIO . getText

See my post on "stackoverflow".