diff website/src/diff.html.luan @ 1929:31f006c64782

translation
author Franklin Schmidt <fschmidt@gmail.com>
date Thu, 01 May 2025 18:31:05 -0600
parents 50e570b598b2
children
line wrap: on
line diff
--- a/website/src/diff.html.luan	Sun Apr 27 04:24:08 2025 -0600
+++ b/website/src/diff.html.luan	Thu May 01 18:31:05 2025 -0600
@@ -1,7 +1,9 @@
 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 docs_header = Shared.docs_header or error()
@@ -27,19 +29,19 @@
 				title = "Values and Types"
 				content = function()
 %>
-<p>Luan adds a <em>binary</em> type that Lua doesn't have.  This is because Lua strings can represent binary while Luan strings cannot.</p>
+<p>Luan adds a <b>binary</b> type that Lua doesn't have.  This is because Lua strings can represent binary while Luan strings cannot.</p>
 
-<p>The Luan <em>Nil</em> type is implemented as the Java <em>null</em>.  The Luan <em>Boolean</em> type is implemented as the Java <em>Boolean</em> type.  The Luan <em>Number</em> type is implemented as the Java <em>Number</em> type.  The Luan <em>String</em> type is implemented as the Java <em>String</em> type.  Actual numbers may be any subclass of the Java <em>Number</em> class.</p>
+<p>The Luan <b>Nil</b> type is implemented as the Java <b>null</b>.  The Luan <b>Boolean</b> type is implemented as the Java <b>Boolean</b> type.  The Luan <b>Number</b> type is implemented as the Java <b>Number</b> type.  The Luan <b>String</b> type is implemented as the Java <b>String</b> type.  Actual numbers may be any subclass of the Java <b>Number</b> class.</p>
 
 <p>Luan functions may be written in Luan or may be wrappers around native Java methods.  Any Java method may be called as a Luan function.</p>
 
-<p>The Luan <em>java</em> type is a replacement for Lua's <em>userdata</em>.  A Luan <em>java</em> value is nothing more than a Java object that doesn't fall into one of the other recognized types.</p>
+<p>The Luan <b>java</b> type is a replacement for Lua's <b>userdata</b>.  A Luan <b>java</b> value is nothing more than a Java object that doesn't fall into one of the other recognized types.</p>
 
-<p>The Luan <em>binary</em> type is the Java <em>byte[ ]</em> type which is an array of bytes.</p>
+<p>The Luan <b>binary</b> type is the Java <b>byte[ ]</b> type which is an array of bytes.</p>
 
-<p>The Luan <em>table</em> type is just like its Lua equivalent, but implemented in Java.</p>
+<p>The Luan <b>table</b> type is just like its Lua equivalent, but implemented in Java.</p>
 
-<p>Luan does not have the Lua <em>thread</em> type which aren't actually threads but in fact are coroutines.  Luan has real threads.  This is particularly valuable for web serving where each request is handled by a thread.  But thread synchronization is too complicated for application programmers.  So Luan makes mutable objects immutable when they become accessible by multiple threads.  This eliminates the need for thread synchronization.  If there is a need to share mutable state across threads, there are special functions for this.</p>
+<p>Luan does not have the Lua <b>thread</b> type which aren't actually threads but in fact are coroutines.  Luan has real threads.  This is particularly valuable for web serving where each request is handled by a thread.  But thread synchronization is too complicated for application programmers.  So Luan makes mutable objects immutable when they become accessible by multiple threads.  This eliminates the need for thread synchronization.  If there is a need to share mutable state across threads, there are special functions for this.</p>
 <%
 				end
 			}
@@ -141,7 +143,7 @@
 <p>Luan has no numeric <b>for</b> statement.  Luan only has generic <b>for</b> statement.  Instead of the numeric <b>for</b> statement, Luan uses the <code>range</code> function in a generic <b>for</b> statement like this:</p>
 
 <code block>
-for i in range(from,to,step) do <em>block</em> end
+for i in range(from,to,step) do block end
 </code>
 
 <p>The Luan generic <b>for</b> statement is simpler than the Lua version because Luan only uses an expression, not an explist.  So a <b>for</b> statement like:</p>
@@ -246,7 +248,7 @@
 
 <p>Luan does not support Lua's <code>v:name(args)</code> style object-oriented function call.  Object oriented programming is done in Luan using closures, so this feature is not needed.</p>
 
-<p>Luan doesn't support <em>proper tail calls</em>.  Because Java doesn't support this cleanly, this was left out.</p>
+<p>Luan doesn't support <b>proper tail calls</b>.  Because Java doesn't support this cleanly, this was left out.</p>
 <%
 						end
 					}
@@ -266,10 +268,10 @@
 
 
 return function()
-	Io.stdout = Http.response.text_writer()
+	Io.stdout = text_writer()
 %>
 <!doctype html>
-<html>
+<html lang="<%=get_lang()%>">
 	<head>
 <%		head() %>
 		<title>How Luan differs from Lua</title>