mirror of
https://github.com/askama-rs/askama.git
synced 2025-09-28 05:21:14 +00:00
Add French translation
This commit is contained in:
parent
efcffeea78
commit
cf94c09e32
@ -54,6 +54,7 @@ enum Lang {
|
||||
#[default]
|
||||
en,
|
||||
de,
|
||||
fr,
|
||||
}
|
||||
|
||||
async fn not_found_handler(req: HttpRequest) -> Result<impl Responder> {
|
||||
|
@ -1,10 +1,10 @@
|
||||
{% extends "_layout.html" %}
|
||||
|
||||
{% block title -%}
|
||||
{%- block title -%}
|
||||
404: Not Found
|
||||
{%- endblock %}
|
||||
{%- endblock -%}
|
||||
|
||||
{% block content -%}
|
||||
{%- block content -%}
|
||||
<h1>404: Not Found</h1>
|
||||
<h2><a href="{{ req.url_for_static("start_handler")? }}">Back to the first page.</a></h2>
|
||||
{%- endblock %}
|
||||
{%- endblock -%}
|
||||
|
@ -43,6 +43,24 @@
|
||||
font-size: 80%;
|
||||
width: max-content;
|
||||
margin: 2em 0 0 auto;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
#lang-select li {
|
||||
flex-grow: 1;
|
||||
flex-basis: auto;
|
||||
margin: .25em 0 0 0;
|
||||
padding: 0 1em;
|
||||
text-align: center;
|
||||
list-style-type: none;
|
||||
border-left: 0.1rem solid currentColor;
|
||||
}
|
||||
#lang-select li:first-of-type {
|
||||
border-left: 0 none transparent;
|
||||
}
|
||||
#lang-select li:last-of-type {
|
||||
padding-right: 0;
|
||||
}
|
||||
/*]]>*/
|
||||
</style>
|
||||
|
@ -1,17 +1,19 @@
|
||||
{% extends "_layout.html" %}
|
||||
|
||||
{% block title -%}
|
||||
{%- block title -%}
|
||||
{%- match lang -%}
|
||||
{%- when Lang::en -%} Hello, {{name}}!
|
||||
{%- when Lang::de -%} Hallo, {{name}}!
|
||||
{%- when Lang::fr -%} Bonjour, {{name}}!
|
||||
{%- endmatch -%}
|
||||
{%- endblock %}
|
||||
{%- endblock -%}
|
||||
|
||||
{%- block content -%}
|
||||
<h1>
|
||||
{%- match lang -%}
|
||||
{%- when Lang::en -%} Hello
|
||||
{%- when Lang::de -%} Hallo
|
||||
{%- when Lang::en -%} Hello!
|
||||
{%- when Lang::de -%} Hallo!
|
||||
{%- when Lang::fr -%} Bonjour!
|
||||
{%- endmatch -%}
|
||||
</h1>
|
||||
<p>
|
||||
@ -22,6 +24,9 @@
|
||||
{%- when Lang::de -%}
|
||||
Hallo, <strong>{{name}}</strong>, schön dich kennenzulernen! {#-~#}
|
||||
Ich bin eine <a href="https://rinja.readthedocs.io/en/latest/">Rinja</a>-Beispielanwendung.
|
||||
{%- when Lang::fr -%}
|
||||
Bonjour, <strong>{{name}}</strong>, ravi de vous rencontrer ! {#-~#}
|
||||
Je suis une application d'exemple de <a href="https://rinja.readthedocs.io/en/latest/">Rinja</a>.
|
||||
{%- endmatch -%}
|
||||
</p>
|
||||
<h2>
|
||||
@ -29,6 +34,7 @@
|
||||
{%- match lang -%}
|
||||
{%- when Lang::en -%} Back to the first page.
|
||||
{%- when Lang::de -%} Zurück zur ersten Seite.
|
||||
{%- when Lang::fr -%} Retour à la première page.
|
||||
{%- endmatch -%}
|
||||
</a>
|
||||
</h2>
|
||||
@ -40,5 +46,8 @@
|
||||
{%- if lang != Lang::de -%}
|
||||
<li><a href="{{ req.url_for("greeting_handler", [Lang::de])? }}?name={{ name|urlencode }}">Diese Seite auf deutsch.</a></li>
|
||||
{%- endif -%}
|
||||
{%- if lang != Lang::fr -%}
|
||||
<li><a href="{{ req.url_for("greeting_handler", [Lang::fr])? }}?name={{ name|urlencode }}">Cette page est en français.</a></li>
|
||||
{%- endif -%}
|
||||
</ul>
|
||||
{%- endblock %}
|
||||
{%- endblock -%}
|
||||
|
@ -1,17 +1,19 @@
|
||||
{% extends "_layout.html" %}
|
||||
|
||||
{% block title -%}
|
||||
{%- block title -%}
|
||||
{%- match lang -%}
|
||||
{%- when Lang::en -%} Hello
|
||||
{%- when Lang::de -%} Hallo
|
||||
{%- when Lang::en -%} Hello!
|
||||
{%- when Lang::de -%} Hallo!
|
||||
{%- when Lang::fr -%} Bonjour!
|
||||
{%- endmatch -%}
|
||||
{%- endblock %}
|
||||
{%- endblock -%}
|
||||
|
||||
{%- block content -%}
|
||||
<h1>
|
||||
{%- match lang -%}
|
||||
{%- when Lang::en -%} Hello
|
||||
{%- when Lang::de -%} Hallo
|
||||
{%- when Lang::en -%} Hello!
|
||||
{%- when Lang::de -%} Hallo!
|
||||
{%- when Lang::fr -%} Bonjour!
|
||||
{%- endmatch -%}
|
||||
</h1>
|
||||
<form
|
||||
@ -27,6 +29,9 @@
|
||||
{%- when Lang::de -%}
|
||||
Ich möchte dir gerne <em>hallo</em> sagen. {#-~#}
|
||||
Bitte nenne mir doch deinen Namen!
|
||||
{%- when Lang::fr -%}
|
||||
Je voudrais vous dire <em>bonjour</em>. {#-~#}
|
||||
Pourriez-vous me donner votre nom ?
|
||||
{%- endmatch -%}
|
||||
</p>
|
||||
<p>
|
||||
@ -34,6 +39,7 @@
|
||||
{%- match lang -%}
|
||||
{%- when Lang::en -%} My name is
|
||||
{%- when Lang::de -%} Ich heiße
|
||||
{%- when Lang::fr -%} Je m'appelle
|
||||
{%- endmatch -%}:
|
||||
<input
|
||||
type="text"
|
||||
@ -50,6 +56,7 @@
|
||||
{%- match lang -%}
|
||||
{%- when Lang::en -%} Greet me, then!
|
||||
{%- when Lang::de -%} Dann begrüße mich!
|
||||
{%- when Lang::fr -%} Saluons-nous !
|
||||
{%- endmatch -%}
|
||||
</button>
|
||||
</label>
|
||||
@ -63,5 +70,8 @@
|
||||
{%- if lang != Lang::de -%}
|
||||
<li><a href="{{ req.url_for("index_handler", [Lang::de])? }}">Diese Seite auf deutsch.</a></li>
|
||||
{%- endif -%}
|
||||
{%- if lang != Lang::fr -%}
|
||||
<li><a href="{{ req.url_for("index_handler", [Lang::fr])? }}">Cette page est en français.</a></li>
|
||||
{%- endif -%}
|
||||
</ul>
|
||||
{%- endblock %}
|
||||
{%- endblock -%}
|
||||
|
Loading…
x
Reference in New Issue
Block a user