You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by GitBox <gi...@apache.org> on 2020/06/22 04:58:25 UTC

[GitHub] [incubator-superset] etr2460 opened a new pull request #10129: chore: fix add datasource help string

etr2460 opened a new pull request #10129:
URL: https://github.com/apache/incubator-superset/pull/10129


   ### SUMMARY
   Splitting sentences like this doesn't work for translations because not all languages follow the same sentence structure as English. I fixed the translation by moving the link to a link icon, improved the style of the page, and also put the full string on one line to make grepping easier
   
   ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
   Before:
   <img width="1920" alt="Screen Shot 2020-06-21 at 9 42 05 PM" src="https://user-images.githubusercontent.com/7409244/85250038-3b8d2580-b40a-11ea-8f79-be9d599dddc0.png">
   
   After:
   <img width="1919" alt="Screen Shot 2020-06-21 at 9 51 40 PM" src="https://user-images.githubusercontent.com/7409244/85250029-3334ea80-b40a-11ea-9267-f217054084e8.png">
   
   ### TEST PLAN
   CI, clicking on the link to make sure it works
   
   ### ADDITIONAL INFORMATION
   <!--- Check any relevant boxes with "x" -->
   <!--- HINT: Include "Fixes #nnn" if you are fixing an existing issue -->
   - [ ] Has associated issue:
   - [x] Changes UI
   - [ ] Requires DB Migration.
   - [ ] Confirm DB Migration upgrade and downgrade tested.
   - [ ] Introduces new feature or API
   - [ ] Removes existing feature or API
   
   to: @suddjian @ktmud @graceguo-supercat 


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [incubator-superset] etr2460 commented on pull request #10129: chore: fix add datasource help string

Posted by GitBox <gi...@apache.org>.
etr2460 commented on pull request #10129:
URL: https://github.com/apache/incubator-superset/pull/10129#issuecomment-647568071


   That's a good point, I didn't know you could set a key for these translation functions. Seems like we could do this programmatically instead of needing humans to choose a shorter key when coding.
   
   However, I took a look at the current data, and the bootstrap payload for translations is about 39KB uncompressed. While way too large, it's a very tiny portion of the 1.5MB uncompressed bootstrap data that we get on dashboards from time to time.
   
   If I had to rearchitect/optimize this, I'd:
   1. Remove the translation object from the bootstrap data
   2. Uniquely hash the translation objects by content and bundle with superset as json files, so that each new deploy/build generates a new translation object for each language
   3. Set a cache time of 1 year for all these files, so that the user only ever needs to download a language once
   4. If optimizations are still required, consider programmatically minifying the keys in the translation objects (note gzip should already be doing a decent job at compressing this)


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [incubator-superset] ktmud commented on pull request #10129: chore: fix add datasource help string

Posted by GitBox <gi...@apache.org>.
ktmud commented on pull request #10129:
URL: https://github.com/apache/incubator-superset/pull/10129#issuecomment-647660031


   @etr2460 Ideally you would want unique translation keys even if not for performance, because proper translation needs context---For example, the text "Next" could mean either "next page" or "next item", but in languages like Chinese, "next" has to be followed by a noun/classifier, so we can't just use one translation for all places the text appears.
   
   You'd also want your keys to be something meaningful and namespaced, otherwise it'd be very hard to communicate with translators or debug.
   
   In large international website, there's normally a i18n service and developers need to mark translation keys for the client side on the backend API by API. Then the client side uses translations returned along side the regular data response.
   
   For smaller i18n projects, it's OK to use the process you described. I actually had an SPA many many years ago and did something similar: https://www.npmjs.com/package/yaml-i18n-brunch
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [incubator-superset] etr2460 merged pull request #10129: chore: fix add datasource help string

Posted by GitBox <gi...@apache.org>.
etr2460 merged pull request #10129:
URL: https://github.com/apache/incubator-superset/pull/10129


   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [incubator-superset] etr2460 edited a comment on pull request #10129: chore: fix add datasource help string

Posted by GitBox <gi...@apache.org>.
etr2460 edited a comment on pull request #10129:
URL: https://github.com/apache/incubator-superset/pull/10129#issuecomment-647568071


   @ktmud, that's a good point, I didn't know you could set a key for these translation functions. Seems like we could do this programmatically instead of needing humans to choose a shorter key when coding.
   
   However, I took a look at the current data, and the bootstrap payload for translations is about 39KB uncompressed. While way too large, it's a very tiny portion of the 1.5MB uncompressed bootstrap data that we get on dashboards from time to time.
   
   If I had to rearchitect/optimize this, I'd:
   1. Remove the translation object from the bootstrap data
   2. Uniquely hash the translation objects by content and bundle with superset as json files, so that each new deploy/build generates a new translation object for each language
   3. Set a cache time of 1 year for all these files, so that the user only ever needs to download a language once
   4. If optimizations are still required, consider programmatically minifying the keys in the translation objects (note gzip should already be doing a decent job at compressing this)


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org