-- 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.40.1 -- | This library extends the Distribution with internationalization -- support. -- -- It performs two functions: -- --
-- ... -- 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