We're glad you're here. dashboards-i18n is a community driven plugin for localization. To use it, here's what you need to do.
Fork this repository on GitHub, and clone locally with git clone
.
-
Download OpenSearch. You could clone the OpenSearch repo, use docker or artifact. Make sure the version matches the OpenSearch Dashboards version.
-
Setup the environment to run OpenSearch Dashboards. You will need to install node.js, nvm, and yarn in your environment to properly pull down dependencies to build and bootstrap.
-
Download the OpenSearch-Dashboards source code.
See the OpenSearch Dashboards developer guide for more instructions on setting up your development environment.
-
Change your node version to the version specified in
.node-version
inside the OpenSearch-Dashboards root directory. -
cd into the
plugins
directory of the OpenSearch-Dashboards source code directory. Clone dashboards-i18n into theplugins
directory. Ultimately, your directory structure should look like this:
.
├── OpenSearch-Dashboards
│ └── plugins
│ └── dashboards-i18n
- Make sure the version of dashboards-i18n plugin in the
opensearch_dashboards.json
file matches the version of OpenSearch Dashboards. If the version needs to be updated, you can use the provided script to automatically update theopensearchDashboardsVersion
in theopensearch_dashboards.json
file. To update the version, run the following command in thedashboards-i18n
directory:
yarn update-version
-
Config localization in dashboards-i18n. Add a locale json file in
translations
directory of the dashboards-i18n. Specify the path in.i18nrc.json
. For example, if the locale json file you added is calledzh-CN.json
, the path should be"translations": ["translations/zh-CN.json"]
. -
Config localization in OpenSearch Dashboards. cd into the
config
directory of the OpenSearch-Dashboards source code directory. Addi18n.locale: "{your locale}"
inopensearch_dashboards.yml
file. -
Run
yarn osd bootstrap
underOpensearch-Dashboards
.
-
yarn start
- Starts OpenSearch-Dashboards and includes this plugin. A localized OpenSearch-Dashboards will be available on
localhost:5601
. - Please run in the OpenSearch-Dashboards root directory
- You must have OpenSearch running.
- Starts OpenSearch-Dashboards and includes this plugin. A localized OpenSearch-Dashboards will be available on
- Setup environment. Please refer to Environment Setup.
- Config localization in dashboards-i18n. Add the following example
zh-CN.json
file intranslations
directory. In.i18nrc.json
, add the path"translations": ["translations/zh-CN.json"
.
{
"formats": {
"number": {
"currency": {
"style": "currency"
},
"percent": {
"style": "percent"
}
},
"date": {
"short": {
"month": "numeric",
"day": "numeric",
"year": "2-digit"
},
"medium": {
"month": "short",
"day": "numeric",
"year": "numeric"
},
"long": {
"month": "long",
"day": "numeric",
"year": "numeric"
},
"full": {
"weekday": "long",
"month": "long",
"day": "numeric",
"year": "numeric"
}
},
"time": {
"short": {
"hour": "numeric",
"minute": "numeric"
},
"medium": {
"hour": "numeric",
"minute": "numeric",
"second": "numeric"
},
"long": {
"hour": "numeric",
"minute": "numeric",
"second": "numeric",
"timeZoneName": "short"
},
"full": {
"hour": "numeric",
"minute": "numeric",
"second": "numeric",
"timeZoneName": "short"
}
},
"relative": {
"years": {
"units": "year"
},
"months": {
"units": "month"
},
"days": {
"units": "day"
},
"hours": {
"units": "hour"
},
"minutes": {
"units": "minute"
},
"seconds": {
"units": "second"
}
}
},
"messages": {
"console.devToolsDescription": "跳过 cURL 并使用 JSON 接口在控制台中处理您的数据。",
"console.devToolsTitle": "与 OpenSearch API 进行交互",
"core.ui.welcomeMessage": "正在加载 OpenSearch",
"dashboard.featureCatalogue.dashboardSubtitle": "在控制板中分析数据。",
"discover.discoverSubtitle": "搜索和查找数据分析结果。",
"home.addData.sectionTitle": "获取你的数据",
"home.breadcrumbs.homeTitle": "主页",
"home.header.title": "欢迎归来",
"home.manageData.sectionTitle": "管理你的数据",
"home.tutorialDirectory.featureCatalogueDescription": "从热门应用和服务中采集数据。",
"home.tutorialDirectory.featureCatalogueTitle": "添加数据",
"opensearchDashboardsOverview.opensearchDashboards.solution.subtitle": "可视化和分析",
"opensearch-dashboards-react.osdOverviewPageHeader.addDataButtonLabel": "添加数据",
"opensearch-dashboards-react.osdOverviewPageHeader.devToolsButtonLabel": "开发工具",
"opensearch-dashboards-react.osdOverviewPageHeader.stackManagementButtonLabel": "管理",
"opensearch-dashboards-react.pageFooter.appDirectoryButtonLabel": "查看应用目录",
"opensearch-dashboards-react.pageFooter.changeHomeRouteLink": "登录时显示不同页面"
}
}
- Config localization in OpenSearch Dashboards. Add
i18n.locale: "zh-CN"
inopensearch_dashboards.yml
file. - Run OpenSearch and OpenSearch Dashboards. Verify the login and home pages are correctly translated.
Currently, we support en/en-US (English), es/es-LA (Spanish), fr/fr-FR (French), de/de-DE (German), ja/ja-JP (Japanese), ko/ko-KR (Korean), ru/ru-RU (Russian), zh/zh-CN (Chinese). If your locale is not in it, please open an issue in OpenSearch Dashboards.
Are you ready to contribute? You could send a PR to upload a new locale file or add up the existing locale. You could also contribute by opening an issue for any translation errors or just sharing some thoughts.