translations and language specific templates implementation
This commit is contained in:
parent
5190019fc3
commit
870066ef79
|
@ -14,11 +14,21 @@ templates = {
|
||||||
footer = { path = "pagefooter.html", template = ""},
|
footer = { path = "pagefooter.html", template = ""},
|
||||||
incoming = { path = "pageincoming.html", template = ""}
|
incoming = { path = "pageincoming.html", template = ""}
|
||||||
},
|
},
|
||||||
|
webEs = {
|
||||||
|
header = { path = "pageheader.html", template = ""},
|
||||||
|
footer = { path = "pagefooter_es.html", template = ""},
|
||||||
|
incoming = { path = "pageincoming_es.html", template = ""}
|
||||||
|
},
|
||||||
gemEn = {
|
gemEn = {
|
||||||
header = { path = "pageheader.gmi", template = ""},
|
header = { path = "pageheader.gmi", template = ""},
|
||||||
footer = { path = "pagefooter.gmi", template = ""},
|
footer = { path = "pagefooter.gmi", template = ""},
|
||||||
incoming = { path = "pageincoming.gmi", template = ""}
|
incoming = { path = "pageincoming.gmi", template = ""}
|
||||||
},
|
},
|
||||||
|
gemEs = {
|
||||||
|
header = { path = "pageheader.gmi", template = ""},
|
||||||
|
footer = { path = "pagefooter_es.gmi", template = ""},
|
||||||
|
incoming = { path = "pageincoming_es.gmi", template = ""}
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
pages = {}
|
pages = {}
|
||||||
|
@ -127,7 +137,27 @@ function firstPass()
|
||||||
if line == "" then
|
if line == "" then
|
||||||
pagemeta.lang = "en,es-MX" -- default
|
pagemeta.lang = "en,es-MX" -- default
|
||||||
else
|
else
|
||||||
pagemeta.lang, pagemeta.trlang, pagemeta.trname = string.match("^lang=(.-)%s(.-)->(.-)$")
|
local langformat = "^lang=(%a+)"
|
||||||
|
local tradformat = "%s(%a+)->(.-)$"
|
||||||
|
pagemeta.lang = string.match(line,langformat)
|
||||||
|
local trlang, trname = string.match(line, tradformat)
|
||||||
|
if trlang ~= nil then
|
||||||
|
local ttext = "in english:"
|
||||||
|
if string.match( trlang, "^es" ) then
|
||||||
|
ttext = "en español:"
|
||||||
|
end
|
||||||
|
local weblink = string.format(
|
||||||
|
"<a href='./%s.html' rel='alternate'>%s</a>",
|
||||||
|
pages[ trname ].slug, trname )
|
||||||
|
local gemlink = string.format(
|
||||||
|
"=> ./%s.gmi %s",
|
||||||
|
pages[ trname ].slug, trname )
|
||||||
|
pagemeta.webtranslation = string.format(
|
||||||
|
"<p id='translation'>%s %s</p>",
|
||||||
|
ttext, weblink )
|
||||||
|
pagemeta.gemtranslation = string.format(
|
||||||
|
"%s\n%s\n", ttext, gemlink)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
elseif count == 3 then -- obtain page description
|
elseif count == 3 then -- obtain page description
|
||||||
pagemeta.pdescription,n = string.gsub(line,"[{}]","")
|
pagemeta.pdescription,n = string.gsub(line,"[{}]","")
|
||||||
|
@ -170,7 +200,7 @@ function firstPass()
|
||||||
end
|
end
|
||||||
|
|
||||||
local close = closeTags()
|
local close = closeTags()
|
||||||
out.web = string.format("%s<h%d>%s</h%d>",close,level,title,level)
|
out.web = string.format("%s<h%d id='%s'>%s</h%d>",close,level,title,title,level)
|
||||||
|
|
||||||
elseif string.match( line, "^>") then -- BLOCKQUOTE
|
elseif string.match( line, "^>") then -- BLOCKQUOTE
|
||||||
local close = closeTags()
|
local close = closeTags()
|
||||||
|
@ -189,9 +219,10 @@ function firstPass()
|
||||||
local dest, text = getLink( line )
|
local dest, text = getLink( line )
|
||||||
if string.match( dest, "^%./") then --local links
|
if string.match( dest, "^%./") then --local links
|
||||||
local t = string.match( text, "^{(.-)}$" )
|
local t = string.match( text, "^{(.-)}$" )
|
||||||
|
local htmldest = string.gsub( dest, "gmi", "html" )
|
||||||
if t ~= nil then -- wikilink
|
if t ~= nil then -- wikilink
|
||||||
local close = closeTags()
|
local close = closeTags()
|
||||||
out.web = string.format("%s<p><a href='%s' class='arrow'>%s</a></p>",close,dest,t)
|
out.web = string.format("%s<p><a href='%s' class='arrow'>%s</a></p>",close,htmldest,t)
|
||||||
|
|
||||||
elseif isImagePath( dest ) then -- images
|
elseif isImagePath( dest ) then -- images
|
||||||
local img = string.format('<img src="%s" alt="%s" loading="lazy"/>',dest,text)
|
local img = string.format('<img src="%s" alt="%s" loading="lazy"/>',dest,text)
|
||||||
|
@ -271,8 +302,14 @@ function firstPass()
|
||||||
pagemeta.navcontent = table.concat( navlines, "\n" )
|
pagemeta.navcontent = table.concat( navlines, "\n" )
|
||||||
|
|
||||||
-- set templates
|
-- set templates
|
||||||
pagemeta.outs.web.templates = templates.webEn
|
if string.match( pagemeta.lang, "^en" ) then
|
||||||
pagemeta.outs.gem.templates = templates.gemEn
|
pagemeta.outs.web.templates = templates.webEn
|
||||||
|
pagemeta.outs.gem.templates = templates.gemEn
|
||||||
|
else
|
||||||
|
pagemeta.outs.web.templates = templates.webEs
|
||||||
|
pagemeta.outs.gem.templates = templates.gemEs
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
-- fill templates and write results
|
-- fill templates and write results
|
||||||
for key, out in pairs(pagemeta.outs) do
|
for key, out in pairs(pagemeta.outs) do
|
||||||
|
@ -336,6 +373,7 @@ function initPageMetadata( name ) -- return a table with metadata
|
||||||
updatedate = "",
|
updatedate = "",
|
||||||
navcontent = "",
|
navcontent = "",
|
||||||
gemincoming = "", webincoming = "",
|
gemincoming = "", webincoming = "",
|
||||||
|
gemtranslation = "", webtranslation = ""
|
||||||
}
|
}
|
||||||
meta.outs = {
|
meta.outs = {
|
||||||
web = { path = string.format("%s/%s.html", webdir, meta.slug) },
|
web = { path = string.format("%s/%s.html", webdir, meta.slug) },
|
||||||
|
|
|
@ -1,9 +1,7 @@
|
||||||
# about
|
# about
|
||||||
|
lang=en es->acerca
|
||||||
compudanzas is a research project exploring alternative modes of learning and creating computation.
|
compudanzas is a research project exploring alternative modes of learning and creating computation.
|
||||||
|
|
||||||
en español: {acerca}
|
|
||||||
|
|
||||||
we attempt to transition from a logic of productivity and efficiency, and circuits that destroy life, to dances, rituals, and other types of seemingly useless computers!
|
we attempt to transition from a logic of productivity and efficiency, and circuits that destroy life, to dances, rituals, and other types of seemingly useless computers!
|
||||||
|
|
||||||
we move calmly, patiently, and with curiosity.
|
we move calmly, patiently, and with curiosity.
|
||||||
|
|
|
@ -1,9 +1,7 @@
|
||||||
# acerca
|
# acerca
|
||||||
|
lang=es en->about
|
||||||
compudanzas es un proyecto creativo de investigación que explora formas alternativas de aprender y hacer cómputo.
|
compudanzas es un proyecto creativo de investigación que explora formas alternativas de aprender y hacer cómputo.
|
||||||
|
|
||||||
in english: {about}
|
|
||||||
|
|
||||||
reimaginamos la computación y sus implicaciones.
|
reimaginamos la computación y sus implicaciones.
|
||||||
|
|
||||||
tratamos de transicionar desde una lógica de productividad y eficiencia, y circuitos que destruyen vida, hacia danzas, rituales, y otros tipos de computadoras aparentemente inútiles.
|
tratamos de transicionar desde una lógica de productividad y eficiencia, y circuitos que destruyen vida, hacia danzas, rituales, y otros tipos de computadoras aparentemente inútiles.
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
# compudanzas ahora
|
# compudanzas ahora
|
||||||
|
lang=es en->now
|
||||||
en qué andamos aproximadamente en estos momentos:
|
en qué andamos aproximadamente en estos momentos:
|
||||||
|
|
||||||
presentamos {alive computing dance} en el 10 aniversario de algorave, nuestro primer performance que utiliza a la {qiudanz technique}.
|
presentamos {alive computing dance} en el 10 aniversario de algorave, nuestro primer performance que utiliza a la {qiudanz technique}.
|
||||||
|
|
|
@ -1,9 +1,7 @@
|
||||||
# apoyo
|
# apoyo
|
||||||
|
lang=es en->support
|
||||||
compudanzas como la práctica de hacer tangible a la computación ha sido un proyecto de ensueño por ya varios años.
|
compudanzas como la práctica de hacer tangible a la computación ha sido un proyecto de ensueño por ya varios años.
|
||||||
|
|
||||||
in english: {support}
|
|
||||||
|
|
||||||
=> ./img/foto_laconsagracion_04.jpg foto de piezas de madera en el suelo manipuladas por algunas manos
|
=> ./img/foto_laconsagracion_04.jpg foto de piezas de madera en el suelo manipuladas por algunas manos
|
||||||
|
|
||||||
¡contribuye a hacerlo posible con tu apoyo económico!
|
¡contribuye a hacerlo posible con tu apoyo económico!
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
# contact
|
# contact
|
||||||
|
lang=en es->contacto
|
||||||
let's connect!
|
let's connect!
|
||||||
|
|
||||||
our e-mail address: compudanzas at posteo dot net
|
our e-mail address: compudanzas at posteo dot net
|
||||||
|
@ -17,5 +17,3 @@ and in the ssb network, thanks to {la sala}:
|
||||||
see the {log} for non-interactive ways of following our updates.
|
see the {log} for non-interactive ways of following our updates.
|
||||||
|
|
||||||
(in some contexts you can find me as {sejo})
|
(in some contexts you can find me as {sejo})
|
||||||
|
|
||||||
en español: {contacto}
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
# contacto
|
# contacto
|
||||||
|
lang=es en->contact
|
||||||
¡conectemos!
|
¡conectemos!
|
||||||
|
|
||||||
nuestra dirección de correo-e: compudanzas en posteo dot net
|
nuestra dirección de correo-e: compudanzas en posteo dot net
|
||||||
|
@ -17,5 +17,3 @@ y en la red ssb, gracias a {la sala}:
|
||||||
además, en el {log} hay más opciones no interactivas para seguir nuestras actualizaciones.
|
además, en el {log} hay más opciones no interactivas para seguir nuestras actualizaciones.
|
||||||
|
|
||||||
(en algunos contextos me puedes encontrar como {sejo})
|
(en algunos contextos me puedes encontrar como {sejo})
|
||||||
|
|
||||||
in english: {contact}
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
# danzas compuertas
|
# danzas compuertas
|
||||||
|
lang=es
|
||||||
antiguas historias hablaban de computar en conjunto, en comunidad.
|
antiguas historias hablaban de computar en conjunto, en comunidad.
|
||||||
|
|
||||||
tareas sencillas y divertidas que requieren atención y presencia y que combinadas dan paso a complejidad, a olas, a cambios.
|
tareas sencillas y divertidas que requieren atención y presencia y que combinadas dan paso a complejidad, a olas, a cambios.
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
# now
|
# now
|
||||||
|
lang=en es->ahora
|
||||||
what are we up to approximately now.
|
what are we up to approximately now.
|
||||||
|
|
||||||
we just performed {alive computing dance} on the 10th anniversay of algorave, a livecoding performance using the {qiudanz technique}.
|
we just performed {alive computing dance} on the 10th anniversay of algorave, a livecoding performance using the {qiudanz technique}.
|
||||||
|
|
|
@ -1,9 +1,7 @@
|
||||||
# support
|
# support
|
||||||
|
lang=en es->apoyo
|
||||||
compudanzas as the practice of making computation tangible in dance and paper has been a dream project for many years now.
|
compudanzas as the practice of making computation tangible in dance and paper has been a dream project for many years now.
|
||||||
|
|
||||||
en español: {apoyo}
|
|
||||||
|
|
||||||
=> ./img/foto_laconsagracion_04.jpg photo of pieces of wood in the floor, with some hands manipulating them
|
=> ./img/foto_laconsagracion_04.jpg photo of pieces of wood in the floor, with some hands manipulating them
|
||||||
|
|
||||||
i have decided to transition towards giving the project my full attention and energy.
|
i have decided to transition towards giving the project my full attention and energy.
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
# tutorial de uxn
|
# tutorial de uxn
|
||||||
|
lang=es en->uxn tutorial
|
||||||
una guía introductoria y pausada para programar la computadora varvara basada en el núcleo {uxn}.
|
una guía introductoria y pausada para programar la computadora varvara basada en el núcleo {uxn}.
|
||||||
|
|
||||||
> El ecosistema de Uxn es un espacio de juego y exploración de computación personal, creado para desarrollar y utilizar pequeñas herramientas y juegos y programable en su propio lenguaje ensamblador.
|
> El ecosistema de Uxn es un espacio de juego y exploración de computación personal, creado para desarrollar y utilizar pequeñas herramientas y juegos y programable en su propio lenguaje ensamblador.
|
||||||
|
|
|
@ -1,13 +1,11 @@
|
||||||
# uxn tutorial
|
# uxn tutorial
|
||||||
|
lang=en es->tutorial de uxn
|
||||||
welcome to this beginner's, slow-paced and comprehensive guide for programming the varvara computer based on the {uxn} core.
|
welcome to this beginner's, slow-paced and comprehensive guide for programming the varvara computer based on the {uxn} core.
|
||||||
|
|
||||||
you can get an offline version of this guide as the {introduction to uxn programming book}!
|
you can get an offline version of this guide as the {introduction to uxn programming book}!
|
||||||
|
|
||||||
if you prefer video, you can watch a short {intro to uxn programming} workshop that we taught as an introduction.
|
if you prefer video, you can watch a short {intro to uxn programming} workshop that we taught as an introduction.
|
||||||
|
|
||||||
there's a translation to spanish: {tutorial de uxn}
|
|
||||||
|
|
||||||
# day 1
|
# day 1
|
||||||
|
|
||||||
in this first section of the tutorial we talk about the basics of the uxn computer called varvara, its programming paradigm in a language called uxntal, its architecture, and why you would want to learn to program it.
|
in this first section of the tutorial we talk about the basics of the uxn computer called varvara, its programming paradigm in a language called uxntal, its architecture, and why you would want to learn to program it.
|
||||||
|
|
|
@ -90,6 +90,13 @@ table td {
|
||||||
td.num{
|
td.num{
|
||||||
text-align:right;
|
text-align:right;
|
||||||
}
|
}
|
||||||
|
#translation{
|
||||||
|
font-size: smaller;
|
||||||
|
font-style: italic;
|
||||||
|
}
|
||||||
|
#incoming{
|
||||||
|
font-size: smaller;
|
||||||
|
}
|
||||||
|
|
||||||
/* desktop */
|
/* desktop */
|
||||||
@media screen and (min-width: 600px) {
|
@media screen and (min-width: 600px) {
|
||||||
|
|
|
@ -0,0 +1,5 @@
|
||||||
|
|
||||||
|
# meta
|
||||||
|
=> ./home.gmi {title}
|
||||||
|
=> ./contacto.gmi contacto
|
||||||
|
=> https://endefensadelsl.org/ppl_deed_es.html textos, imágenes y código compartidos bajo la licencia de producción de pares
|
|
@ -0,0 +1,15 @@
|
||||||
|
</main>
|
||||||
|
<footer>
|
||||||
|
<p>
|
||||||
|
<a href='https://tildegit.org/sejo/compudanzas/src/branch/main/src/{slug}.gmo' rel='external noreferrer noopener' target=_blank>archivo fuente</a> —
|
||||||
|
actualización más reciente::
|
||||||
|
<time datetime='{updatedate}'>1{updatedate}</time> —
|
||||||
|
<a href='gemini://{domain}/{slug}.gmi' rel='external noreferrer noopener' target=_blank>en gemini://</a>
|
||||||
|
</p>
|
||||||
|
<hr/>
|
||||||
|
<p><a href='./acerca.html'>acerca</a> <a href='./contacto.html'>contacto</a> <a href='./apoyo.html'>apoyo</a></p>
|
||||||
|
<p><a class='icon' href='./home.html' title='{title}'><img src='./img/iconocompudanzas_32.png' width=32 height=32 alt='icono de compudanzas'/></a>
|
||||||
|
<a href='https://webring.xxiivv.com/#random' target='_blank' title='webring' class='icon'><img src='./img/icon.black.svg' width='32' height='32' alt='xxiivv webring'/></a></p>
|
||||||
|
<p>textos, imágenes y código compartidos bajo la <a href='https://endefensadelsl.org/ppl_deed_es.html' target=_blank rel='external noreferrer noopener' title='licencia de producción de pares'>licencia de producción de pares</a></p>
|
||||||
|
</footer>
|
||||||
|
</body>
|
|
@ -1,2 +1,2 @@
|
||||||
# {ptitle}
|
# {ptitle}
|
||||||
|
{gemtranslation}
|
||||||
|
|
|
@ -20,8 +20,9 @@
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<header>
|
<header>
|
||||||
<p><a class='icon' href='./home.html' title='{title}'><img src='./img/iconocompudanzas_32.png' style='margin:0' alt='icono de compudanzas'/></a></p>
|
<p><a class='icon' href='./home.html' title='{title}'><img src='./img/iconocompudanzas_32.png' style='margin:0' alt='{title}'/></a></p>
|
||||||
<h1>{ptitle}</h1>
|
<h1>{ptitle}</h1>
|
||||||
|
{webtranslation}
|
||||||
</header>
|
</header>
|
||||||
<nav>
|
<nav>
|
||||||
{navcontent}
|
{navcontent}
|
||||||
|
|
|
@ -0,0 +1,3 @@
|
||||||
|
|
||||||
|
# enlaces entrantes
|
||||||
|
{gemincoming}
|
|
@ -0,0 +1,4 @@
|
||||||
|
<section id='incoming'>
|
||||||
|
<h1>enlaces entrantes</h1>
|
||||||
|
{webincoming}
|
||||||
|
</section>
|
Loading…
Reference in New Issue