# GetLocale

Retrieves the the string representation of the current locale

## Method Signature

```
GetLocale()
```

### Arguments

This function does not accept any arguments

## Examples

### Output current Locale than set it to swiss locale

```java
writeOutput( getlocale() );
writeOutput( " → " );
setLocale( "de_ch" );
writeOutput( getlocale() );

```

Result: english (us) → german (swiss)

### Additional Examples

```java
var n = 1234.56;
writeOutput( getlocale() );
dump( dateTimeFormat( now() ) );
dump( LSdateTimeFormat( now() ) );
dump( numberFormat( n ) );
dump( LSnumberFormat( n ) );
writeOutput( " To " );
setLocale( "french(switzerland)" );
writeOutput( getlocale() );
dump( dateTimeFormat( now() ) );
dump( LSdateTimeFormat( now() ) );
dump( numberFormat( n ) );
dump( LSnumberFormat( n ) );
writeOutput( " To " );
setLocale( "German" );
writeOutput( getlocale() );
dump( dateTimeFormat( now() ) );
dump( LSdateTimeFormat( now() ) );
dump( numberFormat( n ) );
dump( LSnumberFormat( n ) );

```

## 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)
* [GetLocaleDisplayName](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/i18n/getlocaledisplayname)
* [GetLocaleInfo](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/i18n/getlocaleinfo)
* [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/getlocale.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.
