« Omege Bundle for REAL… | Home | SQLiteManager on sale… »

Localized Web Apps

You can localize a web app. To do so you have two possibilities:

First is to duplicate code. We create a web page for English and for German: WebPageGerman and WebPageEnglish. In the session CreatePage event, we get have pagename being empty for the default page and there we can decide which page should show. For that we look into the session headers and if the accepted language includes German (de), we show the German page. Else the english page:
Function CreatePage(PageName As String) As WebPage
if PageName = "" then // start page
dim Lang as string = Session.Header("Accept-Language")
if instr(lang, "de")>0 then
Return WebPageGerman
else
Return WebPageEnglish
end if
end if
End Function
The second and maybe better way is to change the language in the WebPage open event and switch the labels to show the right texts:
Sub Open()
dim Lang as string = Session.Header("Accept-Language")
if instr(lang, "de")>0 then
label1.text = "Hallo Leute"
end if
End Sub
This way you avoid duplicate code.

Example projects: multilanguageexamples.zip Claris FileMaker Plugin
13 01 11 - 16:33