Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F117937855
D327.1775474386.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Authored By
Unknown
Size
1 KB
Referenced Files
None
Subscribers
None
D327.1775474386.diff
View Options
diff --git a/lib/kolab_chat/locale.ex b/lib/kolab_chat/locale.ex
new file mode 100644
--- /dev/null
+++ b/lib/kolab_chat/locale.ex
@@ -0,0 +1,15 @@
+defmodule KolabChat.Locale do
+ import Plug.Conn
+
+ def init(opts), do: opts
+
+ def call(conn, _opts) do
+ case conn.params["locale"] || get_session(conn, :locale) do
+ nil ->
+ conn
+ locale ->
+ Gettext.put_locale(MyApp.Gettext, locale)
+ put_session(conn, :locale, locale)
+ end
+ end
+end
diff --git a/web/router.ex b/web/router.ex
--- a/web/router.ex
+++ b/web/router.ex
@@ -7,6 +7,7 @@
plug :fetch_flash
plug :protect_from_forgery
plug :put_secure_browser_headers
+ plug KolabChat.Locale
end
pipeline :api do
diff --git a/web/templates/layout/app.html.eex b/web/templates/layout/app.html.eex
--- a/web/templates/layout/app.html.eex
+++ b/web/templates/layout/app.html.eex
@@ -7,7 +7,7 @@
<meta name="description" content="">
<meta name="author" content="">
- <title>Kolab Real Time Communication</title>
+ <title><%= gettext "Kolab Real Time Communication" %></title>
<link rel="stylesheet" href="<%= static_path(@conn, "/css/app.css") %>">
</head>
@@ -16,7 +16,7 @@
<header class="header">
<nav role="navigation">
<ul class="nav nav-pills pull-right">
- <li><a href="/login">Login</a></li>
+ <li><a href="/login"><%= gettext "Login" %></a></li>
</ul>
</nav>
<span class="logo"></span>
diff --git a/web/templates/page/index.html.eex b/web/templates/page/index.html.eex
--- a/web/templates/page/index.html.eex
+++ b/web/templates/page/index.html.eex
@@ -1,5 +1,4 @@
<div class="jumbotron">
<h2><%= gettext "Welcome to %{name}", name: "Kolab Chat!" %></h2>
- <p class="lead">Real-time communication for the Kolab groupware system.</p>
+ <p class="lead"><%= gettext "Real-time communication for the Kolab groupware system." %></p>
</div>
-
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Apr 6, 11:19 AM (2 h, 52 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
18836772
Default Alt Text
D327.1775474386.diff (1 KB)
Attached To
Mode
D327: T1949: Added localization module
Attached
Detach File
Event Timeline