From ebf32c49bfb8f4141b6bfd6bd9c2250563514409 Mon Sep 17 00:00:00 2001 From: shibao Date: Tue, 19 Apr 2022 18:16:06 -0400 Subject: [PATCH] add translation properly --- CHANGELOG.md | 3 +++ CONTRIBUTING.md | 1 + config/runtime.exs | 4 ++-- lib/cannery_web/live/home_live.ex | 2 +- lib/cannery_web/router.ex | 2 ++ 5 files changed, 9 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 92a9e378..0dfc7c2e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +# v0.5.0 +- Add German translation: Thank you [Kaia](https://shitposter.club/users/kaia)! + # v0.4.1 - Fix button and tag text wrapping - Code quality fixes diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 32cf536f..8a5f465d 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -141,3 +141,4 @@ In `prod` mode (or in the Docker container), Cannery will listen for the same en Thank you so much for your contributions! - shibao (https://misskey.bubbletea.dev/@shibao) +- kaia (https://shitposter.club/users/kaia) diff --git a/config/runtime.exs b/config/runtime.exs index bced4378..aa43ee66 100644 --- a/config/runtime.exs +++ b/config/runtime.exs @@ -14,8 +14,8 @@ end config :cannery, CanneryWeb.ViewHelpers, shibao_mode: System.get_env("SHIBAO_MODE") == "true" -# Set locale -Gettext.put_locale(System.get_env("LOCALE") || "en_US") +# Set default locale +config :gettext, :default_locale, System.get_env("LOCALE") || "en_US" maybe_ipv6 = if System.get_env("ECTO_IPV6") == "true", do: [:inet6], else: [] diff --git a/lib/cannery_web/live/home_live.ex b/lib/cannery_web/live/home_live.ex index 8b21073b..827f06a7 100644 --- a/lib/cannery_web/live/home_live.ex +++ b/lib/cannery_web/live/home_live.ex @@ -133,7 +133,7 @@ defmodule CanneryWeb.HomeLive do to: "https://gitea.bubbletea.dev/shibao/cannery/src/branch/stable/CHANGELOG.md", target: "_blank", rel: "noopener noreferrer" do %> -

0.4.1

+

0.5.0

<% end %> diff --git a/lib/cannery_web/router.ex b/lib/cannery_web/router.ex index 9e704df1..88acf06e 100644 --- a/lib/cannery_web/router.ex +++ b/lib/cannery_web/router.ex @@ -11,6 +11,8 @@ defmodule CanneryWeb.Router do plug :protect_from_forgery plug :put_secure_browser_headers plug :fetch_current_user + + Gettext.put_locale(Application.get_env(:gettext, :default_locale, "en_US")) end pipeline :require_admin do