diff --git a/openmetadata-docs/content/how-to-guides/how-to-add-language-support.md b/openmetadata-docs/content/how-to-guides/how-to-add-language-support.md index 0f67fb3417c..4d713062d1c 100644 --- a/openmetadata-docs/content/how-to-guides/how-to-add-language-support.md +++ b/openmetadata-docs/content/how-to-guides/how-to-add-language-support.md @@ -24,39 +24,15 @@ touch fr-fr.json ## Sync the Language File with the Primary Language -Since we use `en-us` as our primary language, if you have added a new language file, you need to sync the newly added language file with the primary language. You can use the `i18n` script to achieve this. +To ensure consistency with our primary language, which is `en-us`, it is necessary to synchronize any newly added language files. This can be done by copying the content from the `en-us.json` file and translating it accordingly. -```shell -yarn run i18n -``` +To copy the contents of en-us.json and add it to your translation JSON file, follow these steps: -## Update the `i18nextUtil.ts` +- Go to [en-us.json](https://github.com/open-metadata/OpenMetadata/blob/main/openmetadata-ui/src/main/resources/ui/src/locale/languages/en-us.json) +- Copy the content of file +- Open your translation JSON file. +- Paste the copied text into your translation JSON file. -Now add the newly added language in `i18nextUtil.ts` , so that `i18next` can have the translation resource available. +You can refer to the image below for a visual guide: -```diff -import { InitOptions } from 'i18next'; -import { map } from 'lodash'; -import enUS from '../../locale/languages/en-us.json'; -+ import frFR from '../../locale/languages/fr-fr.json'; - -export const getInitOptions = (): InitOptions => { - return { -+ supportedLngs: ['en-US', 'fr-FR'], - resources: { - 'en-US': { translation: enUS }, -+ 'fr-FR': { translation: frFR }, - }, - fallbackLng: ['en-US'], -``` - -## Test the language translation - -To check the language translation functionality, please follow the steps outlined below: - -1. Click on the language selection dropdown, and a list of available languages will appear. -2. Choose the language you wish to test, and the translation will be applied. - -Please refer to the image below for assistance: - -language-support +copy-en-us diff --git a/openmetadata-docs/images/how-to-guides/language-support.png b/openmetadata-docs/images/how-to-guides/language-support.png index 4423aad9023..39594ff4a0a 100644 Binary files a/openmetadata-docs/images/how-to-guides/language-support.png and b/openmetadata-docs/images/how-to-guides/language-support.png differ diff --git a/openmetadata-ui/src/main/resources/ui/README.md b/openmetadata-ui/src/main/resources/ui/README.md index 4926999dbac..cdaafd1add3 100644 --- a/openmetadata-ui/src/main/resources/ui/README.md +++ b/openmetadata-ui/src/main/resources/ui/README.md @@ -72,39 +72,15 @@ touch fr-fr.json ### Sync the Language File with the Primary Language -Since we use `en-us` as our primary language, if you have added a new language file, you need to sync the newly added language file with the primary language. You can use the `i18n` script to achieve this. +To ensure consistency with our primary language, which is `en-us`, it is necessary to synchronize any newly added language files. This can be done by copying the content from the `en-us.json` file and translating it accordingly. -```shell -yarn run i18n -``` +To copy the contents of en-us.json and add it to your translation JSON file, follow these steps: -### Update the `i18nextUtil.ts` +- Go to [en-us.json](https://github.com/open-metadata/OpenMetadata/blob/main/openmetadata-ui/src/main/resources/ui/src/locale/languages/en-us.json) +- Copy the content of file +- Open your translation JSON file. +- Paste the copied text into your translation JSON file. -Now add the newly added language in `i18nextUtil.ts` , so that `i18next` can have the translation resource available. +You can refer to the image below for a visual guide: -```diff -import { InitOptions } from 'i18next'; -import { map } from 'lodash'; -import enUS from '../../locale/languages/en-us.json'; -+ import frFR from '../../locale/languages/fr-fr.json'; - -export const getInitOptions = (): InitOptions => { - return { -+ supportedLngs: ['en-US', 'fr-FR'], - resources: { - 'en-US': { translation: enUS }, -+ 'fr-FR': { translation: frFR }, - }, - fallbackLng: ['en-US'], -``` - -### Test the language translation - -To check the language translation functionality, please follow the steps outlined below: - -1. Click on the language selection dropdown, and a list of available languages will appear. -2. Choose the language you wish to test, and the translation will be applied. - -Please refer to the image below for assistance: - -image +![image](https://user-images.githubusercontent.com/59080942/227428589-5770b06e-f88d-4a8c-8c45-35ed12f0c4d2.png)