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
Changes from all 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
@@ -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]}
2 changes: 1 addition & 1 deletion src/helpers/setLocal.js
Original file line number Diff line number Diff line change
@@ -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.

};
2 changes: 1 addition & 1 deletion src/locale/ur.js
Original file line number Diff line number Diff line change
@@ -31,7 +31,7 @@ export default {

'search.placeholder': 'تلاش کر یں',
'search.resultHeading': '{from}-{to} OF <span> {total} </span> SEARCH RESULTS FOR: <span>{query}</span>', // eslint-disable-line max-len
'search.error': 'معذرت، آپ کی تلاش کے ساتھ ایک خرابی پیش آگئی.',
'search.error': 'معذرت، آپ کی تلاش کے ساتھ ایک خرابی پیش آگئی ہے',
'search.nothing': 'تلاش کے لئے کچھ لکھئے',
'search.noResult': 'کوئی نتیجہ نہیں ملا',