-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/

-- | Bindings to libintl.h (gettext, bindtextdomain)
--   
--   This package provides bindings to the gettext
--   internationalization and localization (i18n) library.
--   
--   This package provides support for custom Setup.hs scripts via
--   the Distribution.Simple.I18N.GetText module.
--   
--   A user-contributed tutorial can be found in the Haskell Wiki.
@package hgettext
@version 0.1.31.0

-- | This library extends the Distribution with internationalization
--   support.
--   
--   It performs two functions:
--   
--   
--   
- compiles and installs PO files to the specified directory
--   
- tells the application where files were installed to make it able
--   to bind them to the code
--   
--   
--   Each PO file will be placed to the
--   {datadir}/locale/{loc}/LC_MESSAGES/{domain}.mo where:
--   
--   
--   
- datadir Usually prefix/share but could be
--   different, depends on system.
--   
- loc Locale name (language code, two characters).
--   This module supposes, that each PO file has a base name set to the
--   proper locale, e.g. de.po is the German translation of the
--   program, so this file will be placed under
--   {datadir}/locale/de directory
--   
- domain Program domain. A unique identifier of
--   single translational unit (program). By default domain will be set to
--   the package name, but its name could be configured in the
--   .cabal file.
--   
--   
--   The module defines following .cabal fields:
--   
--   
--   
- x-gettext-domain-name Name of the domain. One or
--   more alphanumeric characters separated by hyphens or underlines. When
--   not set, package name will be used.
--   
- x-gettext-po-files List of files with
--   translations. Could be used a limited form of wildcards, e.g.:
--   x-gettext-po-files: po/*.po
--   
- x-gettext-domain-def Name of the macro, in which
--   domain name will be passed to the program. Default value is
--   MESSAGE_CATALOG_DOMAIN
--   
- x-gettext-msg-cat-def Name of the macro, in which
--   path to the message catalog will be passed to the program. Default
--   value is MESSAGE_CATALOG_DIR
--   
--   
--   The last two parameters are used to send configuration data to the
--   code during its compilation. The most common usage example is:
--   
--   
--   ...
--   prepareI18N = do
--      setLocale LC_ALL (Just "")
--      bindTextDomain __MESSAGE_CATALOG_DOMAIN__ (Just __MESSAGE_CATALOG_DIR__)
--      textDomain __MESSAGE_CATALOG_DOMAIN__
--   
--   main = do
--      prepareI18N
--      ...
--   
--   ...
--   
--   
--   NOTE: files, passed in the x-gettext-po-files are not
--   automatically added to the source distribution, so they should be also
--   added to the extra-source-files parameter, along with
--   translation template file (usually message.pot)
--   
--   WARNING: sometimes, when only configuration targets changes,
--   code will not recompile, thus you should execute cabal clean
--   to cleanup the build and restart it again from the configuration. This
--   is temporary bug, it will be fixed in next releases.
module Distribution.Simple.I18N.GetText

-- | Installs hooks, used by GetText module to install PO files to the
--   system.
--   
--   Pre-existing hook handlers are executed before the GetText handlers.
installGetTextHooks :: UserHooks -> UserHooks

-- | Default main function, same as
--   
--   
--   defaultMainWithHooks $ installGetTextHooks simpleUserHooks
--   
gettextDefaultMain :: IO ()

-- | This library provides basic internationalization capabilities
module Text.I18N.GetText

-- | 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")
--   
getText :: String -> IO String

-- | nGetText wraps GNU ngettext function. It translates text string
--   in the user's native language, by lookilng up the approppiate plural
--   form of the message.
nGetText :: String -> String -> Integer -> IO String

-- | dGetText wraps GNU dgettext function. It works similar to
--   getText but also could take domain name.
dGetText :: Maybe String -> String -> IO String

-- | dnGetText wraps GNU dngettext function. It works similar to
--   nGetText but also takes domain name
dnGetText :: Maybe String -> String -> String -> Integer -> IO String

-- | dcGetText wraps GNU dcgettext function. It works similar to
--   dGetText but also takes category id
dcGetText :: Maybe String -> Category -> String -> IO String

-- | dcnGetText wraps GNU dcngettext function. It works similar to
--   dnGetText but also takes category id
dcnGetText :: Maybe String -> Category -> String -> String -> Integer -> IO String

-- | bindTextDomain sets the base directory of the hierarchy
--   containing message catalogs for a given message domain.
--   
--   Throws IOError if fails
bindTextDomain :: String -> Maybe String -> IO String

-- | textDomain sets domain for future getText call
--   
--   Throws IOError if fails
textDomain :: Maybe String -> IO String
