# DatAInsights Composer Globalization

The [globalization](https://www.telerik.com/kendo-react-ui-develop/components/intl) process combines the translation of component messages with adapting them to specific locales. The [globalization support](https://www.telerik.com/kendo-react-ui-develop/components/intl/globalization-support) article lists the globalization features of each KendoReact component.

## Internationalization

The internationalization process applies specific culture formats to a web application. The DatAInsights Composer formats the dates of the History items, the Grid aggregates, and the Gauge values in the culture of the nearest `IntlProvider`.

For more information, refer to:

* [KendoReact documentation on internationalization](https://www.telerik.com/kendo-react-ui-develop/components/intl/i18n)
* [kendo-intl (the base Internationalization package on GitHub)](https://github.com/telerik/kendo-intl)

## Messages

The DatAInsights Composer supports the localization of its messages by utilizing the [KendoReact Internationalization package](https://www.telerik.com/kendo-react-ui-develop/components/intl/i18n).

> The messages that the AI returns, for example, the text of a clarification question, are shown as they are. The DatAInsights Composer does not translate them.

The following example demonstrates how to load and apply the messages.

[Demo Source](https://demos.telerik.com/kendo-react-ui/datainsights-composer/localization/source.txt)

The package exports a constant for each message key, named after the key without the `datAInsightsComposer.` prefix, for example, `title` or `generateButton`. You can use these constants as the keys when you call `loadMessages`. The `datAInsightsComposerMessages` export holds all keys with their default values.

```tsx
import { loadMessages } from '@progress/kendo-react-intl';
import { title, generateButton } from '@progress/kendo-react-datainsights-composer';

loadMessages({ [title]: 'Que souhaitez-vous explorer ?', [generateButton]: 'Générer' }, 'fr-FR');
```

The following table lists the built-in message keys and their default values.

| Message Key                                           | Default Value                                                                                           |
| :---------------------------------------------------- | :------------------------------------------------------------------------------------------------------ |
| `datAInsightsComposer.label`                          | `AI Report Builder`                                                                                     |
| `datAInsightsComposer.title`                          | `What would you like to explore?`                                                                       |
| `datAInsightsComposer.promptPlaceholder`              | `e.g. "Show revenue by region as a bar chart"`                                                          |
| `datAInsightsComposer.refinePlaceholder`              | `e.g. "Group by category" or "Switch to a line chart"`                                                  |
| `datAInsightsComposer.refineFieldLabel`               | `Refine this report`                                                                                    |
| `datAInsightsComposer.loadingMessage`                 | `Working on it…`                                                                                        |
| `datAInsightsComposer.generatingMessage`              | `Generating your report...`                                                                             |
| `datAInsightsComposer.generateButton`                 | `Generate`                                                                                              |
| `datAInsightsComposer.applyButton`                    | `Generate`                                                                                              |
| `datAInsightsComposer.tryAgainButton`                 | `Generate`                                                                                              |
| `datAInsightsComposer.stopButton`                     | `Stop generating`                                                                                       |
| `datAInsightsComposer.generatingButton`               | `Generating`                                                                                            |
| `datAInsightsComposer.refineButton`                   | `Refine`                                                                                                |
| `datAInsightsComposer.confirmButton`                  | `Confirm`                                                                                               |
| `datAInsightsComposer.discardButton`                  | `Discard`                                                                                               |
| `datAInsightsComposer.discardActionText`              | `Discard`                                                                                               |
| `datAInsightsComposer.removeButton`                   | `Remove`                                                                                                |
| `datAInsightsComposer.historyButton`                  | `History`                                                                                               |
| `datAInsightsComposer.clarificationMessage`           | `Add more detail to your prompt to generate a visualization.`                                           |
| `datAInsightsComposer.unsupportedMessage`             | `The request cannot be fulfilled with the available fields.`                                            |
| `datAInsightsComposer.aiDeclinedMessage`              | `The AI declined to fulfill this request. Please rephrase your prompt and try again.`                   |
| `datAInsightsComposer.unsupportedAlternativesMessage` | `You can show this data as {0}.`                                                                        |
| `datAInsightsComposer.alternativesListSeparator`      | `, `                                                                                                    |
| `datAInsightsComposer.alternativesLastMessage`        | `{0}, or {1}`                                                                                           |
| `datAInsightsComposer.aiServiceErrorMessage`          | `An error occurred while contacting the AI service. Please try again.`                                  |
| `datAInsightsComposer.renderErrorMessage`             | `This report could not be displayed.`                                                                   |
| `datAInsightsComposer.invalidConfigMessage`           | `Invalid configuration — some fields are not available in the current dataset.`                         |
| `datAInsightsComposer.invalidStructureMessage`        | `The configuration cannot be rendered: {0}.`                                                            |
| `datAInsightsComposer.disallowedTypeMessage`          | `A {0} is not available here.`                                                                          |
| `datAInsightsComposer.componentTypeChangedMessage`    | `Refining changed the visualization from {0} to {1}, which isn't allowed here.`                         |
| `datAInsightsComposer.tooManyCategoriesMessage`       | `"{0}" has more than {1} distinct values, which is too many to chart. Try grouping by a coarser field.` |
| `datAInsightsComposer.noDataMessage`                  | `No data matches this request. Try different values or a different wording.`                            |
| `datAInsightsComposer.datasetNotResolvedMessage`      | `Couldn't find a dataset matching that request. Try rephrasing it.`                                     |
| `datAInsightsComposer.ambiguousDatasetMessage`        | `That request could match more than one dataset ({0}). Which did you mean?`                             |
| `datAInsightsComposer.historyHeading`                 | `Version History`                                                                                       |
| `datAInsightsComposer.historyVersionTitle`            | `Version history`                                                                                       |
| `datAInsightsComposer.historyRestoreButton`           | `Restore {0}`                                                                                           |
| `datAInsightsComposer.historyRestoreTitle`            | `Restore to this version`                                                                               |
| `datAInsightsComposer.historyToday`                   | `Today, {0}`                                                                                            |
| `datAInsightsComposer.historyEmpty`                   | `No history yet.`                                                                                       |
| `datAInsightsComposer.browseDataSourcesButton`        | `Data Source`                                                                                           |
| `datAInsightsComposer.availableDataSourcesLabel`      | `Available data sources`                                                                                |
| `datAInsightsComposer.searchDataSourcesPlaceholder`   | `Search data sources`                                                                                   |
| `datAInsightsComposer.dataSourcesPopupLabel`          | `Datasets`                                                                                              |
| `datAInsightsComposer.dataSourceFieldsLabel`          | `{0} fields`                                                                                            |
| `datAInsightsComposer.aggregateSum`                   | `Sum`                                                                                                   |
| `datAInsightsComposer.aggregateAverage`               | `Average`                                                                                               |
| `datAInsightsComposer.aggregateCount`                 | `Count`                                                                                                 |
| `datAInsightsComposer.aggregateMin`                   | `Min`                                                                                                   |
| `datAInsightsComposer.aggregateMax`                   | `Max`                                                                                                   |

The `generateButton`, `tryAgainButton`, and `applyButton` keys all default to `Generate`, so the submit button keeps the same text in every state. Each key labels the submit button in a different situation, so you can customize them separately:

* `generateButton`—The submit button of the main prompt, for example, `Generate`.
* `tryAgainButton`—Replaces `generateButton` after a request fails or the AI cannot build a visualization from the prompt, for example, `Try again`.
* `applyButton`—The submit button of the refine prompt that appears after the user selects `Refine`, for example, `Apply`.

## Suggested Links

* [Globalization](https://www.telerik.com/kendo-react-ui-develop/components/intl)
* [Internationalization](https://www.telerik.com/kendo-react-ui-develop/components/intl/i18n)
* [Localization](https://www.telerik.com/kendo-react-ui-develop/components/intl/l10n)
* [DatAInsights Composer States and Messages](https://www.telerik.com/kendo-react-ui-develop/components/datainsights-composer/states-and-messages)
* [API Reference of the DatAInsights Composer](https://www.telerik.com/kendo-react-ui-develop/components/datainsights-composer/api)
