Translation (WIP)

This commit is contained in:
Greg Burri 2025-01-05 22:38:46 +01:00
parent 9b0fcec5e2
commit e9873c1943
29 changed files with 586 additions and 285 deletions

View file

@ -2,6 +2,7 @@
{% block main_container %}
<div class="content">
<h1></h1>
<form action="/ask_reset_password" method="post">
<label for="email_field">Your email address</label>
<input id="email_field" type="email" name="email" value="{{ email }}" autocapitalize="none" autocomplete="email" autofocus="autofocus" />

View file

@ -6,7 +6,7 @@
{% match user %}
{% when Some with (user) %}
<a class="create-recipe" href="/recipe/new" >Create a new recipe</a>
<a class="create-recipe" href="/recipe/new" >{{ tr.t(Sentence::CreateNewRecipe) }}</a>
<span><a href="/user/edit">
{% if user.name == "" %}
{{ user.email }}
@ -16,7 +16,7 @@
</a> / <a href="/signout" />Sign out</a></span>
{% when None %}
<span>
<a href="/signin" >Sign in</a>/<a href="/signup">Sign up</a>/<a href="/ask_reset_password">Lost password</a>
<a href="/signin" >{{ tr.t(Sentence::SignInMenu) }}</a>/<a href="/signup">{{ tr.t(Sentence::SignUpMenu) }}</a>/<a href="/ask_reset_password">{{ tr.t(Sentence::LostPassword) }}</a>
</span>
{% endmatch %}

View file

@ -7,7 +7,7 @@
<pre><code>
{% endif %}
{{ message|markdown }}
{{ message }}
{% if as_code %}
</code></pre>

View file

@ -6,7 +6,8 @@
{% when Some with (user) %}
<div class="content" id="user-edit">
<h1>Profile</h1>
<h1>{{ tr.t(Sentence::ProfileTitle) }}</h1>
<form action="/user/edit" method="post">
<label for="input-name">Name</label>
@ -20,7 +21,9 @@
autofocus="autofocus" />
<label for="input-email">Email (need to be revalidated if changed)</label>
<input id="input-email" type="email" name="email" value="{{ email }}" autocapitalize="none" autocomplete="email" autofocus="autofocus" />
<input id="input-email" type="email"
name="email" value="{{ email }}"
autocapitalize="none" autocomplete="email" autofocus="autofocus" />
{{ message_email }}

View file

@ -11,7 +11,7 @@
{% if !recipe.description.is_empty() %}
<div class="recipe-description" >
{{ recipe.description.clone()|markdown }}
{{ recipe.description.clone() }}
</div>
{% endif %}
</div>

View file

@ -1,8 +1,7 @@
{% macro recipe_item(id, title, class) %}
<a href="/recipe/view/{{ id }}" class="{{ class }}" id="recipe-{{ id }}">
{% if title == "" %}
{# TODO: Translation #}
Untitled recipe
{{ tr.t(Sentence::UntitledRecipe) }}
{% else %}
{{ title }}
{% endif %}
@ -13,7 +12,7 @@
<div id="recipes-list">
{% if !recipes.unpublished.is_empty() %}
Unpublished recipes
{{ tr.t(Sentence::UnpublishedRecipes) }}
{% endif %}
<nav class="recipes-list-unpublished">

View file

@ -4,16 +4,16 @@
<div class="content" id="sign-in">
<h1>Sign in</h1>
<h1>{{ tr.t(Sentence::SignInTitle) }}</h1>
<form action="/signin" method="post">
<label for="input-email">Email address</label>
<label for="input-email">{{ tr.t(Sentence::EmailAddress) }}</label>
<input id="input-email" type="email" name="email" value="{{ email }}" autocapitalize="none" autocomplete="email" autofocus="autofocus" />
<label for="input-password">Password</label>
<label for="input-password">{{ tr.t(Sentence::Password) }}</label>
<input id="input-password" type="password" name="password" autocomplete="current-password" />
<input type="submit" value="Sign in" />
<input type="submit" value="{{ tr.t(Sentence::SignInMenu) }}" />
</form>
{{ message }}
</div>

View file

@ -4,23 +4,27 @@
<div class="content" id="sign-up">
<h1>Sign up</h1>
<h1>{{ tr.t(Sentence::SignUpTitle) }}</h1>
<form action="/signup" method="post">
<label for="input-email">Your email address</label>
<input id="input-email" type="email" name="email" value="{{ email }}" autocapitalize="none" autocomplete="email" autofocus="autofocus" />
<label for="input-email">{{ tr.t(Sentence::EmailAddress) }}</label>
<input id="input-email" type="email"
name="email" value="{{ email }}"
autocapitalize="none" autocomplete="email" autofocus="autofocus" />
{{ message_email }}
<label for="input-password-1">Choose a password (minimum 8 characters)</label>
<label for="input-password-1">
{{ tr.tp(Sentence::ChooseAPassword, [Box::new(common::consts::MIN_PASSWORD_SIZE)]) }}
</label>
<input id="input-password-1" type="password" name="password_1" autocomplete="new-password" />
<label for="input-password-2">Re-enter password</label>
<label for="input-password-2">{{ tr.t(Sentence::ReEnterPassword) }}</label>
<input id="input-password-2" type="password" name="password_2" autocomplete="new-password" />
{{ message_password }}
<input type="submit" name="commit" value="Sign up" />
<input type="submit" name="commit" value="{{ tr.t(Sentence::SignUpButton) }}" />
</form>
{{ message }}
</div>

View file

@ -1 +1 @@
<a class="title" href="/">~~ Recettes de cuisine ~~</a>
<a class="title" href="/">{{ tr.t(Sentence::MainTitle) }}</a>