diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 000000000000..d170bb62cc49 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "i18n"] + path = plugins/i18n-plugin + url = https://github.com/abbyhu2000/i18n-plugin.git diff --git a/config/opensearch_dashboards.yml b/config/opensearch_dashboards.yml index 3ece0fd3b612..9f286b399eb4 100644 --- a/config/opensearch_dashboards.yml +++ b/config/opensearch_dashboards.yml @@ -126,7 +126,7 @@ # Specifies locale to be used for all localizable strings, dates and number formats. # Supported languages are the following: English - en , by default , Chinese - zh-CN . -#i18n.locale: "en" +i18n.locale: "zh-CN" # Set the allowlist to check input graphite Url. Allowlist is the default check list. #vis_type_timeline.graphiteAllowedUrls: ['https://www.hostedgraphite.com/UID/ACCESS_KEY/graphite'] diff --git a/package.json b/package.json index b18c6dc863a5..b6eab4fd39d4 100644 --- a/package.json +++ b/package.json @@ -11,7 +11,7 @@ "dashboarding" ], "private": true, - "version": "3.0.0", + "version": "2.1.0", "branch": "main", "types": "./opensearch_dashboards.d.ts", "tsdocMetadata": "./build/tsdoc-metadata.json", diff --git a/plugins/.gitignore b/plugins/.gitignore index 86d0cb2726c6..25cc06f02190 100644 --- a/plugins/.gitignore +++ b/plugins/.gitignore @@ -1,4 +1,4 @@ # Ignore everything in this directory -* + # Except this file !.gitignore \ No newline at end of file diff --git a/plugins/i18n-plugin b/plugins/i18n-plugin new file mode 160000 index 000000000000..c2a6dc3d8b41 --- /dev/null +++ b/plugins/i18n-plugin @@ -0,0 +1 @@ +Subproject commit c2a6dc3d8b413254bd0f74cbf311f08550c1ac32 diff --git a/src/core/public/chrome/ui/header/collapsible_nav.tsx b/src/core/public/chrome/ui/header/collapsible_nav.tsx index 51d43d96f7fd..1ac1209dcb79 100644 --- a/src/core/public/chrome/ui/header/collapsible_nav.tsx +++ b/src/core/public/chrome/ui/header/collapsible_nav.tsx @@ -278,12 +278,18 @@ export function CollapsibleNav({ const category = categoryDictionary[categoryName]!; const opensearchLinkLogo = category.id === 'opensearchDashboards' ? customSideMenuLogo() : category.euiIconType; + const opensearchTitle = + category.id === 'opensearchDashboards' ? + i18n.translate('core.ui.primaryNavSection.title', { + defaultMessage: 'Opensearch Dashboards', + }) + : category.label; return ( setIsCategoryOpen(category.id, isCategoryOpen, storage)} diff --git a/src/core/server/rendering/rendering_service.tsx b/src/core/server/rendering/rendering_service.tsx index 2362be550078..e32a8a9f141b 100644 --- a/src/core/server/rendering/rendering_service.tsx +++ b/src/core/server/rendering/rendering_service.tsx @@ -90,6 +90,7 @@ export class RenderingService { }; const basePath = http.basePath.get(request); const uiPublicUrl = `${basePath}/ui`; + console.log(uiPublicUrl) const serverBasePath = http.basePath.serverBasePath; const settings = { defaults: uiSettings.getRegistered(), @@ -120,7 +121,7 @@ export class RenderingService { env, anonymousStatusPage: status.isStatusPageAnonymous(), i18n: { - translationsUrl: `${basePath}/translations/${i18n.getLocale()}.json`, + translationsUrl: `${basePath}/translations/${i18n.getLocale()}.json` }, csp: { warnLegacyBrowsers: http.csp.warnLegacyBrowsers }, vars: vars ?? {}, diff --git a/src/plugins/home/public/application/components/solutions_section/solution_title.tsx b/src/plugins/home/public/application/components/solutions_section/solution_title.tsx index 8a0db3ac1afb..8384e43bca4c 100644 --- a/src/plugins/home/public/application/components/solutions_section/solution_title.tsx +++ b/src/plugins/home/public/application/components/solutions_section/solution_title.tsx @@ -39,6 +39,7 @@ import { IconType, } from '@elastic/eui'; import { HomePluginBranding } from '../../../plugin'; +import { FormattedMessage } from '@osd/i18n/react'; interface Props { /** @@ -151,7 +152,12 @@ export const SolutionTitle: FC = ({ title, subtitle, iconType, branding } data-test-subj="dashboardCustomTitle" data-test-title={branding.applicationTitle} > -

{branding.applicationTitle}

+

+ +

diff --git a/src/plugins/opensearch_dashboards_react/public/overview_page/overview_page_header/overview_page_header.tsx b/src/plugins/opensearch_dashboards_react/public/overview_page/overview_page_header/overview_page_header.tsx index 00273fcf993b..3016314e809f 100644 --- a/src/plugins/opensearch_dashboards_react/public/overview_page/overview_page_header/overview_page_header.tsx +++ b/src/plugins/opensearch_dashboards_react/public/overview_page/overview_page_header/overview_page_header.tsx @@ -150,7 +150,14 @@ export const OverviewPageHeader: FC = ({ -

{title}

+

+ {i18n.translate( + 'opensearch-dashboards-react.osdOverviewPageHeader.title', + { + defaultMessage: title.toString(), + } + )} +