mirror of
https://github.com/danbee/chess
synced 2025-03-04 08:39:06 +00:00
Welcome page i18n
This commit is contained in:
parent
1f9b9e02e2
commit
d6c0ec5f13
@ -14,6 +14,6 @@
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<%= submit "Submit", class: "btn btn-primary" %>
|
||||
<%= submit gettext("Submit"), class: "btn btn-primary" %>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
@ -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>
|
||||
|
||||
@ -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
|
||||
|
||||
Loading…
Reference in New Issue
Block a user