add kvision template
This commit is contained in:
parent
5e69799136
commit
3a33062cd4
15 changed files with 228 additions and 1 deletions
38
modules/server/src/main/kotlin/com/example/App.kt
Normal file
38
modules/server/src/main/kotlin/com/example/App.kt
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
package com.example
|
||||
|
||||
import io.kvision.Application
|
||||
import io.kvision.BootstrapCssModule
|
||||
import io.kvision.BootstrapModule
|
||||
import io.kvision.CoreModule
|
||||
import io.kvision.html.div
|
||||
import io.kvision.i18n.DefaultI18nManager
|
||||
import io.kvision.i18n.I18n
|
||||
import io.kvision.i18n.I18n.tr
|
||||
import io.kvision.module
|
||||
import io.kvision.panel.root
|
||||
import io.kvision.require
|
||||
import io.kvision.startApplication
|
||||
|
||||
class App : Application() {
|
||||
init {
|
||||
require("./css/kvapp.css")
|
||||
}
|
||||
|
||||
override fun start() {
|
||||
I18n.manager =
|
||||
DefaultI18nManager(
|
||||
mapOf(
|
||||
"pl" to require("./i18n/messages-pl.json"),
|
||||
"en" to require("./i18n/messages-en.json")
|
||||
)
|
||||
)
|
||||
|
||||
root("kvapp") {
|
||||
div(tr("This is a localized message."))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fun main() {
|
||||
startApplication(::App, module.hot, BootstrapModule, BootstrapCssModule, CoreModule)
|
||||
}
|
||||
0
modules/server/src/main/resources/css/kvapp.css
Normal file
0
modules/server/src/main/resources/css/kvapp.css
Normal file
23
modules/server/src/main/resources/i18n/messages-en.po
Normal file
23
modules/server/src/main/resources/i18n/messages-en.po
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
# SOME DESCRIPTIVE TITLE.
|
||||
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
|
||||
# This file is distributed under the same license as the KVision package.
|
||||
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
|
||||
#
|
||||
#, fuzzy
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: KVision\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2018-08-18 01:34+0200\n"
|
||||
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
||||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
||||
"Language-Team: LANGUAGE <LL@li.org>\n"
|
||||
"Language: English\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Plural-Forms: nplurals=2; plural=n != 1;\n"
|
||||
|
||||
#: ../src/main/kotlin/com/example/App.kt:20
|
||||
msgid "This is a localized message."
|
||||
msgstr ""
|
||||
23
modules/server/src/main/resources/i18n/messages-pl.po
Normal file
23
modules/server/src/main/resources/i18n/messages-pl.po
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
# SOME DESCRIPTIVE TITLE.
|
||||
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
|
||||
# This file is distributed under the same license as the KVision package.
|
||||
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
|
||||
#
|
||||
#, fuzzy
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: KVision\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2018-08-18 01:34+0200\n"
|
||||
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
||||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
||||
"Language-Team: LANGUAGE <LL@li.org>\n"
|
||||
"Language: Polish\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=CHARSET\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Plural-Forms: nplurals=3; plural=n==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n"
|
||||
|
||||
#: ../src/main/kotlin/com/example/App.kt:20
|
||||
msgid "This is a localized message."
|
||||
msgstr "To jest przetłumaczona wiadomość."
|
||||
8
modules/server/src/main/resources/i18n/messages.pot
Normal file
8
modules/server/src/main/resources/i18n/messages.pot
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
msgid ""
|
||||
msgstr ""
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Language: \n"
|
||||
|
||||
#: src/main/kotlin/com/example/App.kt:31
|
||||
msgid "This is a localized message."
|
||||
msgstr ""
|
||||
12
modules/server/src/main/web/index.html
Normal file
12
modules/server/src/main/web/index.html
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title>KVision App</title>
|
||||
<script type="text/javascript" src="main.bundle.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<div id="kvapp"></div>
|
||||
</body>
|
||||
</html>
|
||||
Loading…
Add table
Add a link
Reference in a new issue