Merge pull request #6535 from kraktus/trans_lag

Translate lag page
swiss
Thibault Duplessis 2020-05-04 17:32:19 -06:00 committed by GitHub
commit e83d0b8e5e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 54 additions and 36 deletions

View File

@ -175,7 +175,7 @@ object home {
div(cls := "lobby__about")(
ctx.blind option h2("About"),
a(href := "/about")(trans.aboutX("Lichess")),
a(href := "/faq")("FAQ"),
a(href := "/faq")(trans.faq.faqAbbreviation()),
a(href := "/contact")(trans.contact.contact()),
a(href := "/mobile")(trans.mobileApp()),
a(href := routes.Page.tos)(trans.termsOfService()),

View File

@ -202,7 +202,7 @@ $('#asset-version-message').text(lichess.info.message);"""
main(cls := "page-menu")(
st.nav(cls := "page-menu__menu subnav")(
a(activeCls("about"), href := routes.Page.about)(trans.aboutX("lichess.org")),
a(activeCls("faq"), href := routes.Main.faq)("FAQ"),
a(activeCls("faq"), href := routes.Main.faq)(trans.faq.faqAbbreviation()),
a(activeCls("contact"), href := routes.Main.contact)(trans.contact.contact()),
a(activeCls("tos"), href := routes.Page.tos)(trans.termsOfService()),
a(activeCls("privacy"), href := routes.Page.privacy)(trans.privacy()),
@ -216,7 +216,7 @@ $('#asset-version-message').text(lichess.info.message);"""
a(activeCls("database"), href := "https://database.lichess.org")(trans.database(), external),
a(activeCls("api"), href := routes.Api.index)("API", external),
sep,
a(activeCls("lag"), href := routes.Main.lag)("Is Lichess lagging?"),
a(activeCls("lag"), href := routes.Main.lag)(trans.lag.isLichessLagging()),
a(activeCls("ads"), href := routes.Page.ads)("Block ads")
),
div(cls := s"page-menu__content $contentCls")(body)

View File

@ -6,6 +6,8 @@ import lila.app.ui.ScalatagsTemplate._
object lag {
import trans.lag._
def apply()(implicit ctx: Context) =
help.layout(
title = "Is Lichess lagging?",
@ -19,56 +21,38 @@ object lag {
) {
main(cls := "box box-pad lag")(
h1(
"Is Lichess lagging?",
isLichessLagging(),
span(cls := "answer short")(
span(cls := "waiting")("Measurements in progress..."),
span(cls := "nope-nope none")(strong("No."), " And your network is good."),
span(cls := "nope-yep none")(strong("No."), " But your network is bad."),
span(cls := "yep none")(strong("Yes."), " It will be fixed soon!")
span(cls := "waiting")(measurementInProgressThreeDot()),
span(cls := "nope-nope none")(noAndYourNetworkIsGood()),
span(cls := "nope-yep none")(noAndYourNetworkIsBad()),
span(cls := "yep none")(yesItWillBeFixedSoon())
)
),
div(cls := "answer long")(
"And now, the long answer! Game lag is composed of two unrelated values (lower is better):"
andNowTheLongAnswerLagComposedOfTwoValues()
),
div(cls := "sections")(
st.section(cls := "server")(
h2("Lichess server latency"),
h2(lichessServerLatency()),
div(cls := "meter"),
p(
"The time it takes to process a move on the server. ",
"It's the ",
strong("same for everybody"),
", and only depends on the server load. ",
"The more players and the higher it gets, but Lichess developers ",
"do their best to keep it low. It rarely exceeds 10ms."
lichessServerLatencyExplanation()
)
),
st.section(cls := "network")(
h2("Network between Lichess and you"),
h2(networkBetweenLichessAndYou()),
div(cls := "meter"),
p(
"The time it takes to send a move from your computer to Lichess server, ",
"and get the response back. ",
"It's specific to your ",
strong("distance to Lichess (France)"),
", and ",
"to the ",
strong("quality of your Internet connection"),
". ",
"Lichess developers can not fix your wifi or make light go faster."
networkBetweenLichessAndYouExplanation()
)
)
),
div(cls := "last-word")(
p("You can find both these values at any time, by clicking your username in the top bar."),
h2("Lag compensation"),
p(youCanFindTheseValuesAtAnyTimeByClickingOnYourUsername()),
h2(lagCompensation()),
p(
"Lichess compensates network lag. This includes sustained lag and occasional lag spikes. ",
"There are limits and heuristics based on time control and the compensated lag so far, ",
"so that the result should feel reasonable for both players. ",
"As a result, having a higher network lag than your opponent is ",
strong("not a handicap"),
"!"
lagCompensationExplanation()
)
)
)

View File

@ -2,7 +2,7 @@ const fs = require('fs-extra');
const parseString = require('xml2js').parseString;
const baseDir = 'translation/source';
const dbs = 'site arena emails learn activity coordinates study clas contact patron coach broadcast streamer tfa settings preferences team perfStat search tourname faq'.split(' ');
const dbs = 'site arena emails learn activity coordinates study clas contact patron coach broadcast streamer tfa settings preferences team perfStat search tourname faq lag'.split(' ');
function ucfirst(s) {
return s.charAt(0).toUpperCase() + s.slice(1);

View File

@ -75,7 +75,7 @@ lazy val i18n = module("i18n",
MessageCompiler(
sourceDir = new File("translation/source"),
destDir = new File("translation/dest"),
dbs = "site arena emails learn activity coordinates study class contact patron coach broadcast streamer tfa settings preferences team perfStat search tourname faq".split(' ').toList,
dbs = "site arena emails learn activity coordinates study class contact patron coach broadcast streamer tfa settings preferences team perfStat search tourname faq lag".split(' ').toList,
compileTo = (sourceManaged in Compile).value
)
}.taskValue

View File

@ -1659,6 +1659,7 @@ val `xArena` = new I18nKey("tourname:xArena")
}
object faq {
val `faqAbbreviation` = new I18nKey("faq:faqAbbreviation")
val `frequentlyAskedQuestions` = new I18nKey("faq:frequentlyAskedQuestions")
val `whyIsLichessCalledLichess` = new I18nKey("faq:whyIsLichessCalledLichess")
val `lichessCombinationLiveLightLibrePronounced` = new I18nKey("faq:lichessCombinationLiveLightLibrePronounced")
@ -1761,4 +1762,20 @@ val `viewSiteInformationPopUp` = new I18nKey("faq:viewSiteInformationPopUp")
val `lichessCanOptionnalySendPopUps` = new I18nKey("faq:lichessCanOptionnalySendPopUps")
}
object lag {
val `isLichessLagging` = new I18nKey("lag:isLichessLagging")
val `measurementInProgressThreeDot` = new I18nKey("lag:measurementInProgressThreeDot")
val `noAndYourNetworkIsGood` = new I18nKey("lag:noAndYourNetworkIsGood")
val `noAndYourNetworkIsBad` = new I18nKey("lag:noAndYourNetworkIsBad")
val `yesItWillBeFixedSoon` = new I18nKey("lag:yesItWillBeFixedSoon")
val `andNowTheLongAnswerLagComposedOfTwoValues` = new I18nKey("lag:andNowTheLongAnswerLagComposedOfTwoValues")
val `lichessServerLatency` = new I18nKey("lag:lichessServerLatency")
val `lichessServerLatencyExplanation` = new I18nKey("lag:lichessServerLatencyExplanation")
val `networkBetweenLichessAndYou` = new I18nKey("lag:networkBetweenLichessAndYou")
val `networkBetweenLichessAndYouExplanation` = new I18nKey("lag:networkBetweenLichessAndYouExplanation")
val `youCanFindTheseValuesAtAnyTimeByClickingOnYourUsername` = new I18nKey("lag:youCanFindTheseValuesAtAnyTimeByClickingOnYourUsername")
val `lagCompensation` = new I18nKey("lag:lagCompensation")
val `lagCompensationExplanation` = new I18nKey("lag:lagCompensationExplanation")
}
}

View File

@ -1,5 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<resources>
<string name="faqAbbreviation">FAQ</string>
<string name="frequentlyAskedQuestions">Frequently Asked Questions</string>
<string name="whyIsLichessCalledLichess">Why is Lichess called Lichess?</string>
<string name="lichessCombinationLiveLightLibrePronounced">Lichess is a combination of live/light/libre and chess. It is pronounced %1$s.</string>

View File

@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<resources>
<string name="isLichessLagging">Is Lichess lagging?</string>
<string name="measurementInProgressThreeDot">Measurements in progress...</string>
<string name="noAndYourNetworkIsGood">No. And your network is good.</string>
<string name="noAndYourNetworkIsBad">No. And your network is bad.</string>
<string name="yesItWillBeFixedSoon">Yes. It will be fixed soon!</string>
<string name="andNowTheLongAnswerLagComposedOfTwoValues">And now, the long answer! Game lag is composed of two unrelated values (lower is better):</string>
<string name="lichessServerLatency">Lichess server latency</string>
<string name="lichessServerLatencyExplanation">The time it takes to process a move on the server. It's the same for everybody, and only depends on the server load. The more players and the higher it gets, but Lichess developers do their best to keep it low. It rarely exceeds 10ms.</string>
<string name="networkBetweenLichessAndYou">Network between Lichess and you</string>
<string name="networkBetweenLichessAndYouExplanation">The time it takes to send a move from your computer to Lichess server, and get the response back. It's specific to your distance to Lichess (France), and to the quality of your Internet connection. Lichess developers cannot fix your wifi or make light go faster.</string>
<string name="youCanFindTheseValuesAtAnyTimeByClickingOnYourUsername">You can find both these values at any time, by clicking your username in the top bar.</string>
<string name="lagCompensation">Lag compensation</string>
<string name="lagCompensationExplanation">Lichess compensates network lag. This includes sustained lag and occasional lag spikes. There are limits and heuristics based on time control and the compensated lag so far, so that the result should feel reasonable for both players. As a result, having a higher network lag than your opponent is not a handicap!</string>
</resources>