# 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](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/i18n/clearlocale)
* [CurrencyFormat](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/i18n/currencyformat)
* [GetLocale](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/i18n/getlocale)
* [GetLocaleDisplayName](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/i18n/getlocaledisplayname)
* [IsCurrency](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/i18n/iscurrency)
* [LSCurrencyFormat](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/i18n/lscurrencyformat)
* [LSIsCurrency](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/i18n/lsiscurrency)
* [LSParseCurrency](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/i18n/lsparsecurrency)
* [ParseCurrency](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/i18n/parsecurrency)
* [SetLocale](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/i18n/setlocale)


---

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