> For the complete documentation index, see [llms.txt](https://docs.akinon.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.akinon.com/technical-guides/project-zero/django/project-structure/multilanguage-and-translation.md).

# Multilanguage & Translation

## <mark style="color:red;">Adding Required Settings​</mark> <a href="#adding-required-settings" id="adding-required-settings"></a>

The infrastructure required to add multilanguage support has already been implemented in Project Zero. Languages ​​to be used and default language should be added to the settings.

**omnife\_base/settings.py**

```
LANGUAGE_CODE = 'tr'
 
LANGUAGES = [
   ('tr', 'Türkçe'),
   ('en-us', 'English')
]
```

## <mark style="color:red;">Creating Language Files​</mark> <a href="#creating-language-files" id="creating-language-files"></a>

In order to create the relevant language files, a "locale" directory must be created in the root directory of the project. In addition, the corresponding directory for each of the language codes in settings.py must be created under "locale". (Example: locale/en, locale/fr etc.)

After the directories are created, the following commands should be executed to create editable language files (.po).

For translations in Django templates:

```
python manage.py makemessages --ignore venv
```

For translations in Javascript:

```
python manage.py makemessages -d djangojs --ignore node_modules
```

After executing these commands, .po files will be created under the relevant directory for each language. (Example: locale/en/LC\_MESSAGES/django.po, locale/en/LC\_MESSAGES/djangojs.po).

After the necessary translations are made in these files, the .po files must be compiled with the following command.

```
python manage.py compilemessages -l en
```

## <mark style="color:red;">Changing Language​</mark> <a href="#changing-language" id="changing-language"></a>

To change the language, the language code must be passed to the setlang url with the language parameter. Example:

`POST`

```
example.com/setlang

language: en-us
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.akinon.com/technical-guides/project-zero/django/project-structure/multilanguage-and-translation.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
