add navbar translations

This commit is contained in:
Mario 2020-12-15 10:04:33 +01:00
parent 9d65f7b944
commit 256593164f
3 changed files with 42 additions and 10 deletions

View File

@ -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;

View File

@ -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;

View File

@ -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 {
<div style={{ height: '50px', cursor: 'pointer', color: 'white', padding: '0 22px' }} className={this.props.classes.appBarColor} onClick={this.toggleDrawer}>
<div style={{ display: ' table-cell', verticalAlign: 'middle', height: 'inherit', width: '0.1%' }}>
<Typography variant="h6" style={{ display: 'inline' }}>
Menü
{Blockly.Msg.navbar_menu}
</Typography>
<div style={{ float: 'right' }}>
<FontAwesomeIcon icon={faChevronLeft} />
@ -100,10 +102,10 @@ class Navbar extends Component {
</div>
</div>
<List>
{[{ 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 (
<Link to={item.link} key={index} style={{ textDecoration: 'none', color: 'inherit' }}>
@ -119,11 +121,11 @@ class Navbar extends Component {
</List>
<Divider classes={{ root: this.props.classes.appBarColor }} style={{ marginTop: 'auto' }} />
<List>
{[{ 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 (
<Link to={item.link} key={index} style={{ textDecoration: 'none', color: 'inherit' }}>