From 256593164f06a264ca8a549c4c86520d01c382c5 Mon Sep 17 00:00:00 2001 From: Mario Date: Tue, 15 Dec 2020 10:04:33 +0100 Subject: [PATCH] add navbar translations --- src/components/Blockly/msg/de.js | 17 +++++++++++++++++ src/components/Blockly/msg/en.js | 13 +++++++++++++ src/components/Navbar.js | 22 ++++++++++++---------- 3 files changed, 42 insertions(+), 10 deletions(-) diff --git a/src/components/Blockly/msg/de.js b/src/components/Blockly/msg/de.js index 7ca390d..b8df029 100644 --- a/src/components/Blockly/msg/de.js +++ b/src/components/Blockly/msg/de.js @@ -997,4 +997,21 @@ Blockly.Msg.builder_requirements_order = "Beachte, dass die Reihenfolge des Anha Blockly.Msg.login_head = "Anmelden" +/** + * Navbar + */ + +Blockly.Msg.navbar_tutorials = "Tutorials" +Blockly.Msg.navbar_tutorialbuilder = "Tutorial erstellen" +Blockly.Msg.navbar_gallery = "Gallerie" +Blockly.Msg.navbar_projects = "Projekte" + +Blockly.Msg.navbar_menu = "MenĂ¼" +Blockly.Msg.navbar_login = "Einloggen" +Blockly.Msg.navbar_mybadges = "myBadges" +Blockly.Msg.navbar_account = "Konto" +Blockly.Msg.navbar_logout = "Abmelden" +Blockly.Msg.navbar_settings = "Einstellungen" + + export const De = Blockly.Msg; diff --git a/src/components/Blockly/msg/en.js b/src/components/Blockly/msg/en.js index 993b6b3..393502f 100644 --- a/src/components/Blockly/msg/en.js +++ b/src/components/Blockly/msg/en.js @@ -961,7 +961,20 @@ Blockly.Msg.settings_statistics_text = "The display of statistics on the usage o Blockly.Msg.settings_statistics_on = "On" Blockly.Msg.settings_statistics_off = "Off" +/** + * Navbar + */ +Blockly.Msg.navbar_tutorials = "Tutorials" +Blockly.Msg.navbar_tutorialbuilder = "Create tutorial" +Blockly.Msg.navbar_gallery = "Gallery" +Blockly.Msg.navbar_projects = "Projects" +Blockly.Msg.navbar_menu = "Menu" +Blockly.Msg.navbar_login = "Login" +Blockly.Msg.navbar_mybadges = "myBadges" +Blockly.Msg.navbar_account = "Account" +Blockly.Msg.navbar_logout = "Logout" +Blockly.Msg.navbar_settings = "Settings" export const En = Blockly.Msg; diff --git a/src/components/Navbar.js b/src/components/Navbar.js index a3e6949..dbdd561 100644 --- a/src/components/Navbar.js +++ b/src/components/Navbar.js @@ -23,6 +23,8 @@ import LinearProgress from '@material-ui/core/LinearProgress'; import { faBars, faChevronLeft, faLayerGroup, faSignInAlt, faSignOutAlt, faCertificate, faUserCircle, faCog, faChalkboardTeacher, faTools, faLightbulb } from "@fortawesome/free-solid-svg-icons"; import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; +import * as Blockly from 'blockly' + const styles = (theme) => ({ drawerWidth: { @@ -92,7 +94,7 @@ class Navbar extends Component {
- MenĂ¼ + {Blockly.Msg.navbar_menu}
@@ -100,10 +102,10 @@ class Navbar extends Component {
- {[{ text: 'Tutorials', icon: faChalkboardTeacher, link: "/tutorial" }, - { text: 'Tutorial-Builder', icon: faTools, link: "/tutorial/builder", restriction: this.props.user && this.props.user.blocklyRole !== 'user' && this.props.isAuthenticated }, - { text: 'Galerie', icon: faLightbulb, link: "/gallery" }, - { text: 'Projekte', icon: faLayerGroup, link: "/project", restriction: this.props.isAuthenticated }].map((item, index) => { + {[{ text: Blockly.Msg.navbar_tutorials, icon: faChalkboardTeacher, link: "/tutorial" }, + { text: Blockly.Msg.navbar_tutorialbuilder, icon: faTools, link: "/tutorial/builder", restriction: this.props.user && this.props.user.blocklyRole !== 'user' && this.props.isAuthenticated }, + { text: Blockly.Msg.navbar_gallery, icon: faLightbulb, link: "/gallery" }, + { text: Blockly.Msg.navbar_projects, icon: faLayerGroup, link: "/project", restriction: this.props.isAuthenticated }].map((item, index) => { if (item.restriction || Object.keys(item).filter(attribute => attribute === 'restriction').length === 0) { return ( @@ -119,11 +121,11 @@ class Navbar extends Component { - {[{ text: 'Anmelden', icon: faSignInAlt, link: '/user/login', restriction: !this.props.isAuthenticated }, - { text: 'Konto', icon: faUserCircle, link: '/user', restriction: this.props.isAuthenticated }, - { text: 'MyBadges', icon: faCertificate, link: '/user/badge', restriction: this.props.isAuthenticated }, - { text: 'Abmelden', icon: faSignOutAlt, function: this.props.logout, restriction: this.props.isAuthenticated }, - { text: 'Einstellungen', icon: faCog, link: "/settings" }].map((item, index) => { + {[{ text: Blockly.Msg.navbar_login, icon: faSignInAlt, link: '/user/login', restriction: !this.props.isAuthenticated }, + { text: Blockly.Msg.navbar_account, icon: faUserCircle, link: '/user', restriction: this.props.isAuthenticated }, + { text: Blockly.Msg.navbar_mybadges, icon: faCertificate, link: '/user/badge', restriction: this.props.isAuthenticated }, + { text: Blockly.Msg.navbar_logout, icon: faSignOutAlt, function: this.props.logout, restriction: this.props.isAuthenticated }, + { text: Blockly.Msg.navbar_settings, icon: faCog, link: "/settings" }].map((item, index) => { if (item.restriction || Object.keys(item).filter(attribute => attribute === 'restriction').length === 0) { return (