Commit 792ee493 authored by Matija Obreza's avatar Matija Obreza

No language selection for single language

parent e270e2cc
const languages = [
{ label: 'English', short: 'en' },
{ label: 'Arabic', short: 'ar', rtl: true },
{ label: 'English', short: 'en', rtl: false }, // rtl: false as template
// { label: 'Arabic', short: 'ar', rtl: true },
// {label: 'German', short: 'de'},
// {label: 'Spanish', short: 'es'},
// {label: 'Persian', short: 'fa', rtl: true},
// {label: 'French', short: 'fr'},
{ label: 'Portuguese', short: 'pt' },
{ label: 'Russian', short: 'ru' },
// { label: 'Portuguese', short: 'pt' },
// { label: 'Russian', short: 'ru' },
// {label: 'Chinese', short: 'zh'},
];
......
......@@ -88,8 +88,14 @@ class LangListComponent extends React.Component<ILangListComponentProps, any> {
}
public render() {
if (languages.length <= 1) {
// No dropdown for a single language
return null;
}
const { classes, i18n } = this.props;
let currentLang = i18n.language;
languages.some((item, i, arr) => {
if (item.short === i18n.language) {
currentLang = item.label;
......
......@@ -72,9 +72,9 @@ const Layout = ({classes, children = null, sidebar = null}: ILayoutProps) => (
<div className={ classes.children }>
{ children }
</div>
<div className={ classes.footer }>
{ false && <div className={ classes.footer }>
<Footer />
</div>
</div> }
</div>
) }
</div>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment