Skip to content
This repository has been archived by the owner on Dec 10, 2021. It is now read-only.

Add @superset-ui/translation #12

Merged
merged 10 commits into from
Oct 24, 2018
Merged

Add @superset-ui/translation #12

merged 10 commits into from
Oct 24, 2018

Conversation

kristw
Copy link
Contributor

@kristw kristw commented Oct 23, 2018

🏆 Enhancements
Add @superset-ui/translation that is ported from i18n.jsx and locales.jsx in apache/incubator-superset

📜 Documentation
See README

Unit test results

 PASS  test/index.test.js
  index
    ✓ exports configure() (3ms)
    ✓ exports t() (1ms)

 PASS  test/Translator.test.js
  Translator
    ✓ exists (3ms)
    new Translator(config)
      ✓ initializes when config is not specified (2ms)
      ✓ initializes when config is an empty object (6ms)
      ✓ initializes when config is specified
    .translate(input, ...args)
      ✓ returns null for null input (1ms)
      ✓ returns undefined for undefined input
      ✓ translates simple text (2ms)
      ✓ translates template text with arguments (2ms)

 PASS  test/TranslatorSingleton.test.js
  TranslatorSingleton
    before configure()
      t()
        ✓ throws error (1ms)
    after configure()
      configure()
        ✓ creates and returns a translator
      t()
        ✓ after configure() returns translated text

Test Suites: 3 passed, 3 total
Tests:       13 passed, 13 total
Snapshots:   0 total
Time:        3.272s
Ran all test suites.
=============================== Coverage summary ===============================
Statements   : 100% ( 12/12 )
Branches     : 100% ( 10/10 )
Functions    : 100% ( 5/5 )
Lines        : 100% ( 12/12 )
================================================================================

Copy link
Contributor

@williaster williaster left a comment

Choose a reason for hiding this comment

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

lgtm overall! thanks for adding tests, that 💯= 👌

also so happy the weird react code could be removed 🎉

"homepage": "/~https://github.com/apache-superset/superset-ui#readme",
"devDependencies": {
"@data-ui/build-config": "^0.0.23",
"react": "^16.4.1"
Copy link
Contributor

Choose a reason for hiding this comment

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

react devDependency + peerDependency can go away now right? 🎉

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes!

},
"prettier"
],
"eslint": {
Copy link
Contributor

@williaster williaster Oct 24, 2018

Choose a reason for hiding this comment

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

It's not a big deal since my PR is moving this config to the root but you can prob remove the app-specific beemo eslint config here for this since this was for the promises in @superset-ui/core

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Cool

"client",
"translation"
],
"author": "",
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not sure what to do about these. whoever inits the package could put their name, or maybe we can omit the field in package.jsons to make it a non-issue 🤔

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'll put Superset for now.

@kristw kristw merged commit 13487f2 into master Oct 24, 2018
@kristw kristw deleted the kristw--translation branch October 24, 2018 21:43
@kristw kristw added reviewable Ready for review and removed reviewable Ready for review labels Nov 13, 2018
@kristw kristw added the #enhancement New feature or request label Dec 6, 2018
kristw added a commit that referenced this pull request Apr 17, 2020
* feat: add declaration for external packages

* feat: add dependency

* fix: address comments
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
#enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants