> For the complete documentation index, see [llms.txt](https://docs.digit.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.digit.org/local-governance/v2.7/platform/configure-digit/services-overview/core-services/xstate-core-chatbot/xstate-chatbot-message-localisation.md).

# Xstate-Chatbot Message Localisation

**Objective:** This document aims to facilitate communication between the software developers and whoever is localising the chatbot messages. The goal is to make it clear and unambiguous.

Click on the link to the google sheet below to access all the messages with the codes:

{% embed url="<https://docs.google.com/spreadsheets/d/1XygouJlljm2SedBatciVJKu9yDcX1J-s1MS1vPKJgYE/edit?usp=sharing>" %}

[Click here](https://docs.google.com/spreadsheets/d/1XygouJlljm2SedBatciVJKu9yDcX1J-s1MS1vPKJgYE/edit?usp=sharing) to download the file.

## Message Localisation Details

### Project Structure

The project is organised such that all the messages are contained within the files present inside the /machine directory. /service directory, which is present inside it, also includes files that could contain localization messages.

Guidelines to be followed by developers:

*(According to the standard pattern followed in the project, all the localization messages will be present near the end of the file in a JavaScript object named “messages”.)*

Developers will be the ones first filling up the sheet with codes (and the English version of the messages). Below are the guidelines to be followed when writing the codes in the sheet:

1. The standard separator to be used is .(dot)
2. The first part is the filename—Eg: “pgr.”, when the filename is pgr.js.
3. Use “service.” as a prefix when the file is present inside the /service directory.
   * In the /service directory, filenames are like egov-pgr.js
   * For localization messages contained in those files, instead of writing “egov-pgr” just write “pgr”
   * So the prefix for such files would be “service.pgr.”
4. All the message bundles would be present in the “messages” object near the end of the file. They have been organized in a pattern in the JS object like fileComplaint.complaintType2Step.category.question
   * The corresponding localization code for such a message bundle in the sheet would be “pgr.fileComplaint.complaintType2Step.category.question”, where the first “pgr.” is added as the prefix for the file name.

### Message Writing Guidelines <a href="#guidelines-for-writing-messages" id="guidelines-for-writing-messages"></a>

Once the localization codes have been written correctly (and the English version of the messages) in the sheet, it is easy to add the new message in the corresponding new column.&#x20;

Some guidelines to follow when adding new messages:

1. The parameter names are written within {{}} *(double curly brackets).*
2. The content inside these curly brackets should be written in English even when writing messages for any new language.


---

# 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 dynamically by asking a question.

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

```
GET https://docs.digit.org/local-governance/v2.7/platform/configure-digit/services-overview/core-services/xstate-core-chatbot/xstate-chatbot-message-localisation.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
