forked from lichess-org/lila
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathEnv.scala
35 lines (26 loc) · 803 Bytes
/
Env.scala
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
package lila.i18n
import com.typesafe.config.Config
import play.api.i18n.Lang
import play.api.libs.json._
final class Env(
config: Config,
appPath: String
) {
private val WebPathRelative = config getString "web_path.relative"
private val NetDomain = config getString "net.domain"
lazy val jsDump = new JsDump(path = appPath + "/" + WebPathRelative)
lazy val subdomainKiller = new SubdomainKiller(NetDomain)
def cli = new lila.common.Cli {
def process = {
case "i18n" :: "js" :: "dump" :: Nil =>
jsDump.apply inject "Dumped JavaScript translations"
}
}
}
object Env {
import lila.common.PlayApp
lazy val current = "i18n" boot new Env(
config = lila.common.PlayApp loadConfig "i18n",
appPath = PlayApp withApp (_.path.getCanonicalPath)
)
}