fluent
Safe HaskellNone
LanguageHaskell2010

Language.Fluent.Locale

Synopsis

Documentation

class Locale l where Source #

A locale, identified by an implementation-defined code (e.g. BCP 47, ISO 639).

Methods

fromCode :: Text -> Maybe l Source #

Parse a locale from its textual code, if recognised.

toCode :: l -> Text Source #

Render a locale back to its textual code.

displayLanguage Source #

Arguments

:: l

The language being named

-> l

The language to render the name in

-> Maybe Text 

Translate the name of one language into another.

localDisplayLanguage :: l -> Maybe Text Source #

A language's own name for itself, e.g. Deutsch for German.

capitalise :: l -> Text -> Text Source #

Capitalise the first character of some text following the locale's casing rules.

pluralCategory :: l -> Scientific -> NumberOptions -> Category Source #

Classify a number into a plural category (e.g. "one", "few", "other"), used to pick the matching translation variant.

formatNumber :: NonEmpty l -> Scientific -> NumberOptions -> Either String Text Source #

Format a number according to locale conventions.

formatTime :: NonEmpty l -> UTCTime -> TimeOptions -> Either String Text Source #

Format a point in time according to locale conventions.