# Internationalization

### Overview

The internationalization (i18n) library for Angular by [ngx-translate](https://github.com/ngx-translate/core)

### How to add a new language

To register new language we have to update given below files:

* `src/assets/i18n/*.json`
* `src/app/app.component.ts`

Duplicate en.json file and create a new language file in `src/assets/i18n/*.json`.  The new file name and the language name must be matched.

Register the language by adding its name to languages array.

```typescript
translate.addLangs(['en', 'es', 'new lang name']);
```

### How to use

The translator understands nested JSON objects as defined in `src/assets/i18n/*.json`. This means that you can have a translation that looks like this:

{ "HOME": { "HELLO": "hello " } }

You can then access the value by using the dot notation, in this case `HOME.HELLO`.

```markup
<div [translate]="'HOME.HELLO'" [translateParams]="{value: 'world'}"></div>
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs-drift-angular.g-axon.work/settings/internationalization.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
