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

#8294: Set moment library language during app setup #8296

Merged
merged 5 commits into from
Oct 2, 2019
Merged

#8294: Set moment library language during app setup #8296

merged 5 commits into from
Oct 2, 2019

Conversation

oskarhinc
Copy link
Contributor

CATEGORY

Choose one

  • Bug Fix
  • Enhancement (new features, refinement)
  • Refactor
  • Add tests
  • Build / Development Environment
  • Documentation

SUMMARY

Make use of moment.locale method to change its language globally (as described in https://momentjs.com/docs/#/i18n/changing-locale/), when the app is set up (which is happening also on language change).

ADDITIONAL INFORMATION

@oskarhinc
Copy link
Contributor Author

oskarhinc commented Sep 26, 2019

@kristw I've corrected mentioned issues.
Regarding Travis checks - are they always reliable? I'm wondering as in the previous build failed in another place than the latest one (due to request timeout as well), but it doesn't seem to be related with my changes in code.

@villebro
Copy link
Member

@oskarhinc some tests aren't always reliable; I restarted CI, check back in a while to see if it fixes the problem.

@oskarhinc
Copy link
Contributor Author

@villebro Thanks a lot!

@@ -29,6 +29,7 @@ if (typeof window !== 'undefined') {
if (bootstrapData.common && bootstrapData.common.language_pack) {
const languagePack = bootstrapData.common.language_pack;
configure({ languagePack });
localStorage.setItem('locale', bootstrapData.common.locale);
Copy link
Contributor

Choose a reason for hiding this comment

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

Does it produce the same result if you call moment.locale() here without using localStorage at all?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You're right - I've removed the usage of localStorage now

@codecov-io
Copy link

codecov-io commented Sep 27, 2019

Codecov Report

Merging #8296 into master will decrease coverage by 5.79%.
The diff coverage is 0%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #8296      +/-   ##
==========================================
- Coverage   73.53%   67.74%    -5.8%     
==========================================
  Files         115      451     +336     
  Lines       12396    22700   +10304     
  Branches        0     2370    +2370     
==========================================
+ Hits         9116    15378    +6262     
- Misses       3280     7185    +3905     
- Partials        0      137     +137
Impacted Files Coverage Δ
superset/assets/src/preamble.js 0% <0%> (ø)
...sets/src/explore/components/ExploreChartHeader.jsx 50% <0%> (ø)
superset/assets/src/components/Checkbox.jsx 100% <0%> (ø)
...perset/assets/src/dashboard/util/getEmptyLayout.js 0% <0%> (ø)
...ts/src/dashboard/util/getComponentWidthFromDrop.js 95.23% <0%> (ø)
.../assets/src/dashboard/reducers/dashboardFilters.js 88.23% <0%> (ø)
...rc/explore/components/controls/AnnotationLayer.jsx 2.46% <0%> (ø)
superset/assets/src/welcome/DashboardTable.jsx 87.5% <0%> (ø)
...erset/assets/src/dashboard/util/injectCustomCss.js 91.66% <0%> (ø)
...explore/components/controls/ColorPickerControl.jsx 85% <0%> (ø)
... and 327 more

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 0a8f3eb...afe2c4b. Read the comment docs.

@kristw kristw merged commit 9596935 into apache:master Oct 2, 2019
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 0.35.0 labels Feb 28, 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/S 🚢 0.35.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Make use of moment library localization support
5 participants