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

fixed local change link #622

Merged
merged 6 commits into from
Jan 30, 2017
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/components/LocaleSwitcher/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export default class LocaleSwitcher extends Component {
<MenuItem
key={key}
className={key === this.state.currentLocale && 'active'} // NOTE: if you use key `active` it will make all dropdown active
onClick={() => this.handleLocaleClick(key)}
onClick={(e) => this.handleLocaleClick(key, e)}
href={`?local=${key}`}
>
{locales[key]}
Expand Down
2 changes: 1 addition & 1 deletion src/helpers/setLocal.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,5 @@ export default (req) => {

const localeData = require('../locale/' + currentLocal + '.js'); // eslint-disable-line

return localeData.messages;
return localeData.default.messages;
Copy link
Contributor Author

@naveed-ahmad naveed-ahmad Jan 28, 2017

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 has changed in recent react upgrade, and if that's best way to imports files. @mmahalwy please suggest the better solution :)

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, you need to use .default now that we are on webpack 2. We had a plugin that did it automatically and broke tree-shaking of webpack 2.

};