| Copyright | (c) 2011-2016 Eugene Grigoriev |
|---|---|
| License | BSD3 |
| Maintainer | Philip Cunningham <hello@filib.io> |
| Stability | experimental |
| Portability | portable |
| Safe Haskell | Safe-Inferred |
| Language | Haskell2010 |
Data.Text.I18n.Po
Description
This module contains the PO parser. PO files are assumed to be in UTF-8 encoding. Plural forms are not yet implemented.
PO parsing
I18n Monad Functions
Arguments
| :: L10n | Structure containing localization data |
| -> Locale | Locale to use |
| -> I18n a | Inernationalized expression |
| -> a | Localized expression |
Top level localization function.
Examples:
>>>I18n.localize l10n (I18n.Locale "cym") example"Fel dagrau yn y glaw."
When the translation doesn't exist:
>>>I18n.localize l10n (I18n.Locale "ru") example"Like tears in rain."
Arguments
| :: Maybe Context | Context to use |
| -> I18n a | Internationalized expression |
| -> I18n a | New internationalized expression |
Sets a local Context for an internationalized expression. If there is no translation, then no
context version is tried.
Examples:
>>>let example2 = I18n.withContext (Just "Attack ships on fire off the shoulder of Orion.") example>>>I18n.localize l10n (I18n.Locale "cym") example2"Fel dagrau yn y glaw."
Arguments
| :: Locale | Locale to use |
| -> I18n a | Internationalized expression |
| -> I18n a | New internationalized expression. |
Sets a local Locale for an internationalized expression.
Examples:
>>>let example3 = I18n.withLocale (I18n.Locale "en") example>>>I18n.localize l10n (I18n.Locale "cym") example3"Like tears in rain."