# How to pass Internationalization.json to jsonform component using i18n in react?

**URL:** <https://jsonforms.discourse.group/t/how-to-pass-internationalization-json-to-jsonform-component-using-i18n-in-react/1298>\
**Category:** General\
**Created:** [February 7, 2023, 12:53pm UTC](https://jsonforms.discourse.group/t/how-to-pass-internationalization-json-to-jsonform-component-using-i18n-in-react/1298 "2023-02-07T12:53:51Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![sdirix](https://yyz2.discourse-cdn.com/free1/user_avatar/jsonforms.discourse.group/sdirix/32/1073_2.png) [@sdirix](https://jsonforms.discourse.group/u/sdirix)\
**Post date:** [February 9, 2023, 7:37pm UTC](https://jsonforms.discourse.group/t/how-to-pass-internationalization-json-to-jsonform-component-using-i18n-in-react/1298/2 "2023-02-09T19:37:26Z")

</div>

Hi @SouradeepMldt,

What you need to do is to integrate the content of the `i18n.json` file you posted into your `translator`. So depending on your environment you can import your `i18n.json` file or request it from some backend. Then you create the translator and access the object within it, e.g. via `lodash`’s `get`.

For example like this (note that I wrote this from the top of my head and it’s untested).

```auto
import myi18nfile from './i18n.json'; // your tool chain must be able to handle json imports
import get from 'lodash/get';

const createTranslator = locale => (key, defaultMessage) => {
  return get(myi18nfile, `${locale}.${key}`, defaultMessage);
}

// [...]

const translator = useMemo(() => createTranslator(locale), [locale]);

```

---

_[View the full topic](https://jsonforms.discourse.group/t/how-to-pass-internationalization-json-to-jsonform-component-using-i18n-in-react/1298)._
