Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[i18n] fix generation scripts #4252

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions .i18nrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,17 @@
"visTypeXy": "src/plugins/vis_type_xy",
"visualizations": "src/plugins/visualizations",
"visualize": "src/plugins/visualize",
"apmOss": "src/plugins/apm_oss",
"usageCollection": "src/plugins/usage_collection"
},
"exclude": [
"src/legacy/ui/ui_render/ui_render_mixin.js"
"src/legacy/ui/ui_render/ui_render_mixin.js",
"src/plugins/home/public/application/components/tutorial",
"src/plugins/home/server/tutorials",
"src/core/server/rendering/views/template.tsx",
"src/plugins/data/public/search/errors/timeout_error.tsx",
"src/plugins/home/public/application/components/welcome.tsx",
"src/plugins/vis_type_timeline/server/series_functions/graphite.js",
"src/plugins/vis_type_timeseries/public/application/components/aggs/serial_diff.js"
Comment on lines +68 to +74
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do we want to exclude all these?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These have interpolation that are acting up.

Makes sense why previously they were previously hardcorded into the elements.

Probably will need to create an issue to followup on correctly utilizing i18n to pass interpolation

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's create the issue an unblock this PR

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I made a stub: #4353 - @kavilla please add any details I may have missed. With a little more direct guidance, may also be a potential good first issue.

],
"translations": []
}
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,9 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)

### 🐛 Bug Fixes

- [Chore] Update deprecated url methods (url.parse(), url.format()) ([#2910](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/2910))
- Cleanup unused url ([#3847](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/3847))
- Fix `i18n` generation scripts ([#4252](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/4252))
- [Saved Objects Management] Fix relationships header overflow ([#4070](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/4070))
- Update main menu to display 'Dashboards' for consistency ([#4453](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/4453))
- [Multiple DataSource] Retain the original sample data API ([#4526](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/4526))
Expand Down
Empty file modified scripts/i18n_check.js
100644 → 100755
Empty file.
Empty file modified scripts/i18n_extract.js
100644 → 100755
Empty file.
Empty file modified scripts/i18n_integrate.js
100644 → 100755
Empty file.
2 changes: 1 addition & 1 deletion src/plugins/dashboard/public/plugin.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,7 @@ export class DashboardPlugin
createSortText: 'Dashboard',
createLinkText: (
<FormattedMessage
id="opensearch-dashboards-react.tableListView.listing.createNewItemButtonLabel"
id="dashboard.tableListView.listing.createNewItemButtonLabel"
defaultMessage="{entityName}"
values={{ entityName: 'Dashboard' }}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ export const aggDateRange = (): FunctionDefinition => ({
json: {
types: ['string'],
help: i18n.translate('data.search.aggs.buckets.dateRange.json.help', {
defaultMessage: 'Advanced json to include when the agg is sent to Elasticsearch',
abbyhu2000 marked this conversation as resolved.
Show resolved Hide resolved
defaultMessage: 'Advanced json to include when the agg is sent to OpenSearch',
}),
},
customLabel: {
Expand Down
6 changes: 3 additions & 3 deletions src/plugins/dev_tools/public/application.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ function DevToolsWrapper({
})
.catch(() => {
toasts.addDanger(
i18n.translate('devTool.devToolWrapper.fetchDataSourceError', {
i18n.translate('devTools.devToolWrapper.fetchDataSourceError', {
defaultMessage: 'Unable to fetch existing data sources',
})
);
Expand Down Expand Up @@ -173,10 +173,10 @@ function DevToolsWrapper({
{dataSourceEnabled ? (
<div className="devAppDataSourcePicker">
<EuiComboBox
aria-label={i18n.translate('devTool.devToolWrapper.DataSourceComboBoxAriaLabel', {
aria-label={i18n.translate('devTools.devToolWrapper.DataSourceComboBoxAriaLabel', {
defaultMessage: 'Select a Data Source',
})}
placeholder={i18n.translate('devTool.devToolWrapper.DataSourceComboBoxPlaceholder', {
placeholder={i18n.translate('devTools.devToolWrapper.DataSourceComboBoxPlaceholder', {
defaultMessage: 'Select a Data Source',
})}
singleSelection={{ asPlainText: true }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ export const opensearchDashboards: ExpressionFunctionOpenSearchDashboards = {

inputTypes: ['opensearch_dashboards_context', 'null'],

help: i18n.translate('expressions.functions.kibana.help', {
defaultMessage: 'Gets opensearch dashboards global context',
help: i18n.translate('expressions.functions.opensearchDashboards.help', {
defaultMessage: 'Gets OpenSearch Dashboards global context',
}),

args: {},
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ export const Overview: FC<Props> = ({ newsFetchResult, solutions, features, bran
<h2 id="osdOverviewMore__title">
<FormattedMessage
id="opensearchDashboardsOverview.more.title"
defaultMessage="Do more with Elastic"
defaultMessage="Do more with OpenSearch"
/>
</h2>
</EuiTitle>
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/telemetry/common/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export const getConfigTelemetryDesc = () => {
// Can't find where it's used but copying it over from the legacy code just in case...
return i18n.translate('telemetry.telemetryConfigDescription', {
defaultMessage:
'Help us improve the OpenSearch Stack by providing usage statistics for basic features. We will not share this data outside of Elastic.',
'Help us improve the OpenSearch Stack by providing usage statistics for basic features. We will not share this data outside of OpenSearch.',
});
};

Expand Down
9 changes: 6 additions & 3 deletions src/plugins/visualizations/server/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,13 @@ export class VisualizationsPlugin
defaultMessage: 'Disable visualizations bucket aggregation types',
}),
value: [],
description: i18n.translate('visualizations.advancedSettings.visualizeDisableBucketAgg', {
defaultMessage: `A comma-separated list of bucket aggregations' names. e.g. significant_terms, terms.
description: i18n.translate(
'visualizations.advancedSettings.visualizeDisableBucketAgg.description',
{
defaultMessage: `A comma-separated list of bucket aggregations' names. e.g. significant_terms, terms.
Deactivates the specified bucket aggregations from visualizations.`,
}),
}
),
category: ['visualization'],
schema: schema.arrayOf(schema.string()),
},
Expand Down