# Gettext

## Parameters

`gettext.locale`

- The top-level locale of the document

`gettext.language`

- The language part of the top-level locale of the document

`gettext.region`

- The region part of the top-level locale of the document

`gettext.variant`

- The variant part of the top-level locale of the document

`gettext.charset`

- The charset part of the top-level locale of the document

## Templates

`gettext`

- Look up a translated string

`gettext.plural_form`

- Extract the plural form string for a cardinality

`gettext.get.language`

- Extract the language part of a locale

`gettext.get.region`

- Extract the region part of a locale

`gettext.get.variant`

- Extract the variant part of a locale

`gettext.get.charset`

- Extract the charset part of a locale

gettext.locale

The top-level locale of the document

### Description

This parameter has no description

gettext.language

The language part of the top-level locale of the document

### Description

This parameter has no description

gettext.region

The region part of the top-level locale of the document

### Description

This parameter has no description

gettext.variant

The variant part of the top-level locale of the document

### Description

This parameter has no description

gettext.charset

The charset part of the top-level locale of the document

### Description

This parameter has no description

gettext

Look up a translated string

### Parameters

`msgid`

- The id of the string to look up, usually the string in the C locale

`lang`

- The locale to use when looking up the translated string

`lang_language`

- The language portion of the locale to use

`lang_region`

- The region portion of the locale to use

`lang_variant`

- The variant portion of the locale to use

`lang_charset`

- The charset portion of the locale to use

`number`

- The cardinality for plural-form lookups

`form`

- The form name for plural-form lookups

gettext.plural_form

Extract the plural form string for a cardinality

### Parameters

`number`

- The cardinality of plural form

`lang`

- The locale to use when looking up the translated string

`lang_language`

- The language portion of the locale to use

`lang_region`

- The region portion of the locale to use

`lang_variant`

- The variant portion of the locale to use

`lang_charset`

- The charset portion of the locale to use

gettext.get.language

Extract the language part of a locale

### Parameters

`lang`

- The locale string from which to extract the language string

gettext.get.region

Extract the region part of a locale

### Parameters

`lang`

- The locale string from which to extract the region string

gettext.get.variant

Extract the variant part of a locale

### Parameters

`lang`

- The locale string from which to extract the variant string

gettext.get.charset

Extract the charset part of a locale

### Parameters

`lang`

- The locale string from which to extract the charset string