hgettext-0.1.5: Bindings to libintl.h (gettext, bindtextdomain)

Text.I18N.GetText

Description

This library provides basic internationalization capabilities

Synopsis

Documentation

getText :: String -> IO StringSource

getText wraps GNU gettext function. It returns translated string for the input messages. If translated string not found the input string will be returned.

The most common usage of this function is to declare function __:

 __ = unsafePerformIO . getText

and wrap all text strings into this function, e.g.

 printHello = putStrLn (__ "Hello")

bindTextDomainSource

Arguments

:: String

domain name

-> Maybe String

path to the locale folder or Nothing if standard domain is used

-> IO (Maybe String)

return value

bindTextDomain sets the base directory of the hierarchy containing message catalogs for a given message domain.

textDomainSource

Arguments

:: String

domain name

-> IO (Maybe String)

return value

textDomain sets domain for future getText call