Mercurial Hosting > reactionary
changeset 92:7a56c17befab default tip
translation
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Fri, 02 May 2025 20:20:12 -0600 |
parents | 76baf48ea36b |
children | |
files | src/lib/Shared.luan |
diffstat | 1 files changed, 17 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/src/lib/Shared.luan Fri May 02 17:17:52 2025 -0600 +++ b/src/lib/Shared.luan Fri May 02 20:20:12 2025 -0600 @@ -4,6 +4,7 @@ local pairs = Luan.pairs or error() local Time = require "luan:Time.luan" local Http = require "luan:http/Http.luan" +local Translator = require "luan:gpt/Translator.luan" local Site_translator = require "luan:gpt/Site_translator.luan" local get_lang = Site_translator.get_lang or error() local languages = Site_translator.languages or error() @@ -11,6 +12,22 @@ local Shared = {} +function Translator.prompt(html,language) +%> +Please translate the HTML below delimited by triple quotes from English to <%=language%>. + +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". + +Do not translate file names. + +Do not translate the contents of <code> tags. + +""" +<%=html%> +""" +<% +end + Http.not_found_handler = Site_translator.not_found_handler or error() local started = Time.now()