mirror of
https://github.com/open-metadata/OpenMetadata.git
synced 2025-08-21 23:48:47 +00:00
doc: Add doc for "how to add language support" (#10585)
* doc: Add doc for "how to add language support" * fix: build
This commit is contained in:
parent
93e554ae67
commit
cde1d36570
@ -0,0 +1,62 @@
|
|||||||
|
---
|
||||||
|
title: How to Add Language Support
|
||||||
|
slug: /how-to-guides/how-to-add-language-support
|
||||||
|
---
|
||||||
|
|
||||||
|
# How to Add Language Support
|
||||||
|
|
||||||
|
To add support for a new language in our internationalization setup using `react-i18next` and `i18next`, please follow the steps below:
|
||||||
|
|
||||||
|
## Create a Language JSON File
|
||||||
|
|
||||||
|
First, create a new JSON file for the language you want to add in the `openmetadata-ui/src/main/resources/ui/src/locale/languages` directory.
|
||||||
|
|
||||||
|
For example, if you want to add support for the `French` language, you can create a file called `fr-fr.json` in the languages directory:
|
||||||
|
|
||||||
|
```shell
|
||||||
|
# Navigate to the ui/src/locale/languages directory
|
||||||
|
cd openmetadata-ui/src/main/resources/ui/src/locale/languages
|
||||||
|
|
||||||
|
# Create the French language file
|
||||||
|
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.
|
||||||
|
|
||||||
|
```shell
|
||||||
|
yarn run i18n
|
||||||
|
```
|
||||||
|
|
||||||
|
## Update the `i18nextUtil.ts`
|
||||||
|
|
||||||
|
Now add the newly added language in `i18nextUtil.ts` , so that `i18next` can have the translation resource available.
|
||||||
|
|
||||||
|
```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 alt="language-support" src="/images/how-to-guides/language-support.png"/>
|
@ -165,7 +165,7 @@ site_menu:
|
|||||||
url: /deployment/upgrade/versions/011-to-012
|
url: /deployment/upgrade/versions/011-to-012
|
||||||
- category: Deployment / Upgrade OpenMetadata / Upgrade Version Instructions / 0.12 to 0.13
|
- category: Deployment / Upgrade OpenMetadata / Upgrade Version Instructions / 0.12 to 0.13
|
||||||
url: /deployment/upgrade/versions/012-to-013
|
url: /deployment/upgrade/versions/012-to-013
|
||||||
|
|
||||||
- category: Deployment / Backup & Restore Metadata
|
- category: Deployment / Backup & Restore Metadata
|
||||||
url: /deployment/backup-restore-metadata
|
url: /deployment/backup-restore-metadata
|
||||||
|
|
||||||
@ -579,6 +579,8 @@ site_menu:
|
|||||||
url: /how-to-guides/how-to-add-custom-property-to-an-entity
|
url: /how-to-guides/how-to-add-custom-property-to-an-entity
|
||||||
- category: How to guides / How to add Custom Logo
|
- category: How to guides / How to add Custom Logo
|
||||||
url: /how-to-guides/custom-logo/how-to-add-custom-logo
|
url: /how-to-guides/custom-logo/how-to-add-custom-logo
|
||||||
|
- category: How to guides / How to Add Language Support
|
||||||
|
url: /how-to-guides/how-to-add-language-support
|
||||||
|
|
||||||
- category: Features
|
- category: Features
|
||||||
url: /openmetadata
|
url: /openmetadata
|
||||||
|
BIN
openmetadata-docs/images/how-to-guides/language-support.png
Normal file
BIN
openmetadata-docs/images/how-to-guides/language-support.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 476 KiB |
Loading…
x
Reference in New Issue
Block a user