Make the UI translatable

This commit is contained in:
Bat
2018-06-17 16:26:15 +01:00
parent cafb0e2277
commit 3207aa0e22
22 changed files with 326 additions and 89 deletions
+5 -5
View File
@@ -2,18 +2,18 @@
{% import "macros" as macros %}
{% block title %}
Dashboard
{{ "Dashboard" | _ }}
{% endblock title %}
{% block content %}
<h1>Your Dashboard</h1>
<h1>{{ "Your Dashboard" | _ }}</h1>
<section>
<h2>Your Blogs</h2>
<h2>{{ "Your Blogs" | _ }}</h2>
{% if blogs | length < 1 %}
<p>You don't have any blog yet. Create your own, or ask to join one.</p>
<p>{{ "You don't have any blog yet. Create your own, or ask to join one." | _ }}</p>
{% endif %}
<a class="button inline-block" href="/blogs/new">Start a new blog</a>
<a class="button inline-block" href="/blogs/new">{{ "Start a new blog" | _ }}</a>
<div class="list">
{% for blog in blogs %}
<div class="card">
+8 -8
View File
@@ -16,27 +16,27 @@
<h1>
{{ name }}
{% if user.is_admin %}
<span class="badge">Admin</span>
<span class="badge">{{ "Admin" | _ }}</span>
{% endif %}
{% if is_self %}
<span class="badge">It is you</span>
<span class="badge">{{ "It is you" | _ }}</span>
{% endif %}
</h1>
{% if is_self %}
<a href="edit" class="button inline-block">Edit your profile</a>
<a href="edit" class="button inline-block">{{ "Edit your profile" | _ }}</a>
{% endif %}
{% if is_remote %}
<a class="inline-block button" href="{{ user.ap_url }}">Open on {{ instance_url }}</a>
<a class="inline-block button" href="{{ user.ap_url }}">{{ "Open on {{ instance_url }}" | _(instance_url=instance_url) }}</a>
{% endif %}
{% if not is_self and account %}
{% if follows %}
<a href="follow/" class="inline-block button">Follow</a>
<a href="follow/" class="inline-block button">{{ "Follow" | _ }}</a>
{% else %}
<a href="follow/" class="inline-block button">Unfollow</a>
<a href="follow/" class="inline-block button">{{ "Unfollow" | _ }}</a>
{% endif %}
{% endif %}
</div>
@@ -50,7 +50,7 @@
</div>
{% if recents | length != 0 %}
<h2>Latest articles</h2>
<h2>{{ "Latest articles" | _ }}</h2>
<div class="cards">
{% for article in recents %}
{{ macros::post_card(article=article) }}
@@ -59,7 +59,7 @@
{% endif %}
{% if reshares | length != 0 %}
<h2>Recently reshared</h2>
<h2>{{ "Recently reshared" | _ }}</h2>
<div class="cards">
{% for article in reshares %}
{{ macros::post_card(article=article) }}
+6 -6
View File
@@ -1,24 +1,24 @@
{% extends "base" %}
{% block title %}
Edit your account
{{ "Edit your account" | _ }}
{% endblock title %}
{% block content %}
<h1>Your Profile</h1>
<h1>{{ "Your Profile" | _ }}</h1>
<form method="post">
<!-- Rocket hack to use various HTTP methods -->
<input type=hidden name="_method" value="put">
<label for="display_name">Display Name</label>
<label for="display_name">{{ "Display Name" | _ }}</label>
<input name="display_name" value="{{ account.display_name }}">
<label for="email">Email</label>
<label for="email">{{ "Email" | _ }}</label>
<input name="email" value="{{ account.email }}">
<label for="summary">Summary</label>
<label for="summary">{{ "Summary" | _ }}</label>
<input name="summary" value="{{ account.summary }}">
<input type="submit" value="Update account"/>
<input type="submit" value="{{ "Update account" | _ }}"/>
</form>
{% endblock content %}
+8 -8
View File
@@ -7,7 +7,7 @@
{% set name = user.username %}
{% endif %}
{{ name }}'s Followers
{{ "{{ name }}'s followers" | _(name=name) }}
{% endblock title %}
{% block content %}
@@ -15,28 +15,28 @@
<h1>
{{ name }}
{% if user.is_admin %}
<span class="badge">Admin</span>
<span class="badge">{{ "Admin" | _ }}</span>
{% endif %}
{% if is_self %}
<span class="badge">It is you</span>
<span class="badge">{{ "It is you" | _ }}</span>
{% endif %}
</h1>
{% if is_remote %}
<a class="inline-block button" href="{{ user.ap_url }}">Open on {{ instance_url }}</a>
<a class="inline-block button" href="{{ user.ap_url }}">{{ "Open on {{ instance_url }}" | _(instance_url=instance_url) }}</a>
{% endif %}
{% if not is_self and account %}
{% if (not is_self) and account %}
{% if follows %}
<a href="../follow/" class="inline-block button">Follow</a>
<a href="../follow/" class="inline-block button">{{ "Follow" | _ }}</a>
{% else %}
<a href="../follow/" class="inline-block button">Unfollow</a>
<a href="../follow/" class="inline-block button">{{ "Unfollow" | _ }}</a>
{% endif %}
{% endif %}
</div>
<h2>Followers</h2>
<h2>{{ "Followers" | _ }}</h2>
<div class="cards">
{% for follower in followers %}
{% if follower.display_name %}
+7 -7
View File
@@ -1,24 +1,24 @@
{% extends "base" %}
{% block title %}
New Account
{{ "New Account" | _ }}
{% endblock title %}
{% block content %}
<h1>Create an account</h1>
<h1>{{ "Create an account" | _ }}</h1>
<form method="post">
<label for="username">Username</label>
<label for="username">{{ "Username" | _ }}</label>
<input name="username">
<label for="email">Email</label>
<label for="email">{{ "Email" | _ }}</label>
<input name="email">
<label for="password">Password</label>
<label for="password">{{ "Password" | _ }}</label>
<input type="password" name="password">
<label for="password_confirmation">Password confirmation</label>
<label for="password_confirmation">{{ "Password confirmation" | _ }}</label>
<input type="password" name="password_confirmation">
<input type="submit" value="Create account"/>
<input type="submit" value="{{ "Create account" | _ }}"/>
</form>
{% endblock content %}