NetTalk Central
NetTalk Web Server => Web Server - Ask For Help => Topic started by: lkeyser on January 16, 2012, 07:00:05 AM
-
Hi all
My worst nightmare came true. I have to develop a website in a different language, in my case “Afrikaans”.
I’m Using “Hotdates” example as a starting point and need to translate all the JQUERY calendars to “Afrikaans”.
I know from some reading I’ve done, that I need to add the loc:options as seen below to my code.
loc:options = 'dayNames: ["Maandag", "Dinsdag", "Woensdagi", "Donderdag", "Vrydag", "Saterdag", "Sondag"],
I need some baby step guidance where to add it the code please
Clarion 6.3
NETTALK 5
Many thanks
Louis
-
Hi Louis,
In the webhandler procedure - ProcessLink - After parent.
Here's my code - although it's a danish translation I think you get the picture.
p_web.site.DateOptions = 'firstDay: 1' & |
',showWeek: true' & |
',monthNames: [''Januar'', ''Februar'', ''Marts'', ''April'', ''Maj'', ''Juni'', ''Juli'', ''August'', ''September'', ''Oktober'', ''November'', ''December'']'&|
',monthNamesShort: [''Jan'', ''Feb'', ''Mar'', ''Apr'', ''Maj'', ''Jun'', ''Jul'', ''Aug'', ''Sep'', ''Okt'', ''Nov'', ''Dec'']'&|
',dayNames: [''Søndag'', ''Mandag'', ''Tirsdag'', ''Onsdag'', ''Torsdag'', ''Fredag'', ''Lørdag'']'&|
',dayNamesMin: [''Sø'', ''Ma'', ''Ti'', ''On'', ''To'', ''Fr'', ''Lø'']'&|
',dayNamesShort: [''Søn'', ''Man'', ''Tir'', ''Ons'', ''Tor'', ''Fre'', ''Lør'']'&|
',closeText: ''Luk'''&|
',currentText: ''I dag'''&|
',nextText: ''Næste'''&|
',prevText: ''Forrige''' & |
',weekHeader: ''Uge'''
Peter
-
Thanks Peter
I copied your code and it Worked !!!!! ;D
BUT
If you look at the Hotdates (12) example the “Larger” calendar date formats does not seem to inherit the same settings.
The small popup calendars works great! Any suggestions ?
Thanks
Louis
[attachment deleted by admin]
-
Hi Louis,
All "text" flows through the .Translate method in the Webhandler procedure.
Ideally you plug your favorite translation engine in there. So, to be completely trivial you can have something like
case lower(p_string)
of 'February'
Return 'Feburarie'
end
usually though, of course, one uses a data table, containing the "english" and "alternate" versions, and at this point you do a lookup on the english word, or phrase, and provide the suitable replacement. If the translation set can be fit into Ram (In memory table for example) then so much the better.
Incidentally this whole approach allows the site to be bilingual, at runtime. If you are making the site Afrikaans only, then the list of stuff to translate in the .Translate method is quite small.
Cheers
Bruce