haskell-gettext- GetText runtime library implementation in pure Haskell

Safe HaskellSafe




This module contains parsers for:

  • Catalog headers (Name: Value lines, that are specified as translation for empty string in po file);
  • Plural form selection expressions (specified in Plural-Forms header).

These parsers are already used by main module; but they can be useful for other libraries working with gettext's files.



type Header = (Text, Text) Source #

Catalog header, i.e. one Name: Value line in po file

type Headers = [Header] Source #

List of catalog headers

Parsing functions

parseHeaders :: Text -> Either String Headers Source #

Parse catalog headers. NB: for now this function does not use Parsec.

parsePlural :: Headers -> Either String (Int, Expr) Source #

Parse plural form selection definition. Return value is (number of possible plural forms; selection expression).

Parsec parsers

pHeaders :: Parser Headers Source #

Parsec parser for catalog headers

pExpr :: Parser Expr Source #

Parse plural form selection expression. Note: this parses only part which goes after plural=.

pPlural :: Parser (Int, Expr) Source #

Parse plural form selection definition. This parses the whole value of Plural-Forms header, starting from nplurals=.