Merge pull request #11 from MyEtherWallet/feat/translator-names

translator names
This commit is contained in:
Daniel Ternyak 2017-06-01 23:46:21 -05:00 committed by GitHub
commit 9144d2c666
2 changed files with 27 additions and 5 deletions

View File

@ -1,13 +1,10 @@
import React, {Component} from 'react';
import translate from 'translations';
import translate, {getTranslators} from 'translations';
export default class Footer extends Component {
constructor(props) {
super(props)
}
render() {
const translators = getTranslators()
return (
<footer role="contentinfo" aria-label="footer">
<div className="container">
@ -55,6 +52,15 @@ export default class Footer extends Component {
TREZOR</a>
</li>
</ul>
{!!translators.length &&
<h5> <i>🏅</i> <span>{translate('Translator_Desc')}</span></h5>
}
{!!translators.length &&
<ul>
<li>{translators.map(key => <span key={key}>{translate(key)}</span>)}</li>
</ul>
}
</div>
<div className="col-sm-3 footer-3">
<h5><i aria-hidden="true">🌎</i> On the Web</h5>

View File

@ -40,3 +40,19 @@ export default function translate(key: string) {
repository[activeLanguage][key] || repository[fallbackLanguage][key] || key
);
}
export function getTranslators() {
return [
'TranslatorName_1',
'TranslatorName_2',
'TranslatorName_3',
'TranslatorName_4',
'TranslatorName_5'
].filter(x => {
const translated = translate(x);
if (typeof translated === 'string') {
return !!translated.trim();
}
return !!translated;
});
}