> For the complete documentation index, see [llms.txt](https://boxlang.ortusbooks.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/i18n/getlocaleinfo.md).

# GetLocaleInfo

Retrieves a struct containin info on a locale, with an optional display locale

## Method Signature

```
GetLocaleInfo(locale=[string], dspLocale=[string])
```

### Arguments

| Argument    | Type     | Required | Description                                                                                           | Default |
| ----------- | -------- | -------- | ----------------------------------------------------------------------------------------------------- | ------- |
| `locale`    | `string` | `false`  | Optional locale to retrieve information on - either a common format ( "German" ), or an ISO Directive |         |
| `dspLocale` | `string` | `false`  | Optional display language locale                                                                      |         |

## Examples

### Get information about the page's locale

[Run Example](https://try.boxlang.io/?code=eJxLTy3xyU9OzEn1zEvL19C05gIAOdcFsw%3D%3D)

```java
getLocaleInfo();

```

Result: { country : "US", iso : { country : "USA", language : "eng" }, display : { country : "United States", language : "English" }, language : "en", name : "English (United States)", variant : "" }

### Output page's locale in a divergent language

Outputs the language locale of the page in German.

[Run Example](https://try.boxlang.io/?code=eJxLTy3xyU9OzEn1zEvL11BIKS6AcG2V3FOLchPzlBQ09Vw8gwN8HCP1fBz93EMd3V2tuQAB5BEb)

```java
getLocaleInfo( dspLocale="German" ).DISPLAY.LANGUAGE;

```

Result: Englisch

### Output German locale in a page's language

Outputs the German locale in the language defined for the page.

[Run Example](https://try.boxlang.io/?code=eJxLTy3xyU9OzEn1zEvL11DIAbNtlVJSdV1clXQUUooLINK26TCFLpnFBTmJlX6Juakamgqaei6ewQE%2BjpF6zv6hfiFBkdZcALWeG2E%3D)

```java
getLocaleInfo( locale="de-DE", dspLocale=getLocaleDisplayName() ).DISPLAY.COUNTRY;

```

Result: Germany

### Additional Examples

[Run Example](https://try.boxlang.io/?code=eJxLKc0t0FBwTy3xyU9OzEn1zEvL19BU0LTmAgBxQwfa)

```java
dump( GetLocaleInfo() );

```

## Related

* [ClearLocale](/boxlang-language/reference/built-in-functions/i18n/clearlocale.md)
* [CurrencyFormat](/boxlang-language/reference/built-in-functions/i18n/currencyformat.md)
* [GetLocale](/boxlang-language/reference/built-in-functions/i18n/getlocale.md)
* [GetLocaleDisplayName](/boxlang-language/reference/built-in-functions/i18n/getlocaledisplayname.md)
* [IsCurrency](/boxlang-language/reference/built-in-functions/i18n/iscurrency.md)
* [LSCurrencyFormat](/boxlang-language/reference/built-in-functions/i18n/lscurrencyformat.md)
* [LSIsCurrency](/boxlang-language/reference/built-in-functions/i18n/lsiscurrency.md)
* [LSParseCurrency](/boxlang-language/reference/built-in-functions/i18n/lsparsecurrency.md)
* [ParseCurrency](/boxlang-language/reference/built-in-functions/i18n/parsecurrency.md)
* [SetLocale](/boxlang-language/reference/built-in-functions/i18n/setlocale.md)


---

# 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://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/i18n/getlocaleinfo.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.
