Update logo; add i18n support
This commit is contained in:
parent
024a371590
commit
71d316d122
14
ex
14
ex
@ -3,12 +3,14 @@
|
||||
ENV_NODE="$(which node)"
|
||||
ENV_PNPM="$(which pnpm)"
|
||||
|
||||
LOGO=" ______ _ _ _
|
||||
| ____| | | | | |
|
||||
| |__ __ _| |_ ___ | | | ___
|
||||
| __| \\ \\/ / __/ _ \\| | |/ _ \\
|
||||
| |____ > <| || (_) | | | (_) |
|
||||
|______/_/\\_\\\\__\\___/|_|_|\\___/"
|
||||
LOGO=" _
|
||||
/ /\ ______ _ _ _
|
||||
/ / \ | ____| | | | | |
|
||||
/ / /\ \ | |__ __ _| |_ ___ | | | ___
|
||||
/ / /\ \ \ | __| \ \/ / __/ _ \| | |/ _ \\
|
||||
/ / / \ \_\ | |____ > <| || (_) | | | (_) |
|
||||
\/_/ \/_/ |______/_/\_\\\__\___/|_|_|\___/
|
||||
"
|
||||
|
||||
# Author: Tasos Latsas
|
||||
|
||||
|
@ -12,6 +12,7 @@
|
||||
"@extollo/lib": "file:../lib",
|
||||
"@extollo/orm": "file:../orm",
|
||||
"@extollo/cli": "file:../cli",
|
||||
"@extollo/i18n": "file:../i18n",
|
||||
"copyfiles": "^2.4.1",
|
||||
"typescript": "^4.1.3"
|
||||
},
|
||||
|
@ -1,6 +1,7 @@
|
||||
dependencies:
|
||||
'@extollo/cli': link:../cli
|
||||
'@extollo/di': link:../di
|
||||
'@extollo/i18n': link:../i18n
|
||||
'@extollo/lib': link:../lib
|
||||
'@extollo/orm': link:../orm
|
||||
copyfiles: 2.4.1
|
||||
@ -297,6 +298,7 @@ packages:
|
||||
specifiers:
|
||||
'@extollo/cli': file:../cli
|
||||
'@extollo/di': file:../di
|
||||
'@extollo/i18n': file:../i18n
|
||||
'@extollo/lib': file:../lib
|
||||
'@extollo/orm': file:../orm
|
||||
copyfiles: ^2.4.1
|
||||
|
@ -1,6 +1,7 @@
|
||||
import {Config, Controllers, HTTPServer, Middlewares, Routing, Unit} from '@extollo/lib'
|
||||
import {Database, Models} from "@extollo/orm";
|
||||
import {CommandLine} from "@extollo/cli";
|
||||
import {Internationalization} from "@extollo/i18n";
|
||||
|
||||
export const Units = [
|
||||
Config,
|
||||
@ -9,6 +10,7 @@ export const Units = [
|
||||
Middlewares,
|
||||
Database,
|
||||
Models,
|
||||
Internationalization,
|
||||
|
||||
Routing,
|
||||
HTTPServer,
|
||||
|
5
src/app/configs/lang/common.config.ts
Normal file
5
src/app/configs/lang/common.config.ts
Normal file
@ -0,0 +1,5 @@
|
||||
import { env } from "@extollo/lib"
|
||||
|
||||
export default {
|
||||
app_name: env('APP_NAME', 'Extollo'),
|
||||
}
|
6
src/app/configs/lang/en_US.config.ts
Normal file
6
src/app/configs/lang/en_US.config.ts
Normal 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.',
|
||||
}
|
@ -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(),
|
||||
})
|
||||
}
|
||||
}
|
||||
|
@ -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 } })}
|
||||
|
Loading…
Reference in New Issue
Block a user