Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
This library provides basic internationalization capabilities
Synopsis
- getText :: String -> IO String
- nGetText :: String -> String -> Integer -> IO String
- dGetText :: Maybe String -> String -> IO String
- dnGetText :: Maybe String -> String -> String -> Integer -> IO String
- dcGetText :: Maybe String -> Category -> String -> IO String
- dcnGetText :: Maybe String -> Category -> String -> String -> Integer -> IO String
- bindTextDomain :: String -> Maybe String -> IO String
- textDomain :: Maybe String -> IO String
Documentation
getText :: String -> IO String Source #
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")
:: String | msgid in singular form |
-> String | msgid in plural form |
-> Integer | number, used to choose appropriate form |
-> IO String | result string, by default if number is 1 than singular form of msgid is returned, otherwise --- plural |
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.
:: Maybe String | domain name, if |
-> Category | locale facet |
-> String | msgid in singular form |
-> String | msgid in plural form |
-> Integer | number, used to choose appropriate form |
-> IO String | result string, by default if number is 1 than singular form of msgid is returned, otherwise --- plural |
dcnGetText
wraps GNU dcngettext function. It works similar to dnGetText
but
also takes category id