Mercurial Hosting > luan
changeset 1932:047e4dde22b4
minor
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Fri, 02 May 2025 17:32:01 -0600 |
parents | 28cd9b3abdb3 |
children | 7d5dabe8eab8 |
files | src/luan/modules/gpt/Translator.luan website/src/blasma.html.luan website/src/learn.html.luan website/src/lib/Shared.luan |
diffstat | 4 files changed, 20 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- a/src/luan/modules/gpt/Translator.luan Fri May 02 10:24:38 2025 -0600 +++ b/src/luan/modules/gpt/Translator.luan Fri May 02 17:32:01 2025 -0600 @@ -30,6 +30,8 @@ Note that the content is related to computer programming, so keep that in mind while translating. The English word "library" refers to a programming library, not a place to borrow books, so translate to the word in the target language that means programming library. So for Spanish, use "librerÃa". +Don't translate file names. + """ <%=html%> """
--- a/website/src/blasma.html.luan Fri May 02 10:24:38 2025 -0600 +++ b/website/src/blasma.html.luan Fri May 02 17:32:01 2025 -0600 @@ -1,17 +1,19 @@ local Luan = require "luan:Luan.luan" local error = Luan.error local Io = require "luan:Io.luan" -local Http = require "luan:http/Http.luan" +local Site_translator = require "luan:gpt/Site_translator.luan" +local get_lang = Site_translator.get_lang or error() +local text_writer = Site_translator.text_writer or error() local Shared = require "site:/lib/Shared.luan" local head = Shared.head or error() local header = Shared.header or error() return function() - Io.stdout = Http.response.text_writer() + Io.stdout = text_writer() %> <!doctype html> -<html lang="en"> +<html lang="<%=get_lang()%>"> <head> <% head() %> <title>Blasma</title>
--- a/website/src/learn.html.luan Fri May 02 10:24:38 2025 -0600 +++ b/website/src/learn.html.luan Fri May 02 17:32:01 2025 -0600 @@ -7,6 +7,7 @@ local Shared = require "site:/lib/Shared.luan" local head = Shared.head or error() local header = Shared.docs_header or error() +local reactionary_url = Shared.reactionary_url or error() return function() @@ -39,7 +40,7 @@ <p>Here are my suggested steps for learning Luan:</p> <ol> - <li>Follow my <a href="https://www.reactionary.software/learn.html">Learn Reactionary Programming</a> course up to and including <b>Java 8</b>.</li> + <li>Follow my <a href="<%=reactionary_url()%>/learn.html">Learn Reactionary Programming</a> course up to and including <b>Java 8</b>.</li> <li>Read <a href="pil.html">Programming in Lua</a>. It is actually an excellent book which means that I don't have to write an extensive Luan tutorial. Then read <a href="diff.html">How Luan differs from Lua</a>.</li> <li>Next read the short <a href="tutorial.html">Luan Tutorial</a>.</li> </ol>
--- a/website/src/lib/Shared.luan Fri May 02 10:24:38 2025 -0600 +++ b/website/src/lib/Shared.luan Fri May 02 17:32:01 2025 -0600 @@ -16,7 +16,16 @@ Http.not_found_handler = Site_translator.not_found_handler or error() local started = Time.now() -Shared.started = started + +local function reactionary_url() + local url = "https://www.reactionary.software" + local lang = get_lang() + if lang ~= "en" then + url = url.."/"..lang + end + return url +end +Shared.reactionary_url = reactionary_url function Shared.head() %> @@ -51,7 +60,7 @@ <% end %> </select> </span> - <span><a href="https://www.reactionary.software/">reactionary software</a> by <a href="https://linkmy.style/fschmidt">fschmidt</a></span> + <span><a href="<%=reactionary_url()%>/">reactionary software</a> by <a href="https://linkmy.style/fschmidt">fschmidt</a></span> </div> <% end