translator names

This commit is contained in:
crptm 2017-06-02 00:45:00 +04:00
parent aca012af6a
commit 3718e4f128
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;
});
}