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

chore: add custom eslint plugin to prevent translation variables #19828

Merged
merged 1 commit into from
Apr 27, 2022

Conversation

stephenLYZ
Copy link
Member

SUMMARY

Since flask-babel is a static translation translation service, it can’t handle strings that include variables.(refer to #19641). This PR adds a custom eslint plugin to catch these.

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

before

WeChate0e5c68e6cfe29327a6415ef0122fe59

after

WeChat137288c0d44b2fe669013b794badf966

TESTING INSTRUCTIONS

Test Rule

cd superset-frontend
npm run test ./tools/eslint-plugin-translation-vars

Lint

npm run _lint

ADDITIONAL INFORMATION

  • Has associated issue:
  • Required feature flags:
  • Changes UI
  • Includes DB Migration (follow approval process in SIP-59)
    • Migration is atomic, supports rollback & is backwards-compatible
    • Confirm DB migration upgrade and downgrade tested
    • Runtime estimates and downtime expectations provided
  • Introduces new feature or API
  • Removes existing feature or API

cc @villebro @zhaoyongjie @geido

@codecov
Copy link

codecov bot commented Apr 24, 2022

Codecov Report

Merging #19828 (a0a8626) into master (800ced5) will not change coverage.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##           master   #19828   +/-   ##
=======================================
  Coverage   66.55%   66.55%           
=======================================
  Files        1692     1692           
  Lines       64802    64802           
  Branches     6657     6657           
=======================================
  Hits        43129    43129           
  Misses      19973    19973           
  Partials     1700     1700           
Flag Coverage Δ
javascript 51.25% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
...ntend/src/views/CRUD/annotation/AnnotationList.tsx 69.35% <ø> (ø)
...erset-frontend/src/SqlLab/utils/newQueryTabName.ts 86.66% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 800ced5...a0a8626. Read the comment docs.

Copy link
Member

@zhaoyongjie zhaoyongjie left a comment

Choose a reason for hiding this comment

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

It's awesome and highly valuable. I tested in my local.

image

@zhaoyongjie zhaoyongjie merged commit f9d28a1 into apache:master Apr 27, 2022
@villebro
Copy link
Member

Nice work @stephenLYZ ! ❤️

hughhhh pushed a commit to hve-labs/superset that referenced this pull request May 11, 2022
philipher29 pushed a commit to ValtechMobility/superset that referenced this pull request Jun 9, 2022
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 2.0.0 labels Mar 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels size/L 🚢 2.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants