--- /dev/null
+import axios from 'axios';
+import PropTypes from 'prop-types';
+import React from 'react';
+import { Button } from 'react-bootstrap';
+import { withTranslation } from 'react-i18next';
+
+import Icon from './Icon';
+import { withUser } from '../../helpers/UserContext';
+import i18n from '../../i18n';
+
+const setLanguage = (user, language) => {
+ i18n.changeLanguage(language);
+ if (user) {
+ axios.post('/api/users/set-language', { language });
+ }
+};
+
+const LanguageSwitcher = ({ user }) =>
+<Button
+ onClick={() => { setLanguage(user, i18n.language === 'de' ? 'en' : 'de'); }}
+ title={i18n.language === 'de' ? 'Switch to english' : 'Auf deutsch wechseln'}
+ variant="outline-secondary"
+>
+ <Icon.LANGUAGE />
+ {' '}
+ {i18n.language === 'de' ? 'Deutsch' : 'English'}
+</Button>;
+
+LanguageSwitcher.propTypes = {
+ user: PropTypes.shape({
+ }),
+};
+
+export default withTranslation()(withUser(LanguageSwitcher));
--- /dev/null
+/* eslint-disable max-len */
+export default {
+ translation: {
+ button: {
+ add: 'Add',
+ back: 'Back',
+ cancel: 'Cancel',
+ close: 'Close',
+ edit: 'Edit',
+ help: 'Help',
+ login: 'Login',
+ logout: 'Logout',
+ new: 'New',
+ protocol: 'Protocol',
+ save: 'Save',
+ search: 'Search',
+ },
+ general: {
+ appName: 'ALttP',
+ },
+ icon: {
+ DiscordIcon: 'Discord',
+ EditIcon: 'Edit',
+ FinishedIcon: 'Finished',
+ FirstPlaceIcon: 'First Place',
+ ForfeitIcon: 'Forfeit',
+ LogoutIcon: 'Logout',
+ PendingIcon: 'Pending',
+ SecondPlaceIcon: 'Second Place',
+ ThirdPlaceIcon: 'Third Place',
+ zelda: {
+ 'big-key': 'Big Key',
+ 'blue-boomerang': 'Boomerang',
+ 'blue-mail': 'Blue Mail',
+ 'blue-pendant': 'Pendant of Power',
+ 'blue-potion': 'Blue Potion',
+ bombos: 'Bombos',
+ bomb: 'Bomb',
+ book: 'Book',
+ boots: 'Boots',
+ 'bottle-bee': 'Bee in a Bottle',
+ bottle: 'Bottle',
+ bow: 'Bow',
+ bugnet: 'Bugnet',
+ byrna: 'Cane of Byrna',
+ cape: 'Cape',
+ compass: 'Compass',
+ crystal: 'Crystal',
+ duck: 'Duck',
+ ether: 'Ether',
+ fairy: 'Fairy in a Bottle',
+ 'fighter-shield': 'Fighter Shield',
+ 'fire-rod': 'Fire Rod',
+ 'fire-shield': 'Fire Shield',
+ flippers: 'Flippers',
+ flute: 'Flute',
+ glove: 'Power Glove',
+ 'green-mail': 'Green Mail',
+ 'green-pendant': 'Pendant of Courage',
+ 'green-potion': 'Green Potion',
+ hammer: 'Hammer',
+ 'heart-container': 'Heart Container',
+ 'heart-piece': 'Heart Piece',
+ hookshot: 'Hookshot',
+ 'ice-rod': 'Ice Rod',
+ lamp: 'Lamp',
+ map: 'Map',
+ mirror: 'Mirror',
+ 'mirror-shield': 'Mirror Shield',
+ mitts: 'Titan \'s Mitts',
+ moonpearl: 'Moonpearl',
+ mushroom: 'Mushroom',
+ powder: 'Powder',
+ quake: 'Quake',
+ 'red-bomb': 'Red Bomb',
+ 'red-boomerang': 'Red Boomerang',
+ 'red-mail': 'Red Mail',
+ 'red-pendant': 'Pendant of Wisdom',
+ 'red-potion': 'Red Potion',
+ shovel: 'Shovel',
+ silvers: 'Silvers',
+ 'small-key': 'Small Key',
+ somaria: 'Cane of Somaria',
+ },
+ },
+ participants: {
+ empty: 'No participants on record',
+ heading: 'Participants',
+ participant: 'Participant',
+ score: 'Score',
+ },
+ protocol: {
+ description: {
+ result: {
+ report: 'Result reported',
+ },
+ round: {
+ create: 'Round added',
+ },
+ unknown: 'Unknown protocol entry of type {{type}}.',
+ },
+ empty: 'Empty',
+ heading: 'Protocol',
+ },
+ results: {
+ edit: 'Change result',
+ forfeit: 'Forfeit',
+ report: 'Report result',
+ reportError: 'Error saving result :(',
+ reportPreview: 'Will be recorded as {{ time }}',
+ reportSuccess: 'Result stored, thanks :)',
+ reportTime: 'Time',
+ time: 'Time: {{ time }}',
+ },
+ rounds: {
+ date: '{{ date, L }}',
+ empty: 'No rounds yet',
+ heading: 'Rounds',
+ new: 'New round',
+ noSeed: 'No seed set',
+ seed: 'Seed',
+ setSeed: 'Set seed',
+ },
+ tournaments: {
+ scoreboard: 'Scoreboard',
+ },
+ validation: {
+ error: {
+ required: 'Please tell me',
+ time: 'Please enter as 1:23:45 (or 56:23 if you\'re fast ^^).',
+ url: 'URL plz',
+ },
+ }
+ },
+};