Safe Haskell | None |
---|---|
Language | Haskell2010 |
This module contains definitions for loading translation catalogs.
Synopsis
- 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 | |
|
Instances
Show LocatePolicy Source # | |
Defined in Text.Localize.Load showsPrec :: Int -> LocatePolicy -> ShowS # show :: LocatePolicy -> String # showList :: [LocatePolicy] -> ShowS # | |
Default LocatePolicy Source # | |
Defined in Text.Localize.Load def :: 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
.