Skip to content

Commit

Permalink
add language selection to footer
Browse files Browse the repository at this point in the history
  • Loading branch information
JaWetter committed Dec 27, 2023
1 parent d4b3c7c commit 2331ea1
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions app/components/Footer.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import logo from '../../images/JDRF_Reverse_Logo x2.png';
import debugMode from '../utils/debugMode';
import { getOSDetails } from '../actions/utils';
const remote = require('@electron/remote');
const { getCurrentWindow } = remote;
const i18n = remote.getGlobal( 'i18n' );


Expand All @@ -40,6 +41,22 @@ function eulaClick() {
const win = new remote.BrowserWindow({ width: 800, height: 600, frame:false, titleBarStyle: 'hidden', titleBarOverlay: true });
win.loadURL('https://www.sensotrend.fi/connect/eula/');
}
function finnishClick() {
i18n.changeLanguage('fi')
.then((t) => {
console.log('New language', i18n.language, t('Done'));
getCurrentWindow().reload();
})
.catch(console.error);
}
function swedishClick() {
i18n.changeLanguage('sv')
.then((t) => {
console.log('New language', i18n.language, t('Done'));
getCurrentWindow().reload();
})
.catch(console.error);
}

export default class Footer extends Component {
static propTypes = {
Expand Down Expand Up @@ -68,6 +85,12 @@ export default class Footer extends Component {
<div className={styles.el3}>
<a className={styles.footerLink} href="#" onClick={eulaClick}>{i18n.t('Terms of Use')}</a>
</div>
<div className={styles.el3}>
<a className={styles.footerLink} href="#" onClick={finnishClick}>Suomi</a>
</div>
<div className={styles.el3}>
<a className={styles.footerLink} href="#" onClick={swedishClick}>Sverige</a>
</div>
{/*
<div className={styles.jdrfContainer}>
<span className={styles.jdrfText}>{i18n.t('Made possible by')}</span><img className={styles.jdrfImage} src={logo}/>
Expand Down

0 comments on commit 2331ea1

Please sign in to comment.