diff --git a/frontend/LICENSE b/frontend/LICENSE index 80668b2675..18fb843c83 100644 --- a/frontend/LICENSE +++ b/frontend/LICENSE @@ -186,7 +186,7 @@ Apache License same "printed page" as the copyright notice for easier identification within third-party archives. - Copyright 2014 FINN.no AS + Copyright 2014 Bricks Software AS Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/frontend/public/fr-FR.png b/frontend/public/fr-FR.png new file mode 100644 index 0000000000..fcfa7caf02 Binary files /dev/null and b/frontend/public/fr-FR.png differ diff --git a/frontend/public/pt_BR.png b/frontend/public/pt_BR.png new file mode 100644 index 0000000000..43725657c0 Binary files /dev/null and b/frontend/public/pt_BR.png differ diff --git a/frontend/public/sv-SE.png b/frontend/public/sv-SE.png new file mode 100644 index 0000000000..59595199b3 Binary files /dev/null and b/frontend/public/sv-SE.png differ diff --git a/frontend/src/component/user/show-user-component.jsx b/frontend/src/component/user/show-user-component.jsx index 6107b4c06d..da8548cf77 100644 --- a/frontend/src/component/user/show-user-component.jsx +++ b/frontend/src/component/user/show-user-component.jsx @@ -1,6 +1,7 @@ import React from 'react'; import PropTypes from 'prop-types'; import styles from './user.scss'; +import { Menu, MenuItem } from 'react-mdl'; export default class ShowUserComponent extends React.Component { static propTypes = { @@ -10,13 +11,16 @@ export default class ShowUserComponent extends React.Component { updateSettingLocation: PropTypes.func.isRequired, }; possibleLocales = [ - { value: 'nb-NO', image: 'nb-NO' }, { value: 'en-US', image: 'en-US' }, { value: 'en-GB', image: 'en-GB' }, - { value: 'en-IN', image: 'en-IN' }, + { value: 'nb-NO', image: 'nb-NO' }, + { value: 'sv-SE', image: 'sv-SE' }, { value: 'da-DK', image: 'da-DK' }, + { value: 'en-IN', image: 'en-IN' }, { value: 'de', image: 'de_DE' }, { value: 'cs', image: 'cs_CZ' }, + { value: 'pt-BR', image: 'pt_BR' }, + { value: 'fr-FR', image: 'fr-FR' }, ]; componentDidMount() { @@ -33,11 +37,8 @@ export default class ShowUserComponent extends React.Component { return (this.props.location && this.props.location.locale) || navigator.language || navigator.userLanguage; } - updateLocale() { - const locale = this.getLocale(); - let index = this.possibleLocales.findIndex(v => v.value === locale); - index = (index + 1) % this.possibleLocales.length; - this.props.updateSettingLocation('locale', this.possibleLocales[index].value); + setLocale(locale) { + this.props.updateSettingLocation('locale', locale.value); } render() { @@ -48,9 +49,18 @@ export default class ShowUserComponent extends React.Component { const imageLocale = foundLocale ? `public/${foundLocale.image}.png` : `public/unknown-locale.png`; return (
-
- {locale} +
+ {locale}
+ + {this.possibleLocales.map(i => ( + this.setLocale(i)}> +
+ {i.value} +
+
+ ))} +
 
{email}