---
id: "packages/active-charts/all-exports/chart-translator"
title: "Chart translator"
description: "ChartTranslateFn, ChartTranslationVariables: generated from the source of active-charts."
url: "/packages/active-charts/all-exports/chart-translator"
locale: "en"
revision: "g0mvjxwj5c-88bdbe1c:chart-translator"
---

# Chart translator

Exported by `@workspace/active-charts`. Generated from the package source; part of [the index of every export](/packages/active-charts/all-exports).

## Types

**ChartTranslateFn**

```ts
type ChartTranslateFn = (
  key: ChartTranslationKey,
  vars?: ChartTranslationVariables,
) => string;
```

The translator a host supplies: a key of the contract and its interpolation
values in, the text in the reader's language out. The key parameter is the
contract (`ChartTranslationKey`), so inside this package a text outside the
contract does not compile; any host translator that accepts a `string` key,
such as the active-i18n `TranslateFunction` or a dynamic host
translator, is assignable to it.

**ChartTranslationVariables**

```ts
type ChartTranslationVariables = Record<
  string,
  string | number | undefined
>;
```

Interpolation values a chart passes to its translator.
