# Locale

* Access and update the locale by using the hook `useT()`
* If the provided locale doesn't match any [JSON translation files](https://donedeal0.gitbook.io/talkr/getting-started/add-translation-files), **Talkr** will use the `defaultLanguage` sent to the provider.

```tsx
import React, { useState } from "react";
import { useT } from "talkr";

export default function MyComponent() {
  const { T, setLocale, locale } = useT();
  return (
    <>
      <h1>{T("hello")}</h1>
      <p>{locale}</p>
      <button onClick={() => setLocale("fr")}>speak french</button>
    </>
  );
}
```
