Update logo; add i18n support

This commit is contained in:
2021-03-22 12:07:33 -05:00
parent 024a371590
commit 71d316d122
8 changed files with 33 additions and 10 deletions

View File

@@ -0,0 +1,5 @@
import { env } from "@extollo/lib"
export default {
app_name: env('APP_NAME', 'Extollo'),
}

View File

@@ -0,0 +1,6 @@
import {env} from '@extollo/lib'
export default {
welcome_to_extollo: 'Welcome to Extollo!',
viewed_page_num_times: 'You have viewed this page :num: times.',
}

View File

@@ -1,16 +1,21 @@
import {Controller, view, Session} from '@extollo/lib';
import {Inject, Injectable} from "@extollo/di";
import {Locale} from "@extollo/i18n"
@Injectable()
export class Home extends Controller {
@Inject()
protected readonly session!: Session;
@Inject()
protected readonly locale!: Locale;
public welcome() {
this.session.set('app_visits', this.session.get('app_visits', 0) + 1)
return view('welcome', {
app_visits: this.session.get('app_visits')
app_visits: this.session.get('app_visits'),
locale: this.locale.helper(),
})
}
}

View File

@@ -1,6 +1,6 @@
html
head
title Welcome | Extollo
title !{locale('app_name')}
body
h1 Welcome to Extollo
h2 You have viewed this page !{app_visits} times.
h1 !{locale('welcome_to_extollo')}
h2 !{locale('viewed_page_num_times', { interp: { num: app_visits } })}