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] extract untracked translations and prettier logging #35171

Merged
merged 18 commits into from
Jun 17, 2019

Conversation

Bamieh
Copy link
Member

@Bamieh Bamieh commented Apr 16, 2019

Running node scripts/i18n_check.js now searches for labels in untracked files and throws an error if it finds any.

Running this script detected 2 plugins using i18n but not adding their namespace to the .i18nrc.json file. This is problematic because we do not extract/translate those untracked packages.

This PR also fixes those issues as well:

  • "embeddableApi": "src/legacy/core_plugins/embeddable_api".
  • "xpack.code": "x-pack/plugins/code"

Better Error logging: https://terminalizer.com/view/98ad16001206

Context: #27376

Dev Docs

Running node scripts/i18n_check.js now searches for labels in untracked files and throws an error if it finds any.

The i18n check tool now has an enhanced reporting experience with better error logging:

render1560538316757

@Bamieh Bamieh requested a review from azasypkin April 16, 2019 16:55
@Bamieh Bamieh changed the title extract untracked translations and prettier logging [i18n] extract untracked translations and prettier logging Apr 16, 2019
@elasticmachine
Copy link
Contributor

💔 Build Failed

@elasticmachine
Copy link
Contributor

💔 Build Failed

@Bamieh Bamieh added the Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc label Apr 17, 2019
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-platform

@Bamieh Bamieh requested a review from a team April 17, 2019 14:35
Copy link
Member

@azasypkin azasypkin left a comment

Choose a reason for hiding this comment

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

Code-wise approach looks good to me, but I defer to Platform team to review and test it thoroughly. Two main issues:

  • I couldn't force i18n_check tool to actually complain about untracked translations (I tried to put i18n calls to packages/kbn-es and xpack/plugins/oss_telemetry, but tool didn't complain). Did I do something wrong?

  • Label extraction seems to be broken - script silently exists and doesn't generate anything

src/dev/run_i18n_check.ts Outdated Show resolved Hide resolved
src/dev/run_i18n_check.ts Outdated Show resolved Hide resolved
src/dev/run_i18n_check.ts Outdated Show resolved Hide resolved
src/dev/run_i18n_check.ts Outdated Show resolved Hide resolved
src/dev/i18n/tasks/extract_untracked_translations.ts Outdated Show resolved Hide resolved
src/dev/i18n/tasks/extract_untracked_translations.ts Outdated Show resolved Hide resolved
src/dev/i18n/tasks/extract_untracked_translations.ts Outdated Show resolved Hide resolved
src/dev/i18n/tasks/extract_untracked_translations.ts Outdated Show resolved Hide resolved
Co-Authored-By: Bamieh <ahmadbamieh@gmail.com>
@elasticmachine
Copy link
Contributor

💔 Build Failed

@elasticmachine
Copy link
Contributor

💔 Build Failed

@Bamieh Bamieh added release_note:plugin_api_changes Contains a Plugin API changes section for the breaking plugin API changes section. :Stack Services labels Jun 14, 2019
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-stack-services

@Bamieh Bamieh requested a review from a team as a code owner June 14, 2019 18:42
Copy link
Contributor

@stacey-gammon stacey-gammon left a comment

Choose a reason for hiding this comment

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

some small suggestions, otherwise the embeddable changes LGTM, thanks!!

Bamieh and others added 4 commits June 14, 2019 22:15
…er/panel_actions/add_panel/add_panel_flyout.tsx

Co-Authored-By: Stacey Gammon <gammon@elastic.co>
…er/panel_actions/add_panel/add_panel_action.tsx

Co-Authored-By: Stacey Gammon <gammon@elastic.co>
@Bamieh Bamieh requested a review from azasypkin June 14, 2019 19:18
@elasticmachine
Copy link
Contributor

💔 Build Failed

@elasticmachine
Copy link
Contributor

💔 Build Failed

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

Copy link
Member

@mistic mistic left a comment

Choose a reason for hiding this comment

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

LGTM in the operations perspective

Copy link
Contributor

@mikecote mikecote left a comment

Choose a reason for hiding this comment

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

LGTM, this caught issues in my upcoming PR 👍

@Bamieh Bamieh merged commit b36aad3 into master Jun 17, 2019
@Bamieh Bamieh deleted the i18n/untracked_checks branch June 17, 2019 13:03
@Bamieh Bamieh added the v7.3.0 label Jun 17, 2019
Bamieh added a commit to Bamieh/kibana that referenced this pull request Jun 17, 2019
…5171)

* extract untracked translations and prettier logging

* self code review

* Update src/dev/run_i18n_check.ts

Co-Authored-By: Bamieh <ahmadbamieh@gmail.com>

* updating listR

* run new i18n_check and fix errors

* kbnEmbeddables -> embeddableApi

* remove any type

* Update src/legacy/core_plugins/embeddable_api/public/panel/panel_header/panel_actions/add_panel/add_panel_flyout.tsx

Co-Authored-By: Stacey Gammon <gammon@elastic.co>

* Update src/legacy/core_plugins/embeddable_api/public/panel/panel_header/panel_actions/add_panel/add_panel_action.tsx

Co-Authored-By: Stacey Gammon <gammon@elastic.co>

* self code review fixes

* fix extract and integrate scripts

* ts-ignore js file
Bamieh added a commit that referenced this pull request Jun 18, 2019
) (#39130)

* [i18n] extract untracked translations and prettier logging (#35171)

* extract untracked translations and prettier logging

* self code review

* Update src/dev/run_i18n_check.ts

Co-Authored-By: Bamieh <ahmadbamieh@gmail.com>

* updating listR

* run new i18n_check and fix errors

* kbnEmbeddables -> embeddableApi

* remove any type

* Update src/legacy/core_plugins/embeddable_api/public/panel/panel_header/panel_actions/add_panel/add_panel_flyout.tsx

Co-Authored-By: Stacey Gammon <gammon@elastic.co>

* Update src/legacy/core_plugins/embeddable_api/public/panel/panel_header/panel_actions/add_panel/add_panel_action.tsx

Co-Authored-By: Stacey Gammon <gammon@elastic.co>

* self code review fixes

* fix extract and integrate scripts

* ts-ignore js file

* run i18n_check
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Project:i18n release_note:plugin_api_changes Contains a Plugin API changes section for the breaking plugin API changes section. Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc v7.3.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants