translate /patron, WIP

pull/6012/head
Thibault Duplessis 2020-02-09 09:50:25 -06:00
parent b99142eee9
commit 1175f829d4
6 changed files with 124 additions and 93 deletions

View File

@ -1,13 +0,0 @@
package views.html.plan
import lila.api.Context
import lila.app.ui.ScalatagsTemplate._
object badCheckout {
def apply(err: String)(implicit ctx: Context) =
views.html.site.message("Payment can not be processed.")(
p("The payment didn't go through. Your card was not charged."),
p(err)
)
}

View File

@ -1,6 +1,8 @@
package views
package html.plan
import play.api.i18n.Lang
import lila.api.Context
import lila.app.templating.Environment._
import lila.app.ui.ScalatagsTemplate._
@ -178,8 +180,8 @@ object features {
)
}
private def header(name: Frag) = thead(
st.tr(th(name), th("Free account"), th("Lichess Patron"))
private def header(name: Frag)(implicit lang: Lang) = thead(
st.tr(th(name), th(trans.patron.freeAccount()), th(trans.patron.lichessPatron()))
)
private val unlimited = span(dataIcon := "E", cls := "is is-green text unlimited")("Unlimited")

View File

@ -10,6 +10,8 @@ import controllers.routes
object index {
import trans.patron._
def apply(
email: Option[lila.common.EmailAddress],
stripePublicKey: String,
@ -18,10 +20,8 @@ object index {
bestIds: List[String]
)(implicit ctx: Context) = {
val title = "Become a Patron of lichess.org"
views.html.base.layout(
title = title,
title = becomePatron.txt(),
moreCss = cssTag("plan"),
moreJs = frag(
script(src := "https://js.stripe.com/v3/"),
@ -30,16 +30,16 @@ object index {
),
openGraph = lila.app.ui
.OpenGraph(
title = title,
title = becomePatron.txt(),
url = s"$netBaseUrl${routes.Plan.index.url}",
description = "Free chess for everyone, forever!"
description = freeChess.txt()
)
.some,
csp = defaultCsp.withStripe.some
) {
main(cls := "page-menu plan")(
st.aside(cls := "page-menu__menu recent-patrons")(
h2("New Patrons"),
h2(newPatrons()),
div(cls := "list")(
recentIds.map { userId =>
div(userIdLink(userId.some))
@ -51,21 +51,14 @@ object index {
div(cls := "banner one_time_active")(
iconTag(patronIconChar),
div(
h1("Thank you for your donation!"),
if (p.isLifetime)
frag(
"You have a ",
strong("Lifetime Patron"),
" account. That's pretty awesome!"
)
h1(thankYou()),
if (p.isLifetime) youHaveLifetime()
else
p.expiresAt.map { expires =>
frag(
"You have a Patron account until ",
showDate(expires),
".",
patronUntil(showDate(expires)),
br,
"If not renewed, you will then be downgraded to free."
ifNotRenewed()
)
}
),
@ -74,22 +67,16 @@ object index {
} getOrElse div(cls := "banner moto")(
iconTag(patronIconChar),
div(
h1("Free chess for everyone, forever!"),
p("No ads, no subscriptions; but open source and passion.")
h1(freeChess()),
p(noAdsNoSubs())
),
iconTag(patronIconChar)
),
div(cls := "box__pad")(
div(cls := "wrapper")(
div(cls := "text")(
p(
"We are a nonprofit association because we believe in a free, ",
"world-class chess experience for anyone, anywhere."
),
p(
"We rely on support from people like you to make it possible. ",
"If you've gotten something out of Lichess, please take a second to pitch in!"
)
p(weAreNonProfit()),
p(weRelyOnSupport())
),
div(cls := "content")(
div(
@ -147,10 +134,10 @@ object index {
<input type="hidden" name="currency_code" value="USD">
</form>"""),
patron.exists(_.isLifetime) option
p(style := "text-align:center;margin-bottom:1em")("Make an extra donation?"),
p(style := "text-align:center;margin-bottom:1em")(makeExtraDonation()),
st.group(cls := "radio buttons freq")(
div(
st.title := s"Pay ${lila.plan.Cents.lifetime.usd} once. Be a Lichess Patron forever!",
st.title := payLifetimeOnce.txt(lila.plan.Cents.lifetime.usd),
cls := List("lifetime-check" -> patron.exists(_.isLifetime)),
input(
tpe := "radio",
@ -159,10 +146,10 @@ object index {
patron.exists(_.isLifetime) option disabled,
value := "lifetime"
),
label(`for` := "freq_lifetime")("Lifetime")
label(`for` := "freq_lifetime")(lifetime())
),
div(
st.title := "Recurring billing, renewing your Patron Wings every month.",
st.title := recurringBilling.txt(),
input(
tpe := "radio",
name := "freq",
@ -170,10 +157,10 @@ object index {
checked,
value := "monthly"
),
label(`for` := "freq_monthly")("Monthly")
label(`for` := "freq_monthly")(monthly())
),
div(
st.title := "A single donation that grants you the Patron Wings for one month.",
st.title := singleDonation.txt(),
input(
tpe := "radio",
name := "freq",
@ -181,7 +168,7 @@ object index {
checked,
value := "onetime"
),
label(`for` := "freq_onetime")("One-time")
label(`for` := "freq_onetime")(onetime())
)
),
div(cls := "amount_choice")(
@ -203,7 +190,7 @@ object index {
},
div(cls := "other")(
input(tpe := "radio", name := "plan", id := "plan_other", value := "other"),
label(`for` := "plan_other")("Other")
label(`for` := "plan_other")(otherAmount())
)
)
),
@ -216,19 +203,17 @@ object index {
)
),
div(cls := "service")(
button(cls := "stripe button")("Credit Card"),
button(cls := "paypal button")("PayPal")
button(cls := "stripe button")(withCreditCard()),
button(cls := "paypal button")(withPaypal())
)
)
)
),
p(id := "error")(),
p(cls := "small_team")(
"We are a small team, so your support makes a huge difference!"
),
p(cls := "small_team")(weAreSmallTeam()),
faq,
div(cls := "best_patrons")(
h2("The celebrated Patrons who make Lichess possible"),
h2(celebratedPatrons()),
div(cls := "list")(
bestIds.map { userId =>
div(userIdLink(userId.some))
@ -243,59 +228,40 @@ object index {
private def faq(implicit lang: Lang) = div(cls := "faq")(
dl(
dt("Where does the money go?"),
dt(whereMoneyGoes()),
dd(
"First of all, powerful servers.",
serversAndDeveloper(userIdLink("thibault".some)),
br,
"Then we pay a full-time developer: ",
userIdLink("thibault".some),
", the founder of Lichess.",
br,
"See the ",
a(href := "/costs", target := "_blank")("detailed cost breakdown.")
a(href := "/costs", target := "_blank")(costBreakdown()),
"."
),
dt("Is Lichess an official non-profit?"),
dt(officialNonProfit()),
dd(
"Yes, here's the ",
a(
href := "https://www.journal-officiel.gouv.fr/associations/detail-annonce/associations_b/20160025/818"
)(
"act of creation (FR)"
),
)(actOfCreation()),
"."
)
),
dl(
dt("Can I change/cancel my monthly support?"),
dt(changeMonthlySupport()),
dd(
"Yes, at any time, from this page.",
br,
"Or you can ",
a(href := routes.Main.contact, target := "_blank")("contact Lichess support"),
"."
changeOrContact(a(href := routes.Main.contact, target := "_blank")(contactSupport()))
),
dt("Other methods of donation?"),
dt(otherMethods()),
dd(
"We also accept ",
a(href := staticUrl("doc/iban_LICHESS_ORG_00022031601.pdf"), target := "_blank")(
"bank transfers"
),
a(href := staticUrl("doc/iban_LICHESS_ORG_00022031601.pdf"), target := "_blank")(bankTransfers()),
".",
br,
"And here's our bitcoin address: ",
code("15ZA4bBki3uu3yR2ENC2WYa9baVGUZ8Cf8")
bitcoin(code("15ZA4bBki3uu3yR2ENC2WYa9baVGUZ8Cf8"))
)
),
dl(
dt("Are some features reserved to Patrons?"),
dt(patronFeatures()),
dd(
a(href := routes.Plan.features, target := "_blank")("No"),
", because ",
"Lichess is entirely free, forever, and for everyone. That's a promise. ",
"But Patrons get bragging rights with a cool new profile icon.",
noPatronFeatures(),
br,
"See the ",
a(href := routes.Plan.features, target := "_blank")("detailed features comparison"),
a(href := routes.Plan.features, target := "_blank")(featuresComparison()),
"."
)
)

View File

@ -108,10 +108,8 @@ object timeline {
a(href := routes.Study.show(studyId))(studyName)
)
case PlanStart(userId) =>
frag(
userIdLink(userId.some, withOnline = true),
" became a ",
a(href := routes.Plan.index)("Patron")
a(href := routes.Plan.index)(
trans.patron.xBecamePatron(userIdLink(userId.some, withOnline = true))
)
case BlogPost(id, slug, title) =>
a(cls := "text", dataIcon := "6", href := routes.Blog.show(id, slug))(title)

View File

@ -1321,6 +1321,43 @@ object patron {
val `donate` = new Translated("donate", Patron)
val `lichessPatron` = new Translated("lichessPatron", Patron)
val `becomePatron` = new Translated("becomePatron", Patron)
val `xBecamePatron` = new Translated("xBecamePatron", Patron)
val `freeAccount` = new Translated("freeAccount", Patron)
val `newPatrons` = new Translated("newPatrons", Patron)
val `freeChess` = new Translated("freeChess", Patron)
val `noAdsNoSubs` = new Translated("noAdsNoSubs", Patron)
val `thankYou` = new Translated("thankYou", Patron)
val `youHaveLifetime` = new Translated("youHaveLifetime", Patron)
val `patronUntil` = new Translated("patronUntil", Patron)
val `ifNotRenewed` = new Translated("ifNotRenewed", Patron)
val `weAreNonProfit` = new Translated("weAreNonProfit", Patron)
val `weRelyOnSupport` = new Translated("weRelyOnSupport", Patron)
val `lifetime` = new Translated("lifetime", Patron)
val `payLifetimeOnce` = new Translated("payLifetimeOnce", Patron)
val `makeExtraDonation` = new Translated("makeExtraDonation", Patron)
val `monthly` = new Translated("monthly", Patron)
val `recurringBilling` = new Translated("recurringBilling", Patron)
val `onetime` = new Translated("onetime", Patron)
val `singleDonation` = new Translated("singleDonation", Patron)
val `otherAmount` = new Translated("otherAmount", Patron)
val `withCreditCard` = new Translated("withCreditCard", Patron)
val `withPaypal` = new Translated("withPaypal", Patron)
val `weAreSmallTeam` = new Translated("weAreSmallTeam", Patron)
val `celebratedPatrons` = new Translated("celebratedPatrons", Patron)
val `whereMoneyGoes` = new Translated("whereMoneyGoes", Patron)
val `serversAndDeveloper` = new Translated("serversAndDeveloper", Patron)
val `costBreakdown` = new Translated("costBreakdown", Patron)
val `officialNonProfit` = new Translated("officialNonProfit", Patron)
val `actOfCreation` = new Translated("actOfCreation", Patron)
val `changeMonthlySupport` = new Translated("changeMonthlySupport", Patron)
val `changeOrContact` = new Translated("changeOrContact", Patron)
val `contactSupport` = new Translated("contactSupport", Patron)
val `otherMethods` = new Translated("otherMethods", Patron)
val `bankTransfers` = new Translated("bankTransfers", Patron)
val `bitcoin` = new Translated("bitcoin", Patron)
val `patronFeatures` = new Translated("patronFeatures", Patron)
val `noPatronFeatures` = new Translated("noPatronFeatures", Patron)
val `featuresComparison` = new Translated("featuresComparison", Patron)
}
}

View File

@ -3,4 +3,45 @@
<string name="donate">Donate</string>
<string name="lichessPatron">Lichess Patron</string>
<string name="becomePatron">Become a Lichess Patron</string>
<string name="xBecamePatron">%s became a Lichess Patron</string>
<string name="freeAccount">Free account</string>
<string name="newPatrons">New Patrons</string>
<string name="freeChess">Free chess for everyone, forever!</string>
<string name="noAdsNoSubs">No ads, no subscriptions; but open-source and passion.</string>
<string name="thankYou">Thank you for your donation!</string>
<string name="youHaveLifetime">You have a Lifetime Patron account. That's pretty awesome!</string>
<string name="patronUntil">You have a Patron account until %s.</string>
<string name="ifNotRenewed">If not renewed, you will then be downgraded to free.</string>
<string name="weAreNonProfit">We are a nonprofit association because we believe everyone should have access to a free, world-class chess platform.</string>
<string name="weRelyOnSupport">We rely on support from people like you to make it possible. If you enjoy using Lichess, please consider supporting us by donating and becoming a Patron!</string>
<string name="lifetime">Lifetime</string>
<string name="payLifetimeOnce">Pay %s once. Be a Lichess Patron forever!</string>
<string name="makeExtraDonation">Make an extra donation?</string>
<string name="monthly">Monthly</string>
<string name="recurringBilling">Recurring billing, renewing your Patron wings every month.</string>
<string name="onetime">One-time</string>
<string name="singleDonation">A single donation that grants you the Patron Wings for one month.</string>
<string name="otherAmount">Other</string>
<string name="withCreditCard">Credit Card</string>
<string name="withPaypal">PayPal</string>
<string name="weAreSmallTeam">We are a small team, so your support makes a huge difference!</string>
<string name="celebratedPatrons">The celebrated Patrons who make Lichess possible</string>
<string name="whereMoneyGoes">Where does the money go?</string>
<string name="serversAndDeveloper">First of all, powerful servers.
Then we pay a full-time developer: %s, the founder of Lichess.
</string>
<string name="costBreakdown">See the detailed cost breakdown</string>
<string name="officialNonProfit">Is Lichess an official non-profit?</string>
<string name="actOfCreation">Yes, here is the act of creation (in french language)</string>
<string name="changeMonthlySupport">Can I change/cancel my monthly support?</string>
<string name="changeOrContact">Yes, at any time, from this page.
Or you can %s.</string>
<string name="contactSupport">contact Lichess support</string>
<string name="otherMethods">Other methods of donation?</string>
<string name="bankTransfers">We also accept bank transfers</string>
<string name="bitcoin">And here's our bitcoin address: %s</string>
<string name="patronFeatures">Are some features reserved to Patrons?</string>
<string name="noPatronFeatures">No, because Lichess is entirely free, forever, and for everyone. That's a promise.
However, Patrons get bragging rights with a cool new profile icon.</string>
<string name="featuresComparison">See the detailed features comparison</string>
</resources>