taldir

Directory service to resolve wallet mailboxes by messenger addresses
Log | Files | Refs | Submodules | README | LICENSE

commit 990da895e0a7c488119182a883db987897caeb71
parent 0d8f7ff3ef1496938a4875eda688523bc1be8915
Author: Martin Schanzenbach <schanzen@gnunet.org>
Date:   Tue, 14 Jan 2025 17:11:36 +0100

more i18n

Diffstat:
Mlocales/de-DE/taldir.yml | 14+++++++++++++-
Mlocales/en-US/taldir.yml | 12++++++++++++
Mpkg/rest/taldir.go | 3+++
Mweb/templates/landing_email.html | 14+++++++-------
Mweb/templates/landing_phone.html | 13+++++++------
Mweb/templates/lookup_result.html | 20++++++++++----------
6 files changed, 52 insertions(+), 24 deletions(-)

diff --git a/locales/de-DE/taldir.yml b/locales/de-DE/taldir.yml @@ -2,5 +2,17 @@ phone: "Telefonnummer" email: "E-Mail" error: "Es ist ein Fehler aufgetreten!" title: "Alias Registration und Suche" -selectAliasToLookupOrLink: "Bitte wähle einen Alias-Typ den Du suchen oder mit einer Bezahlsystemaddresse verlinken möchtest." +selectAliasToLookupOrLink: "Bitte wähle einen Alias-Typ den Du suchen oder mit einer Bezahlsystemadresse verlinken möchtest." lookupOrRegister: "Suchen oder Verlinken" +validationInitiated: "Alias-Validierung gestartet" +pleaseCompleteValidation: "Bitte vervollständige die Alias-Validierung wie in der versendeten Nachricht beschrieben damit wir sicher sein können dass Du es wirklich bist!" +notYetLinked: "`%s` ist noch nicht mit einer Bezahlsystemadresse verlinkt" +isLinked: "`%s` ist bereits mit einer Bezahlsystemadresse verlinkt" +paymentSystemAddress: "Bezahlsystemadresse" +linkIt: "Verlinken" +lookup: "Suchen" +lookupEmail: "E-Mail-Adresse nachschlagen" +lookupEmailDescription: "Gib eine E-Mail-Adresse (z.B. `jdoe@example.com`) ein um die dazugehörige Bezahlsystemadresse nachzuschlagen. Wenn diese noch nicht verlinkt ist, und das Alias unter Dir gehört, hast du dann die Chance dieses mit einer Bazahlsystemadresse zu verlinken." +available: "Verfügbar" +lookupPhoneNr: "Telefonnummer nachschlagen" +lookupPhoneDescription: "Gib eine Telefonnummer ohne das `+` und ohne Leerzeichen ein (z.B. `49123456789`) um die dazugehörige Bezahlsystemadresse nachzuschlagen. Wenn diese noch nicht verlinkt ist, und das Alias unter Dir gehört, hast du dann die Chance dieses mit einer Bazahlsystemadresse zu verlinken." diff --git a/locales/en-US/taldir.yml b/locales/en-US/taldir.yml @@ -4,3 +4,15 @@ error: "An error occured!" title: "Alias Registration and Lookup" selectAliasToLookupOrLink: "Select a type of alias that you want to look up or link to a Payment System Address." lookupOrRegister: "Look up or register" +validationInitiated: "Alias validation initiated" +pleaseCompleteValidation: "Please complete your alias validation according to the instructions sent to you so that we can be sure it is really you!" +notYetLinked: "`%s` is not yet linked with any Payment System Address" +isLinked: "`%s` is linked with a Payment System Address" +paymentSystemAddress: "Payment System Address" +linkIt: "Link it" +lookup: "Lookup" +lookupEmail: "Lookup Email address" +lookupEmailDescription: "Enter an email address (e.g. `jdoe@example.com`) to look up the associated Payment System Address. If it is still unlinked and under your control you will be given the option to link it with a Payment System Address after lookup." +available: "Available" +lookupPhoneNr: "Lookup phone number" +lookupPhoneDescription: "Enter a phone number without the `+` and no spaces (e.g. `49123456789`) to look up the associated Payment System Address. If it is still unlinked and under your control you will be given the option to link it with a Payment System Address after lookup." diff --git a/pkg/rest/taldir.go b/pkg/rest/taldir.go @@ -642,6 +642,7 @@ func (t *Taldir) validationPage(w http.ResponseWriter, r *http.Request) { "address": template.URL(address), "haddress": template.URL(validation.HAddress), "solution": template.URL(expectedSolution), + "tr": t.I18n.GetLocale(r).GetMessage, } t.ValidationTpl.Execute(w, fullData) } @@ -707,6 +708,7 @@ func (t *Taldir) methodLookupResultPage(w http.ResponseWriter, r *http.Request) "address": r.URL.Query().Get("address"), "result": entry.TargetUri, "error": r.URL.Query().Get("error"), + "tr": t.I18n.GetLocale(r).GetMessage, } err = t.LookupResultPageTpl.Execute(w, fullData) if err != nil { @@ -728,6 +730,7 @@ func (t *Taldir) methodLandingPage(w http.ResponseWriter, r *http.Request) { fullData := map[string]interface{}{ "version": t.Version, "error": r.URL.Query().Get("error"), + "tr": t.I18n.GetLocale(r).GetMessage, } err := val.LandingPageTpl.Execute(w, fullData) if err != nil { diff --git a/web/templates/landing_email.html b/web/templates/landing_email.html @@ -5,12 +5,12 @@ <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> <link href="/css/bootstrap.min.css" rel="stylesheet"> - <title>TalDir Alias Registration and Lookup</title> + <title>{{ call .tr "title" }}</title> </head> <body> - {{ template "nav.html" . }} + {{ template "nav.html" . }} <div class="container pt-5"> - <h1 class="text-center mb-5">TalDir Alias Registration and Lookup</h1> + <h1 class="text-center mb-5">{{ call .tr "title" }}</h1> {{if .error}} <div class="container pt-5"> <div id="ebanner" class="alert alert-danger" role="alert"> @@ -21,9 +21,9 @@ </div> {{end}} <div id="ebanner" class="alert alert-info" role="alert"> - <h4 class="alert-heading">Look up email address</h4> + <h4 class="alert-heading">{{ call .tr "lookupEmail" }}</h4> <hr> - <p class="mb-0">Enter an email address (e.g. <i>jdoe@example.com</i>) to look up the associated Payment System Address. If it is still unlinked and under your control you will be given the option to link it with a Payment System Address after lookup.</p> + <p class="mb-0">{{ call .tr "lookupEmailDescription" }}</p> </div> <hr> <form method="get" action="/lookup/email"> @@ -33,12 +33,12 @@ <input type="text" name="address" class="form-control" placeholder="jdoe@example.com" aria-label="Default" aria-describedby="inputGroup-sizing-default" data-sb-validations="required,email"> <div class="invalid-feedback text-white" data-sb-feedback="emailAddressBelow:required">Email Address is required.</div> <div class="invalid-feedback text-white" data-sb-feedback="emailAddressBelow:email">Email Address is not valid.</div> - <input class="input-group-text btn btn-primary" type="submit" value="Lookup"> + <input class="input-group-text btn btn-primary" type="submit" value="{{ call .tr "lookup" }}"> </div> </div> </div> </form> </div> - {{ template "footer.html" . }} + {{ template "footer.html" . }} </body> </html> diff --git a/web/templates/landing_phone.html b/web/templates/landing_phone.html @@ -5,33 +5,34 @@ <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> <link href="/css/bootstrap.min.css" rel="stylesheet"> - <title>TalDir Alias Registration and Lookup</title> + <title>{{ call .tr "title" }}</title> </head> <body> {{ template "nav.html" . }} <div class="container pt-5"> - <h1 class="text-center mb-5">TalDir Alias Registration and Lookup</h1> + <h1 class="text-center mb-5">{{ call .tr "title" }}</h1> {{if .error}} <div class="container pt-5"> <div id="ebanner" class="alert alert-danger" role="alert"> - <h4 class="alert-heading">An error occured!</h4> + <h4 class="alert-heading">{{ call .tr "error" }}</h4> <hr> <p class="mb-0">{{.error}}.</p> </div> </div> {{end}} <div id="ebanner" class="alert alert-info" role="alert"> - <h4 class="alert-heading">Look up phone number</h4> + <h4 class="alert-heading">{{ call .tr "lookupPhoneNr" }}</h4> <hr> - <p class="mb-0">Enter a phone number without the `+` and no spaces (e.g. <i>49123456789</i>) to look up the associated Payment System Address. If it is still unlinked and under your control you will be given the option to link it with a Payment System Address after lookup.</p> + <p class="mb-0">{{ call .tr "lookupPhoneDescription" }}</p> </div> + <hr> <form method="get" action="/lookup/phone"> <div class="row"> <div class="col-lg-6 offset-lg-3 text-center"> <div class="input-group mb-3"> <span class="input-group-text" id="inputGroup-sizing-default">+</span> <input type="text" name="address" class="form-control" aria-label="Default" placeholder="49123456789" aria-describedby="inputGroup-sizing-default"> - <input class="input-group-text btn btn-primary" type="submit" value="Lookup"> + <input class="input-group-text btn btn-primary" type="submit" value="{{ call .tr "lookup" }}"> </div> </div> </div> diff --git a/web/templates/lookup_result.html b/web/templates/lookup_result.html @@ -5,16 +5,16 @@ <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> <link href="/css/bootstrap.min.css" rel="stylesheet"> - <title>TalDir Alias Registration and Lookup</title> + <title>{{ call .tr "title" }}</title> </head> <body> {{ template "nav.html" . }} <div class="container pt-5"> - <h1 class="text-center mb-5">TalDir Alias Registration and Lookup</h1> + <h1 class="text-center mb-5">{{ call .tr "title" }}</h1> {{if .error}} <div class="container pt-5"> <div id="ebanner" class="alert alert-danger" role="alert"> - <h4 class="alert-heading">An error occured!</h4> + <h4 class="alert-heading">{{ call .tr "error" }}</h4> <hr> <p class="mb-0">{{.error}}.</p> </div> @@ -22,17 +22,17 @@ {{end}} <div id="sbanner" class="container pt-5" hidden> <div class="alert alert-success" role="alert"> - <h4 class="alert-heading">Alias validation initiated.</h4> + <h4 class="alert-heading">{{ call .tr "validationInitiated" }}</h4> <hr> - Please complete your alias validation according to the instructions sent to you so that we can be sure it is really you! + {{ call .tr "pleaseCompleteValidation" }} </div> </div> {{if .available}} <div class="container pt-5"> <div id="ebanner" class="alert alert-info" role="alert"> - <h4 class="alert-heading">Available!</h4> + <h4 class="alert-heading">{{ call .tr "available" }}</h4> <hr> - <p class="mb-0">`{{.address}}` is not yet linked with any Payment System Address.</p> + <p class="mb-0">{{ call .tr "notYetLinked" .address}}</p> </div> </div> <hr> @@ -43,8 +43,8 @@ <div class="col-lg-6 offset-lg-3 text-center"> <div class="input-group mb-3"> <span class="input-group-text" id="inputGroup-sizing-default">{{.address}}: </span> - <input id="uriInput" name="target_uri" type="text" class="form-control" placeholder="Payment System Address" aria-label="Default" aria-describedby="inputGroup-sizing-default"> - <input class="input-group-text btn btn-primary" type="submit" value="Link"> + <input id="uriInput" name="target_uri" type="text" class="form-control" placeholder="{{ call .tr "paymentSystemAddress" }}" aria-label="Default" aria-describedby="inputGroup-sizing-default"> + <input class="input-group-text btn btn-primary" type="submit" value="{{ call .tr "linkIt" }}"> </div> </div> </div> @@ -54,7 +54,7 @@ <div id="ebanner" class="alert alert-dark" role="alert"> <h4 class="alert-heading">Found!</h4> <hr> - <p class="mb-0">`{{.address}}` is linked with a Payment System Address.</p> + <p class="mb-0">{{ call .tr "isLinked" .address }}</p> </div> </div> <hr>