Localize random and redirect pages

This commit is contained in:
0x1eef 2023-10-28 06:58:44 -03:00
parent 058fabd46b
commit f720df5cda
3 changed files with 8 additions and 6 deletions

View file

@ -7,8 +7,8 @@
locales.each do |locale| locales.each do |locale|
compile "/html/random.html.erb", rep: "random/#{locale}" do compile "/html/random.html.erb", rep: "random/#{locale}" do
title = i18n[locale].TheNobleQuran context = Ryo.from({locale:})
filter(:erb, locals: {locale:, title:}) filter(:erb, locals: {context:})
write("/#{locale}/random/index.html") write("/#{locale}/random/index.html")
end end
end end

View file

@ -1,7 +1,7 @@
<!DOCTYPE html> <!DOCTYPE html>
<html> <html lang="<%= context.locale %>">
<head> <head>
<title><%= title %></title> <title><%= t(context.locale, "TheNobleQuran") %></title>
</head> </head>
<body> <body>
<%= inline_json("/slugs.json") %> <%= inline_json("/slugs.json") %>

View file

@ -1,8 +1,10 @@
<!DOCTYPE html> <!DOCTYPE html>
<html lang="en">
<head> <head>
<title>Al-Quran</title> <title><%= t("en", "TheNobleQuran") %></title>
<link rel="icon" href="/favicon.png"> <link rel="icon" href="/favicon.png">
<script src="/js/pages/redirect.js"></script> <script src="/js/pages/redirect.js"></script>
</head> </head>
<body></body> <body>
</body>
</html> </html>