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][system upgrade] Upgrade i18n tooling #186519

Merged
merged 25 commits into from
Jul 16, 2024
Merged
Show file tree
Hide file tree
Changes from 13 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
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export const registerCreateEuiMarkdownAction = (uiActions: UiActionsStart) => {
);
},
getDisplayName: () =>
i18n.translate('embeddableExamples.euiMarkdownEditor.ariaLabel', {
i18n.translate('embeddableExamples.euiMarkdownEditor.displayNameAriaLabel', {
defaultMessage: 'EUI Markdown',
}),
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ export const markdownEmbeddableFactory: ReactEmbeddableFactory<
`}
value={content ?? ''}
onChange={(value) => content$.next(value)}
aria-label={i18n.translate('embeddableExamples.euiMarkdownEditor.ariaLabel', {
aria-label={i18n.translate('embeddableExamples.euiMarkdownEditor.embeddableAriaLabel', {
defaultMessage: 'Dashboard markdown editor',
})}
height="full"
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@
"@formatjs/intl-pluralrules": "^5.2.12",
"@formatjs/intl-relativetimeformat": "^11.2.12",
"@formatjs/intl-utils": "^3.8.4",
"@formatjs/ts-transformer": "^3.13.14",
"@grpc/grpc-js": "^1.8.22",
"@hapi/accept": "^5.0.2",
"@hapi/boom": "^9.1.4",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ export function Header({
button={
<HeaderMenuButton
data-test-subj="toggleNavButton"
aria-label={i18n.translate('core.ui.primaryNav.toggleNavAriaLabel', {
aria-label={i18n.translate('core.ui.primaryNav.header.toggleNavAriaLabel', {
defaultMessage: 'Toggle primary navigation',
})}
onClick={() => setIsNavOpen(!isNavOpen)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ const headerStrings = {
}),
},
nav: {
closeNavAriaLabel: i18n.translate('core.ui.primaryNav.toggleNavAriaLabel', {
closeNavAriaLabel: i18n.translate('core.ui.primaryNav.project.toggleNavAriaLabel', {
defaultMessage: 'Toggle primary navigation',
}),
},
Expand Down
14 changes: 7 additions & 7 deletions packages/kbn-i18n/src/core/error_handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@
import { OnErrorFn, IntlErrorCode } from '@formatjs/intl';

export const handleIntlError: OnErrorFn = (error) => {
// Dont throw on missing translations.
/**
* throw on any intl error except missing translations
* we do not throw on missing translations because our process
* of translations happens after developers have commited their
* strings in english.
*/
if (error.code !== IntlErrorCode.MISSING_TRANSLATION) {
// eslint-disable-next-line no-console
console.error(
'Error Parsing translation string. This will start throwing an error once the i18n package tooling is upgraded.'
);
// eslint-disable-next-line no-console
console.error(error);
throw error;
}
};
Original file line number Diff line number Diff line change
Expand Up @@ -4478,6 +4478,7 @@ ROW ver = CONCAT(("0"::INT + 1)::STRING, ".2.3")::VERSION
`,
description:
'Text is in markdown. Do not translate function names, special characters, or field names like sum(bytes)',
ignoreTag: true,
}
)}
/>
Expand Down
2 changes: 1 addition & 1 deletion scripts/i18n_check.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@
*/

require('../src/setup_node_env');
require('../src/dev/run_i18n_check');
require('../src/dev/i18n_tools/bin/run_i18n_check');
2 changes: 1 addition & 1 deletion scripts/i18n_extract.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@
*/

require('../src/setup_node_env');
require('../src/dev/run_i18n_extract');
require('../src/dev/i18n_tools/bin/run_i18n_extract');
2 changes: 1 addition & 1 deletion scripts/i18n_integrate.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@
*/

require('../src/setup_node_env');
require('../src/dev/run_i18n_integrate');
require('../src/dev/i18n_tools/bin/run_i18n_integrate');

This file was deleted.

This file was deleted.

This file was deleted.

63 changes: 0 additions & 63 deletions src/dev/i18n/__fixtures__/integrate_locale_files/fr.json

This file was deleted.

This file was deleted.

Loading