Commit f3577ac8 authored by Szabolcs Gyurko's avatar Szabolcs Gyurko
Browse files

Added i18n support in templates

parent 84d42499
......@@ -7,7 +7,7 @@ import akka.actor.UntypedActor
import entities.{ChunkRecord, ChunksTable, JobsTable, QueueTable}
import play.api.Logger
import play.api.db.slick.DatabaseConfigProvider
import sget2.{Defaults, SGet2}
import sget2.{Defaults, PersistEvent, SGet2}
import slick.driver.JdbcProfile
import scala.concurrent.ExecutionContext.Implicits.global
......
......@@ -6,7 +6,7 @@ import akka.actor.UntypedActor
import entities.QueueTable
import play.api.Logger
import play.api.db.slick.DatabaseConfigProvider
import sget2.SGet2
import sget2.{JobFinishedEvent, SGet2}
import slick.driver.JdbcProfile
/**
......
package sget2
import actors.{JobFinishedEvent, PersistEvent}
import play.api.Logger
import scala.io.Codec
......
package sget2
import java.net.URL
import java.io.{File, IOException, RandomAccessFile}
import java.net.URL
import actors.PersistEvent
import play.api.Logger
import play.api.libs.json.Json
import sget2.DownloadJobStatusCode.DownloadJobStatusCode
......
package sget2
import actors.PersistEvent
import play.api.libs.json.Json
import sget2.ChunkStatus._
......
package sget2
import actors.PersistEvent
import entities.{ChunkRecord, ChunksTable, JobsTable, QueueTable}
import org.slf4j.LoggerFactory
import play.api.db.slick.DatabaseConfigProvider
......
package actors
package sget2
/**
* Created by sgyurko on 25/08/2016.
......
......@@ -2,7 +2,6 @@ package sget2
import javax.inject.{Inject, Singleton}
import actors.SGet2Event
import akka.actor.{ActorRef, ActorSystem}
import entities.{SettingsRecord, SettingsTable}
import play.api.db.slick.DatabaseConfigProvider
......
package sget2
import actors.SGet2Event
/**
* Created by sgyurko on 31/08/2016.
*/
......
@(formData: Form[AddJobData])
@(formData: Form[AddJobData])(implicit messages: Messages)
<html>
<head>
<title>Add job</title>
<title>@{Messages("addjob.title")}</title>
<script src="@routes.Assets.at("javascripts/jquery-2.1.3.min.js")"></script>
<script src="@routes.Assets.at("javascripts/addjob.js")"></script>
<link rel="stylesheet" type="text/css" href="@routes.Assets.at("stylesheets/main.css")" media="all"/>
</head>
<body>
<div id="mainContent">
<span class="queueLink"><a href="@routes.Queue.index()">Back to Queue</a></span>
<span class="queueLink"><a href="@routes.Queue.index()">@{Messages("addjob.backToQueue")}</a></span>
<form action="@routes.AddJob.addJobPost()" method="post">
<table class="addJobTable">
<thead class="addJobTableHeader">
......@@ -18,44 +18,44 @@
</thead>
<tbody class="addJobTableBody">
<tr>
<td class="addJobLabel"><label for="url">URL of the file to be downloaded (you can drag & drop a link here)</label></td>
<td class="addJobLabel"><label for="url">@{Messages("addjob.urlLabel")}</label></td>
<td class="addJobInputField">
<input type="text" name="url" id="url"/>
</td>
</tr>
<tr>
<td class="addJobLabel"><label for="user">Username</label></td>
<td class="addJobLabel"><label for="user">@{Messages("addjob.usernameLabel")}</label></td>
<td class="addJobInputField">
<input type="text" name="user" id="user" value="@formData.value.get.user.getOrElse("")"/>
</td>
</tr>
<tr>
<td class="addJobLabel"><label for="pass">Password</label></td>
<td class="addJobLabel"><label for="pass">@{Messages("addjob.passwordLabel")}</label></td>
<td class="addJobInputField">
<input type="password" name="pass" id="pass" value="@formData.value.get.pass.getOrElse("")"/>
</td>
</tr>
<tr>
<td class="addJobLabel"><label for="path">Download Directory (where the files get downloaded)</label></td>
<td class="addJobLabel"><label for="path">@{Messages("addjob.pathLabel")}</label></td>
<td class="addJobInputField">
<input type="text" name="path" value="@formData.value.get.path" id="path"/>
</td>
</tr>
<tr>
<td class="addJobLabel"><label for="maxThreads">Maximum number of threads</label></td>
<td class="addJobLabel"><label for="maxThreads">@{Messages("addjob.maxThreadsLabel")}</label></td>
<td class="addJobInputField">
<input type="text" name="maxThreads" value="@formData.value.get.maxThreads" id="maxThreads"/>
</td>
</tr>
<tr>
<td class="addJobLabel"><label for="maxBandwidth">Bandwidth limit (in KB/s)</label></td>
<td class="addJobLabel"><label for="maxBandwidth">@{Messages("addjob.bandwidthLimit")}</label></td>
<td class="addJobInputField">
<input type="text" name="maxBandwidth" value="@formData.value.get.maxBandwidth" id="maxBandwidth"/>
</td>
</tr>
<tr>
<td colspan="2" class="addJobSubmit">
<input type="submit" name="submit" value="Add"/>
<input type="submit" name="submit" value="@{Messages("addjob.addButton")}"/>
</td>
</tr>
</tbody>
......
@(message: String)
@main("Welcome to Play") {
@play20.welcome(message)
}
@(title: String)(content: Html)
<!DOCTYPE html>
<html>
<head>
<title>@title</title>
<link rel="stylesheet" media="screen" href="@routes.Assets.at("stylesheets/main.css")">
<link rel="shortcut icon" type="image/png" href="@routes.Assets.at("images/favicon.png")">
<script src="@routes.Assets.at("javascripts/jquery-1.9.0.min.js")" type="text/javascript"></script>
</head>
<body>
@content
</body>
</html>
@import sget2.DownloadJob
@import sget2.DownloadJobStatusCode._
@(data: Seq[DownloadJob])
@(data: Seq[DownloadJob])(implicit messages: Messages)
@imageLink(status: DownloadJobStatusCode) = @{
routes.Assets.at(
......@@ -66,24 +66,24 @@
<html>
<head>
<title>Queue status</title>
<title>@{Messages("queue.title")}</title>
<script src="@routes.Assets.at("javascripts/jquery-2.1.3.min.js")"></script>
<script src="@routes.Queue.js"></script>
<link rel="stylesheet" type="text/css" href="@routes.Assets.at("stylesheets/main.css")" media="all"/>
</head>
<body>
<div id="mainContent">
<span class="addJobLink"><a href="@routes.AddJob.index()"><img src="@routes.Assets.at("images/plus_icon.png")"/>Add Job</a></span>
<span class="settings"><a href="@routes.Settings.index()"><img src="@routes.Assets.at("images/settings.png")"/>Settings</a></span>
<span class="addJobLink"><a href="@routes.AddJob.index()"><img src="@routes.Assets.at("images/plus_icon.png")"/>@{Messages("addjob.title")}</a></span>
<span class="settings"><a href="@routes.Settings.index()"><img src="@routes.Assets.at("images/settings.png")"/>@{Messages("settings.title")}</a></span>
<table class="jobTable">
<thead class="jobTableHeader">
<tr>
<th class="jobOperationsHeaderColumn">Op</th>
<th class="jobHeaderColumn">Job</th>
<th class="jobProgressHeaderColumn">Progress</th>
<th class="jobSpeedHeaderColumn">Speed</th>
<th class="jobETAHeaderColumn">ETA</th>
<th class="jobThreadsHeaderColumn">Threads</th>
<th class="jobOperationsHeaderColumn">@{Messages("queue.header.op")}</th>
<th class="jobHeaderColumn">@{Messages("queue.header.job")}</th>
<th class="jobProgressHeaderColumn">@{Messages("queue.header.progress")}</th>
<th class="jobSpeedHeaderColumn">@{Messages("queue.header.speed")}</th>
<th class="jobETAHeaderColumn">@{Messages("queue.header.eta")}</th>
<th class="jobThreadsHeaderColumn">@{Messages("queue.header.threads")}</th>
</tr>
</thead>
<tbody class="jobTableBody">
......
@(settings: Form[SettingsModel])
@(settings: Form[SettingsModel])(implicit messages: Messages)
<html>
<head>
<title>Settings</title>
<title>@{Messages("settings.title")}</title>
<link rel="stylesheet" type="text/css" href="@routes.Assets.at("stylesheets/main.css")" media="all"/>
</head>
<body>
<div id="mainContent">
<span class="queueLink"><a href="@routes.Queue.index()">Back to Queue</a></span>
<span class="queueLink"><a href="@routes.Queue.index()">@{Messages("settings.backToQueue")}</a></span>
<form action="@routes.Settings.save()" method="post">
<table class="settingsTable">
<thead class="settingsTableHeader">
<th colspan="2" class="settingsHeader">Download Settings</th>
<th colspan="2" class="settingsHeader">@{Messages("settings.header")}</th>
</thead>
<tbody class="settingsTableBody">
<tr>
<td class="settingsLabel">Download Directory (where the files get downloaded)</td>
<td class="settingsLabel">@{Messages("settings.downloadPath")}</td>
<td class="settingsInputField">
<input type="text" name="downloadPath" value="@settings.value.get.downloadPath"/>
</td>
</tr>
<tr>
<td class="settingsLabel">Max active jobs</td>
<td class="settingsLabel">@{Messages("settings.maxActiveJobs")}</td>
<td class="settingsInputField">
<input type="text" name="maxActiveJobs" value="@settings.value.get.maxActiveJobs"/>
</td>
</tr>
<tr>
<td class="settingsLabel">Default Username</td>
<td class="settingsLabel">@{Messages("settings.username")}</td>
<td class="settingsInputField">
<input type="text" name="user" value="@settings.value.get.user"/>
</td>
</tr>
<tr>
<td class="settingsLabel">Default Password</td>
<td class="settingsLabel">@{Messages("settings.password")}</td>
<td class="settingsInputField">
<input type="password" name="pass" value="@settings.value.get.pass"/>
</td>
</tr>
<tr>
<td colspan="2" class="settingsSubmit">
<input type="submit" name="submit" value="Save"/>
<input type="submit" name="submit" value="@{Messages("settings.saveButton")}"/>
</td>
</tr>
</tbody>
......
addjob.title=Add Job
addjob.backToQueue=Back to Queue
addjob.urlLabel=URL of the file to be downloaded (you can drag & drop a link here)
addjob.usernameLabel=Username
addjob.passwordLabel=Password
addjob.pathLabel=Download Directory (where the files get downloaded)
addjob.maxThreadsLabel=Maximum number of threads
addjob.bandwidthLimit=Bandwidth limit (in KB/s)
addjob.addButton=Add
queue.title=Queue status
queue.header.op=Op
queue.header.job=Job
queue.header.progress=Progress
queue.header.speed=Speed
queue.header.eta=ETA
queue.header.threads=Threads
settings.title=Settings
settings.backToQueue=Back to Queue
settings.header=Download Settings
settings.downloadPath=Download Directory (where the files get downloaded)
settings.maxActiveJobs=Max active jobs
settings.username=Default username for new downloads
settings.password=Default password for new downloads
settings.saveButton=Save
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment