From f720df5cda424178e01ed046f051fba3611c1ce9 Mon Sep 17 00:00:00 2001 From: 0x1eef <0x1eef@protonmail.com> Date: Sat, 28 Oct 2023 06:58:44 -0300 Subject: [PATCH] Localize random and redirect pages --- nanoc/rules/random.rules | 4 ++-- src/html/random.html.erb | 4 ++-- src/html/redirect.html.erb | 6 ++++-- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/nanoc/rules/random.rules b/nanoc/rules/random.rules index 4ec994c..f81c9fd 100644 --- a/nanoc/rules/random.rules +++ b/nanoc/rules/random.rules @@ -7,8 +7,8 @@ locales.each do |locale| compile "/html/random.html.erb", rep: "random/#{locale}" do - title = i18n[locale].TheNobleQuran - filter(:erb, locals: {locale:, title:}) + context = Ryo.from({locale:}) + filter(:erb, locals: {context:}) write("/#{locale}/random/index.html") end end diff --git a/src/html/random.html.erb b/src/html/random.html.erb index 83fbb5f..450dcc6 100644 --- a/src/html/random.html.erb +++ b/src/html/random.html.erb @@ -1,7 +1,7 @@ - + - <%= title %> + <%= t(context.locale, "TheNobleQuran") %> <%= inline_json("/slugs.json") %> diff --git a/src/html/redirect.html.erb b/src/html/redirect.html.erb index 9fe2f57..0126903 100644 --- a/src/html/redirect.html.erb +++ b/src/html/redirect.html.erb @@ -1,8 +1,10 @@ + - Al-Quran + <%= t("en", "TheNobleQuran") %> - + +