translate most of /contact

pull/6012/head
Thibault Duplessis 2020-02-08 20:32:55 -06:00
parent 12ed3a98c2
commit bc7accf8a1
3 changed files with 272 additions and 190 deletions

View File

@ -8,111 +8,80 @@ import lila.app.ui.ScalatagsTemplate._
object contact {
import trans.contact._
sealed private trait Node {
val id: String
val name: String
val name: Frag
}
private case class Branch(id: String, name: String, children: List[Node]) extends Node
private case class Leaf(id: String, name: String, content: Frag) extends Node
private case class Branch(id: String, name: Frag, children: List[Node]) extends Node
private case class Leaf(id: String, name: Frag, content: Frag) extends Node
private case class FlatNode(id: String, name: String, parentId: Option[String])
private def reopenLeaf(prefix: String) =
private def reopenLeaf(prefix: String)(implicit ctx: Context) =
Leaf(
s"$prefix-reopen",
"I want to reopen my account",
wantReopen(),
frag(
p(
"You can ",
a(href := routes.Account.reopen)(
"reopen your account on this page"
),
". It only works once."
)
p(a(href := routes.Account.reopen)(reopenOnThisPage())),
p(doNotAskByEmailToReopen())
)
)
private def howToReportBugs: Frag = frag(
private def howToReportBugs(implicit ctx: Context): Frag = frag(
ul(
li(
"In the ",
a(href := routes.ForumCateg.show("lichess-feedback"))("Lichess Feedback Forum")
a(href := routes.ForumCateg.show("lichess-feedback"))(reportBugInForum())
),
li(
"As a ",
a(href := "https://github.com/ornicar/lila/issues")("Lichess website issue"),
" on GitHub"
a(href := "https://github.com/ornicar/lila/issues")(reportWebsiteIssue())
),
li(
"As a ",
a(href := "https://github.com/veloce/lichobile/issues")("Lichess mobile app issue"),
" on GitHub"
a(href := "https://github.com/veloce/lichobile/issues")(reportMobileIssue())
),
li(
"In the ",
a(href := "https://discord.gg/hy5jqSs")("Lichess discord server")
a(href := "https://discord.gg/hy5jqSs")(reportBugInDiscord())
)
),
p(
"Please describe what the bug looks like, what you expected to happen instead, and the steps to reproduce the bug."
)
p(howToReportBug())
)
private lazy val menu: Branch =
private def menu(implicit ctx: Context): Branch =
Branch(
"root",
"What can we help you with?",
whatCanWeHelpYouWith(),
List(
Branch(
"login",
"I can't log in",
iCantLogIn(),
List(
Leaf(
"email-confirm",
"I don't receive my confirmation email",
frag(
p(
"You signed up, but didn't receive your confirmation email?",
br,
a(href := routes.Account.emailConfirmHelp)("Visit this page to solve the issue"),
"."
)
noConfirmationEmail(),
p(
a(href := routes.Account.emailConfirmHelp)(visitThisPage()),
"."
)
),
Leaf(
"forgot-password",
"I forgot my password",
frag(
p(
"To request a new password, ",
a(href := routes.Auth.passwordReset)(
"visit the password reset page"
),
"."
)
forgotPassword(),
p(
a(href := routes.Auth.passwordReset)(visitThisPage()),
"."
)
),
Leaf(
"forgot-username",
"I forgot my username",
frag(
p(
"You can ",
a(href := routes.Auth.login)("login"),
" with the email address you signed up with."
)
forgotUsername(),
p(
a(href := routes.Auth.login)(youCanLoginWithEmail()),
"."
)
),
Leaf(
"lost-2fa",
"I lost access to my two-factor authentication codes",
frag(
p(
"Do a ",
a(href := routes.Auth.passwordReset)("password reset"),
" to remove your second factor."
)
)
lost2FA(),
p(a(href := routes.Auth.passwordReset)(doPasswordReset()), ".")
),
reopenLeaf("login"),
Leaf(
@ -139,152 +108,119 @@ object contact {
),
Branch(
"account",
"I need account support",
accountSupport(),
List(
Leaf(
"title",
"I want my title displayed on Lichess",
frag(
p(
"To show your title on your Lichess profile, and participate to Titled Arenas, ",
a(href := routes.Page.master)(
"visit the title confirmation page"
),
"."
)
wantTitle(),
p(
a(href := routes.Page.master)(visitTitleConfirmation()),
"."
)
),
Leaf(
"close",
"I want to close my account",
wantCloseAccount(),
frag(
p(
"You can close your account ",
a(href := routes.Account.close)("on this page"),
"."
),
p("Do not ask us by email to close an account, we won't do it.")
p(a(href := routes.Account.close)(closeYourAccount()), "."),
p(doNotAskByEmail())
)
),
reopenLeaf("account"),
Leaf(
"change-username",
"I want to change my username",
wantChangeUsername(),
frag(
p(
"We're very sorry, but the username cannot be changed. For technical reasons, it's downright impossible."
),
p("However, you can always close your current account, and create a new one.")
p(a(href := routes.Account.username)(changeUsernameCase()), "."),
p(cantChangeMore()),
p(orCloseAccount())
)
),
Leaf(
"clear-history",
"I want to clear my history or rating",
wantClearHistory(),
frag(
p("It's not possible to clear your game history, puzzle history, or ratings."),
p("However, you can always close your current account, and create a new one.")
p(cantClearHistory()),
p(orCloseAccount())
)
)
)
),
Branch(
"report",
"I want to report a player",
List("cheating", "sandbagging", "trolling", "insults", "some other reason").map { reason =>
Leaf(
reason,
s"Report a player for $reason",
frag(
p(
s"To report a player for $reason, ",
a(href := routes.Report.form)(strong("use the report form")),
"."
),
p(
"You can also reach that page by clicking the ",
button(cls := "thin button", dataIcon := "!"),
" report button on a profile page."
),
p(
strong("Do not"),
" report players in the forum.",
br,
strong("Do not"),
" send us report emails.",
br,
"Only reporting players through ",
a(href := routes.Report.form)("the report form"),
" is effective."
wantReport(),
List(
"cheating" -> cheating(),
"sandbagging" -> sandbagging(),
"trolling" -> trolling(),
"insults" -> insults(),
"some other reason" -> otherReason()
).map {
case (reason, name) =>
Leaf(
reason,
frag("Report a player for ", name),
frag(
p(
a(href := routes.Report.form)(toReportAPlayer(name)),
"."
),
p(
youCanAlsoReachReportPage(button(cls := "thin button button-empty", dataIcon := "!"))
),
p(
doNotMessageModerators(),
br,
doNotReportInForum(),
br,
doNotSendReportEmails(),
br,
onlyReports()
)
)
)
)
}
),
Branch(
"bug",
"I want to report a bug",
wantReportBug(),
List(
Leaf(
"enpassant",
"Illegal pawn capture",
illegalPawnCapture(),
frag(
p("It is called \"en passant\" and is one of the rules of chess."),
p(
"Try ",
a(href := "/learn#/15")("this interactive game"),
" to learn more about this chess rule."
)
p(calledEnPassant()),
p(a(href := "/learn#/15")(tryEnPassant()), ".")
)
),
Leaf(
"castling",
"Illegal or impossible castling",
illegalCastling(),
frag(
p("The castle is only prevented if the king goes through a controlled square."),
p(
"Make sure you understand the ",
a(href := "https://en.wikipedia.org/wiki/Castling#Requirements")("castling requirements"),
"."
),
p(
"Try ",
a(href := "/learn#/15")("this interactive game"),
" to practice castling in chess."
),
p(
"If you imported the game, or started it from a position, make sure you correctly set the castling rights."
)
p(castlingPrevented()),
p(a(href := "https://en.wikipedia.org/wiki/Castling#Requirements")(castlingRules()), "."),
p(a(href := "/learn#/15")(tryCastling()), "."),
p(castlingImported())
)
),
Leaf(
"insufficient",
"Insufficient mating material",
insufficientMaterial(),
frag(
p(
"According to the ",
a(href := "https://www.fide.com/FIDE/handbook/LawsOfChess.pdf")(
"FIDE Laws of Chess §6.9 (pdf)"
),
", if a checkmate is possible with any legal sequence of moves, then the game is not a draw."
),
p(
"It can be possible to checkmate with only a knight or a bishop, if the opponent has more than a king on the board."
)
p(a(href := "https://www.fide.com/FIDE/handbook/LawsOfChess.pdf")(fideMate()), "."),
p(knightMate())
)
),
Leaf(
"casual",
"No rating points were awarded",
frag(
p("Make sure you played a rated game."),
p("Casual games do not affect the players ratings.")
)
noRatingPoints(),
p(ratedGame())
),
Leaf(
"error-page",
"Error page",
errorPage(),
frag(
p("If you faced an error page, you may report it:"),
p(reportErrorPage()),
howToReportBugs
)
),
@ -327,37 +263,36 @@ object contact {
),
Branch(
"appeal",
"Appeal for a ban or IP restriction",
banAppeal(),
List(
Leaf(
"appeal-cheat",
"Engine or cheat mark",
engineAppeal(),
frag(
p(s"If you have been marked as an engine, you may send an appeal to $contactEmail."),
p(doNotMessageModerators()),
p(sendAppealTo(contactEmail)),
p(
"False positives do happen sometimes, and we're sorry about that.",
falsePositives(),
br,
"If your appeal is legit, we will lift the ban ASAP."
ifLegit()
),
p(
"However if you indeed used engine assistance, ",
strong("even just once"),
", then your account is unfortunately lost.",
accountLost(),
br,
"Do not deny having cheated. If you want to be allowed to create a new account, ",
"just admit to what you did, and show that you understood that it was a mistake."
doNotDeny()
)
)
),
Leaf(
"appeal-other",
"None of the above",
otherRestriction(),
frag(
p(s"You may send an appeal to $contactEmail."),
p(doNotMessageModerators()),
p(sendAppealTo(contactEmail)),
p(
"False positives do happen sometimes, and we're sorry about that.",
falsePositives(),
br,
"If your appeal is legit, we will lift the ban or restriction ASAP."
ifLegit()
)
)
)
@ -365,11 +300,11 @@ object contact {
),
Branch(
"collab",
"Collaboration, legal, commercial",
collaboration(),
List(
Leaf(
"monetize",
"Monetizing Lichess",
monetizing(),
frag(
p("We are not interested in any way of monetizing Lichess."),
p(
@ -385,18 +320,16 @@ object contact {
),
Leaf(
"buy",
"Buying Lichess",
frag(
p("We are not selling, to anyone, for any price. Ever.")
)
buyingLichess(),
p("We are not selling, to anyone, for any price. Ever.")
),
Leaf(
"authorize",
"Authorization to use Lichess",
authorizationToUse(),
frag(
p("You are welcome to use Lichess for your activity, even commercial."),
p("You can show it in your videos, and you can print screenshots of Lichess in your books."),
p("Credit is appreciated but not required.")
p(welcomeToUse()),
p(videosAndBooks()),
p(creditAppreciated())
)
),
Leaf(
@ -417,13 +350,10 @@ object contact {
),
Leaf(
"contact-other",
"None of the above",
noneOfTheAbove(),
frag(
p(s"Please send us an email at $contactEmail."),
p(
"Please explain your request clearly and thoroughly. ",
"State your Lichess username, and any information that could help us help you."
)
p(sendEmailAt(contactEmail)),
p(explainYourRequest())
)
)
)
@ -431,7 +361,7 @@ object contact {
)
)
private def renderNode(node: Node, parent: Option[Node]): Frag = node match {
private def renderNode(node: Node, parent: Option[Node])(implicit ctx: Context): Frag = node match {
case Leaf(_, _, content) =>
List(
div(makeId(node.id), cls := "node leaf")(
@ -453,7 +383,7 @@ object contact {
)
}
private lazy val renderedMenu = renderNode(menu, none)
private def renderedMenu(implicit ctx: Context) = renderNode(menu, none)
private def makeId(id: String) = st.id := s"help-$id"
private def makeLink(id: String) = href := s"#help-$id"
@ -463,14 +393,14 @@ object contact {
def apply()(implicit ctx: Context) =
help.layout(
title = "Contact",
title = trans.contact.contact.txt(),
active = "contact",
moreCss = cssTag("contact"),
moreJs = embedJsUnsafe("""location=location.hash||"#help-root""""),
contentCls = "page box box-pad"
)(
frag(
h1(trans.contact.contactLichess()),
h1(contactLichess()),
div(cls := "contact")(
renderedMenu
)

View File

@ -1241,6 +1241,82 @@ val `nbStudents` = new Translated("nbStudents", Clas)
object contact {
val `contact` = new Translated("contact", Contact)
val `contactLichess` = new Translated("contactLichess", Contact)
val `whatCanWeHelpYouWith` = new Translated("whatCanWeHelpYouWith", Contact)
val `visitThisPage` = new Translated("visitThisPage", Contact)
val `iCantLogIn` = new Translated("iCantLogIn", Contact)
val `noConfirmationEmail` = new Translated("noConfirmationEmail", Contact)
val `forgotPassword` = new Translated("forgotPassword", Contact)
val `forgotUsername` = new Translated("forgotUsername", Contact)
val `youCanLoginWithEmail` = new Translated("youCanLoginWithEmail", Contact)
val `lost2FA` = new Translated("lost2FA", Contact)
val `doPasswordReset` = new Translated("doPasswordReset", Contact)
val `accountSupport` = new Translated("accountSupport", Contact)
val `wantTitle` = new Translated("wantTitle", Contact)
val `visitTitleConfirmation` = new Translated("visitTitleConfirmation", Contact)
val `wantCloseAccount` = new Translated("wantCloseAccount", Contact)
val `closeYourAccount` = new Translated("closeYourAccount", Contact)
val `doNotAskByEmail` = new Translated("doNotAskByEmail", Contact)
val `wantReopen` = new Translated("wantReopen", Contact)
val `reopenOnThisPage` = new Translated("reopenOnThisPage", Contact)
val `doNotAskByEmailToReopen` = new Translated("doNotAskByEmailToReopen", Contact)
val `wantChangeUsername` = new Translated("wantChangeUsername", Contact)
val `changeUsernameCase` = new Translated("changeUsernameCase", Contact)
val `cantChangeMore` = new Translated("cantChangeMore", Contact)
val `orCloseAccount` = new Translated("orCloseAccount", Contact)
val `wantClearHistory` = new Translated("wantClearHistory", Contact)
val `cantClearHistory` = new Translated("cantClearHistory", Contact)
val `wantReport` = new Translated("wantReport", Contact)
val `cheating` = new Translated("cheating", Contact)
val `sandbagging` = new Translated("sandbagging", Contact)
val `trolling` = new Translated("trolling", Contact)
val `insults` = new Translated("insults", Contact)
val `otherReason` = new Translated("otherReason", Contact)
val `toReportAPlayer` = new Translated("toReportAPlayer", Contact)
val `youCanAlsoReachReportPage` = new Translated("youCanAlsoReachReportPage", Contact)
val `doNotReportInForum` = new Translated("doNotReportInForum", Contact)
val `doNotSendReportEmails` = new Translated("doNotSendReportEmails", Contact)
val `doNotMessageModerators` = new Translated("doNotMessageModerators", Contact)
val `onlyReports` = new Translated("onlyReports", Contact)
val `wantReportBug` = new Translated("wantReportBug", Contact)
val `reportBugInForum` = new Translated("reportBugInForum", Contact)
val `reportWebsiteIssue` = new Translated("reportWebsiteIssue", Contact)
val `reportMobileIssue` = new Translated("reportMobileIssue", Contact)
val `reportBugInDiscord` = new Translated("reportBugInDiscord", Contact)
val `howToReportBug` = new Translated("howToReportBug", Contact)
val `illegalPawnCapture` = new Translated("illegalPawnCapture", Contact)
val `calledEnPassant` = new Translated("calledEnPassant", Contact)
val `tryEnPassant` = new Translated("tryEnPassant", Contact)
val `illegalCastling` = new Translated("illegalCastling", Contact)
val `castlingPrevented` = new Translated("castlingPrevented", Contact)
val `castlingRules` = new Translated("castlingRules", Contact)
val `tryCastling` = new Translated("tryCastling", Contact)
val `castlingImported` = new Translated("castlingImported", Contact)
val `insufficientMaterial` = new Translated("insufficientMaterial", Contact)
val `fideMate` = new Translated("fideMate", Contact)
val `knightMate` = new Translated("knightMate", Contact)
val `noRatingPoints` = new Translated("noRatingPoints", Contact)
val `ratedGame` = new Translated("ratedGame", Contact)
val `errorPage` = new Translated("errorPage", Contact)
val `reportErrorPage` = new Translated("reportErrorPage", Contact)
val `banAppeal` = new Translated("banAppeal", Contact)
val `engineAppeal` = new Translated("engineAppeal", Contact)
val `sendAppealTo` = new Translated("sendAppealTo", Contact)
val `falsePositives` = new Translated("falsePositives", Contact)
val `ifLegit` = new Translated("ifLegit", Contact)
val `accountLost` = new Translated("accountLost", Contact)
val `doNotDeny` = new Translated("doNotDeny", Contact)
val `otherRestriction` = new Translated("otherRestriction", Contact)
val `collaboration` = new Translated("collaboration", Contact)
val `monetizing` = new Translated("monetizing", Contact)
val `buyingLichess` = new Translated("buyingLichess", Contact)
val `authorizationToUse` = new Translated("authorizationToUse", Contact)
val `welcomeToUse` = new Translated("welcomeToUse", Contact)
val `videosAndBooks` = new Translated("videosAndBooks", Contact)
val `creditAppreciated` = new Translated("creditAppreciated", Contact)
val `noneOfTheAbove` = new Translated("noneOfTheAbove", Contact)
val `sendEmailAt` = new Translated("sendEmailAt", Contact)
val `explainYourRequest` = new Translated("explainYourRequest", Contact)
val `_` = new Translated("_", Contact)
}
}

View File

@ -2,4 +2,80 @@
<resources>
<string name="contact">Contact</string>
<string name="contactLichess">Contact Lichess</string>
<string name="whatCanWeHelpYouWith">What can we help you with?</string>
<string name="visitThisPage">Visit this page to solve the issue</string>
<string name="iCantLogIn">I can't log in</string>
<string name="noConfirmationEmail">I don't receive my confirmation email</string>
<string name="forgotPassword">I forgot my password</string>
<string name="forgotUsername">I forgot my username</string>
<string name="youCanLoginWithEmail">You can login with the email address you signed up with</string>
<string name="lost2FA">I lost access to my two-factor authentication codes</string>
<string name="doPasswordReset">Do a password reset to remove your second factor</string>
<string name="accountSupport">I need account support</string>
<string name="wantTitle">I want my title displayed on Lichess</string>
<string name="visitTitleConfirmation">To show your title on your Lichess profile, and participate to Titled Arenas, visit the title confirmation page</string>
<string name="wantCloseAccount">I want to close my account</string>
<string name="closeYourAccount">You can close your account on this page</string>
<string name="doNotAskByEmail">Do not ask us by email to close an account, we won't do it.</string>
<string name="wantReopen">I want to reopen my account</string>
<string name="reopenOnThisPage">You can reopen your account on this page. It only works once.</string>
<string name="doNotAskByEmailToReopen">Do not ask us by email to reopen an account, we won't do it.</string>
<string name="wantChangeUsername">I want to change my username</string>
<string name="changeUsernameCase">Visit this page to change the case of your username</string>
<string name="cantChangeMore">We can't change more than the case. For technical reasons, it's downright impossible.</string>
<string name="orCloseAccount">However, you can close your current account, and create a new one.</string>
<string name="wantClearHistory">I want to clear my history or rating</string>
<string name="cantClearHistory">It's not possible to clear your game history, puzzle history, or ratings.</string>
<string name="wantReport">I want to report a player</string>
<string name="cheating">cheating</string>
<string name="sandbagging">sandbagging</string>
<string name="trolling">trolling</string>
<string name="insults">insults</string>
<string name="otherReason">some other reason</string>
<string name="toReportAPlayer">To report a player for %s, use the report form</string>
<string name="youCanAlsoReachReportPage">You can also reach that page by clicking the %s report button on a profile page.</string>
<string name="doNotReportInForum">Do not report players in the forum.</string>
<string name="doNotSendReportEmails">Do not send us report emails.</string>
<string name="doNotMessageModerators">Do not send direct messages to moderators.</string>
<string name="onlyReports">Only reporting players through the report form is effective.</string>
<string name="wantReportBug">I want to report a bug</string>
<string name="reportBugInForum">In the Lichess Feedback Forum</string>
<string name="reportWebsiteIssue">As a Lichess website issue on GitHub</string>
<string name="reportMobileIssue">As a Lichess mobile app issue on GitHub</string>
<string name="reportBugInDiscord">In the Lichess discord server</string>
<string name="howToReportBug">Please describe what the bug looks like, what you expected to happen instead, and the steps to reproduce the bug.</string>
<string name="illegalPawnCapture">Illegal pawn capture</string>
<string name="calledEnPassant">It is called "en passant" and is one of the rules of chess.</string>
<string name="tryEnPassant">Try this little interactive game to learn more about "en passant".</string>
<string name="illegalCastling">Illegal or impossible castling</string>
<string name="castlingPrevented">Castling is only prevented if the king goes through a controlled square.</string>
<string name="castlingRules">Make sure you understand the castling rules</string>
<string name="tryCastling">Try this little interactive game to practice castling in chess</string>
<string name="castlingImported">If you imported the game, or started it from a position, make sure you correctly set the castling rights.</string>
<string name="insufficientMaterial">Insufficient mating material</string>
<string name="fideMate">According to the FIDE Laws of Chess §6.9, if a checkmate is possible with any legal sequence of moves, then the game is not a draw</string>
<string name="knightMate">It can be possible to checkmate with only a knight or a bishop, if the opponent has more than a king on the board.</string>
<string name="noRatingPoints">No rating points were awarded</string>
<string name="ratedGame">Make sure you played a rated game. Casual games do not affect the players ratings.</string>
<string name="errorPage">Error page</string>
<string name="reportErrorPage">If you faced an error page, you may report it:</string>
<string name="banAppeal">Appeal for a ban or IP restriction</string>
<string name="engineAppeal">Engine or cheat mark</string>
<string name="sendAppealTo">You may send an appeal to %s.</string>
<string name="falsePositives">False positives do happen sometimes, and we're sorry about that.</string>
<string name="ifLegit">If your appeal is legit, we will lift the ban ASAP.</string>
<string name="accountLost">However if you indeed used engine assistance, even just once, then your account is unfortunately lost.</string>
<string name="doNotDeny">Do not deny having cheated. If you want to be allowed to create a new account, just admit to what you did, and show that you understood that it was a mistake.</string>
<string name="otherRestriction">Other restriction</string>
<string name="collaboration">Collaboration, legal, commercial</string>
<string name="monetizing">Monetizing Lichess</string>
<string name="buyingLichess">Buying Lichess</string>
<string name="authorizationToUse">Authorization to use Lichess</string>
<string name="welcomeToUse">You are welcome to use Lichess for your activity, even commercial.</string>
<string name="videosAndBooks">You can show it in your videos, and you can print screenshots of Lichess in your books.</string>
<string name="creditAppreciated">Credit is appreciated but not required.</string>
<string name="noneOfTheAbove">None of the above</string>
<string name="sendEmailAt">Send us an email at %s.</string>
<string name="explainYourRequest">Please explain your request clearly and thoroughly. State your Lichess username, and any information that could help us help you.</string>
<string name="_">_</string>
</resources>