localization support

This commit is contained in:
Wingy 2021-12-03 11:13:43 -05:00
parent f99d6f88c3
commit d91128274b
29 changed files with 396 additions and 194 deletions

View file

@ -3,6 +3,7 @@ mixin navBarLink(href, title)
a.is-active.navbar-item(href=href)= title
else
a.navbar-item(href=href)= title
nav.navbar.is-fixed-top(role='navigation', aria-label='main navigation',style='box-shadow: 0px 0px 7px rgb(14, 15, 17);')
.navbar-brand
if _CC.config.base === req.path
@ -22,17 +23,17 @@ nav.navbar.is-fixed-top(role='navigation', aria-label='main navigation',style='b
if req.isAuthenticated()
if req.user._id === 'Unknown'
.navbar-item
a.button.is-primary(href='/login') Log In
a.button.is-primary(href='/login')= lang('NAVBAR_')
else
.navbar-item.has-dropdown.is-hoverable
a.navbar-link= req.user._id
.navbar-dropdown
+navBarLink(`${_CC.config.base}wishlist/${req.user._id}`, 'My Wishlist')
+navBarLink(`${_CC.config.base}profile`, 'Profile')
+navBarLink(`${_CC.config.base}wishlist/${req.user._id}`, lang('NAVBAR_WISHLIST'))
+navBarLink(`${_CC.config.base}profile`, lang('NAVBAR_PROFILE'))
if req.user.admin
+navBarLink(`${_CC.config.base}admin-settings`, 'Admin settings')
+navBarLink(`${_CC.config.base}admin-settings`, lang('NAVBAR_ADMIN'))
hr.navbar-divider
.navbar-item
form#logoutForm(action=`${_CC.config.base}logout`, method='POST')
button.button.is-warning(type='submit') Log Out
button.button.is-warning(type='submit')= lang('NAVBAR_LOGOUT')
script(src=`${_CC.config.base}js/nav.js`)

View file

@ -2,13 +2,4 @@ if req.user && req.user.admin && _CC.updateNotice
.columns
.column
.column.is-narrow
.box
span.has-text-danger.is-size-4.has-text-weight-bold Christmas Community is out of date. There may be new features or bug fixes. Consider updating! :)
br
span (you can turn this off with <code>UPDATE_CHECK=false</code>)
br
br
span Current: #{_CC.updateNotice.current}
br
span Latest: #{_CC.updateNotice.latest}
span.has-text-info(style='float: right;') This message is only visible to admins
.box!= lang('UPDATE_NOTICE', _CC.updateNotice.current, _CC.updateNotice.latest)