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

Commit

Permalink
Fixes #686 Translations author name
Browse files Browse the repository at this point in the history
  • Loading branch information
mmahalwy committed Mar 19, 2017
1 parent 90458ac commit 430ba6d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/components/ContentDropdown/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ class ContentDropdown extends Component {
}
}

renderItems(items, key) {
renderItems(items, render) {
const { translations } = this.props;

return items.map((translation) => {
Expand All @@ -86,7 +86,7 @@ class ContentDropdown extends Component {
/>

<label htmlFor={translation.id + translation.languageName} className={style.label}>
{translation[key]}
{render(translation)}
</label>
</li>
);
Expand All @@ -98,15 +98,15 @@ class ContentDropdown extends Component {
.filter(translation => translation.languageName === 'English')
.sort(compareAlphabetically('authorName'));

return this.renderItems(list, 'authorName');
return this.renderItems(list, translation => translation.authorName);
}

renderLanguagesList() {
const list = this.props.translationOptions
.filter(translation => translation.languageName !== 'English')
.sort(compareAlphabetically('languageName'));

return this.renderItems(list, 'languageName');
return this.renderItems(list, translation => `${translation.languageName} - ${translation.authorName}`);
}

render() {
Expand Down

0 comments on commit 430ba6d

Please sign in to comment.