---
title: "client.Languages"
description: "Every method in this namespace: its signature, its parameters, what it returns and an example."
url: "https://openemail.uk/docs/go/reference/languages"
area: "Go"
category: "Reference"
---

# client.Languages

Every method in this namespace: its signature, its parameters, what it returns and an example.

## Methods

Every language a translated send or preview accepts. The package also ships a copy of the table as `openemail.Languages()`.

### `Languages.List`

List every language a message can be sent in

```go
List(ctx context.Context, opts ...openemail.RequestOption) ([]openemail.Object, error)
```

Returns the whole language table in one response, with no cursor. It sits behind a key like every other endpoint but needs no scope, because it names no data belonging to anybody. The table is around two hundred rows and changes a handful of times a year, so fetch it once and keep it.

The order is meaningful. The languages people are most likely to be emailed in come first, then regional variants, then the rest by region. A picker should render the rows in the order they arrive until somebody types, then search `native`, `label` and `code` together. Show `native` first, since it is the word someone looking for their own language is scanning for, and never show `flag` on its own: a flag names a country, not a language.

Any row's `code`, `label` or `native` is accepted by `translate.to` on `Emails.Send` and by `Emails.Translate`. The package also ships the same table as `LANGUAGES` with `openemail.ResolveLanguage`, which is useful before the first request, while this call returns the server's current rows.

**Parameters**

- `openemail.WithAPIKey` (`string`): Authenticates this call with a different key.

**Returns**

A `[]openemail.Object`, each with `code` (BCP-47), `label` (English name), `native` (endonym), `flag` and `rtl`.

**Example**

```go
languages, err := client.Languages.List(ctx)
if err != nil {
	return err
}

for _, language := range languages {
	fmt.Println(language.String("code"), language.Bool("rtl"))
}
```

**Notes**

- `rtl` marks right-to-left targets. A translated body for one of them is wrapped in `dir="rtl"` before it is sent.
- The bundled `LANGUAGES` table can lag the server by however old your installed package is, so prefer this call when a newly added language matters.

Also available in: API [`GET /languages`](https://openemail.uk/docs/api/reference/languages#get-languages); TypeScript [`languages.list()`](https://openemail.uk/docs/sdk/reference/languages#list); Python [`languages.list()`](https://openemail.uk/docs/python/reference/languages#list); Ruby [`languages.list`](https://openemail.uk/docs/ruby/reference/languages#list); PHP [`languages->list`](https://openemail.uk/docs/php/reference/languages#list); Java [`languages().list`](https://openemail.uk/docs/java/reference/languages#list); C# [`Languages.ListAsync`](https://openemail.uk/docs/csharp/reference/languages#list); CLI [`openemail languages list`](https://openemail.uk/docs/cli/reference/languages#languages-list).
