> For the complete documentation index, see [llms.txt](https://docs.navigaglobal.com/dashboard-plugin/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.navigaglobal.com/dashboard-plugin/api-and-gui/api/uselocalize.md).

# useLocalize

useLocalize is a helper hook that will return the plugin's localizations

## How to use

```jsx
import { Plugin } from '@root'

const MyCustomComponent = () => {
    const localization = Plugin.useLocalize()
    
    return (
        <div>
            <p>title: {localization.myLocalizedTitle}</p>
        </div>
    )
}

export default MyCustomComponent
```

useLocalize accepts a selector as an argument to select a part of the localization object instead of returning all

Let's say that your localization object looks something like this:

```javascript
{
    [...]
    
    error_pages: {
        not_found: "404 page not found",
        internal_error: "500 Internal error occurred"
    }
    
    [...]
}
```

And you want to get the `error_handlers` object in your code:

```jsx
import { Plugin } from '@root'
import { useEffect } from 'react'

const MyCustomComponent = () => {
    const localizedErrroMessages = Plugin.useLocalize(lc => lc.error_pages)
    
    return (
        <div>
            <p>{localizedErrroMessages.not_found}</p>
        </div>
    )
}

export default MyCustomComponent
```
