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


-- | Bindings to libintl.h (gettext, bindtextdomain)
--   
--   Bindings to libintl.h (gettext, bindtextdomain)
@package hgettext
@version 0.1.30


-- | 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 __:
--   
--   <pre>
--   __ = unsafePerformIO . getText
--   </pre>
--   
--   and wrap all text strings into this function, e.g.
--   
--   <pre>
--   printHello = putStrLn (__ "Hello")
--   </pre>
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
--   <a>getText</a> but also could take domain name.
dGetText :: Maybe String -> String -> IO String

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

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

-- | dcnGetText wraps GNU dcngettext function. It works similar to
--   <a>dnGetText</a> 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 <a>IOError</a> if fails
bindTextDomain :: String -> Maybe String -> IO String

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


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

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