[Gambas-user] Translations - Webpage

gian bagoneo at libero.it
Mon Oct 17 16:56:15 CEST 2022

Hi Hans,

Re-reading your email I realized that I didn't understand what code you 
were referring to.

Perhaps if the link had been to an existing page I would have figured it 
out sooner, although this is not certain :-)

If, as I believe, you were referring to the code on this page:

then to get a translation on the master you need to write this in 

<% System.Language = Request.Language %>
If Left(Request.Language, 2) = "it" Then
   <<Page title="Pagina Web Scritta con Gambas3">>
<<Page title="Gambas WebPage Example">>
   <h2><%Print ("Gambas WebPage are easy!")%></h2>
   <h2><%Print ("Time is ")%><%=Format(Now, "hh:nn:ss")%></h2>

Or this in Main.class:

' Public sTitle As String
' Public Sub _new()
'   If Left(Request.Language, 2) = "it" Then
'     sTitle = "Pagina Web Scritta con Gambas3"
'   Else
'     sTitle = "Web Page Written with Gambas3"
'   Endif
' End

Unfortunately, this (still in Main.class):
Public sTitle As String = ("Web Page Written with Gambas3")
seems to work only without a window.
That is, in the console it writes correct HTML code that then does not work:

Content-type: text/html;charset=utf-8


<html xmlns="http://www.w3.org/1999/xhtml">

   <meta http-equiv="content-type" content="text/html; charset=utf-8">
   <link rel="stylesheet" href="/style.css">
   <link rel="icon" href="/img/icon.png" type="image/png">
   <title>Pagina Web Scritta con Gambas3</title>

   <h2>Gambas WebPage è facile!
   <h2>Il tempo è


I attach image of the master's browser


-------------- next part --------------
A non-text attachment was scrubbed...
Name: master-internal-browser.png
Type: image/png
Size: 17538 bytes
Desc: not available
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20221017/1467d0c0/attachment.png>

More information about the User mailing list