Safe Haskell | None |
---|---|
Language | Haskell2010 |
This module contains definitions for loading translation catalogs.
- data LocatePolicy = LocatePolicy {}
- type Facet = String
- loadTranslations :: [(LanguageId, FilePath)] -> IO Translations
- locateTranslations :: MonadIO m => LocatePolicy -> m Translations
- linuxLocation :: String -> LocatePolicy
- localLocation :: FilePath -> LocatePolicy
Data types
data LocatePolicy Source #
This data type defines where to search for catalog files (.mo
or .gmo
) in the file system.
LocatePolicy | |
|
Main functions
loadTranslations :: [(LanguageId, FilePath)] -> IO Translations Source #
Load translations when path to each translation file is known.
locateTranslations :: MonadIO m => LocatePolicy -> m Translations Source #
Locate and load translations according to specified policy.
Commonly used location policies
:: String | Catalog file name (text domain) |
-> LocatePolicy |
Usual Linux translations location policy.
Catalog files are found under /usr/[local/]share/locale/{language}/LC_MESSAGES/{name}.mo
.
:: FilePath | Path to directory with translations |
-> LocatePolicy |
Simple translations location polciy, assuming all catalog files located at
{base}/{language}.mo
.