localize-0.2.0.0: GNU Gettext-based messages localization library

Safe HaskellNone
LanguageHaskell2010

Text.Localize.Types

Description

This module contains data type definitions for the localize package.

Synopsis

Documentation

type LanguageId = String Source #

Language identifier

type Context = ByteString Source #

Context name

type TranslationSource = ByteString Source #

String to be translated

data Translations Source #

Stores translation catalogs for all supported languages

Constructors

Translations 

class (Monad m, Applicative m) => Localized m where Source #

This is the main type class of the package. All functions work with any instance of this type class.

Note that this class only supports **getting** current language and translation, not setting them. Though concrete implementation can have its own ways to change language or context, these ways are not required by the localize package, and so are not declared in the type class.

Minimal complete definition

getLanguage, getTranslations

Methods

getLanguage :: m LanguageId Source #

Obtain currently selected language ID.

getTranslations :: m Translations Source #

Obtain currently loaded translations.

getContext :: m (Maybe Context) Source #

Obtain currently selected localization context. Nothing means no specific context.

toText :: TranslationSource -> Text Source #

This assumes UTF-8 encoding.