1
0
mirror of https://github.com/danbee/chess synced 2025-03-04 08:39:06 +00:00

Welcome page i18n

This commit is contained in:
Daniel Barber 2018-04-08 22:46:07 -04:00
parent 1f9b9e02e2
commit d6c0ec5f13
Signed by: danbarber
GPG Key ID: 931D8112E0103DD8
3 changed files with 19 additions and 3 deletions

View File

@ -14,6 +14,6 @@
</div>
<div class="form-group">
<%= submit "Submit", class: "btn btn-primary" %>
<%= submit gettext("Submit"), class: "btn btn-primary" %>
</div>
<% end %>

View File

@ -1,3 +1,7 @@
<h2>Welcome</h2>
<h2><%= gettext "Welcome" %></h2>
<p><%= link("Log in", to: session_path(@conn, :new)) %> or <%= link("Register", to: registration_path(@conn, :new)) %> to get started.</p>
<p>
<%= gettext("%{login_link} or %{register_link} to get started",
login_link: login_link(@conn),
register_link: register_link(@conn)) |> raw %>
</p>

View File

@ -1,3 +1,15 @@
defmodule ChessWeb.PageView do
use ChessWeb, :view
def login_link(conn) do
gettext("Log in")
|> link(to: session_path(conn, :new))
|> safe_to_string
end
def register_link(conn) do
gettext("Register")
|> link(to: registration_path(conn, :new))
|> safe_to_string
end
end