NetTalk Central
NetTalk Web Server => Web Server - Ask For Help => Topic started by: Djordje Radovanovic on March 09, 2015, 12:13:28 AM
-
I have problem with Translate procedure. When I send text to translate procedure it receives string in variable p_String
p_web.Translate PROCEDURE(<String p_String>,Long p_AllowHtml=0)
but p_String variable take length from original string so my return string with translate message often is shorter than it needs to be.
Example:
I send 'Alert' and it returns me 'Poruk' instead of 'Poruka'
exactly long string as input string. Tried to find it in template to mend this but no luck.
Best regards,
Djole
-
I made this changes in my application so Translate procedure in WebHandler now looks like this:
p_web.Translate PROCEDURE(<String p_String>,Long p_AllowHtml=0)
ReturnValue ANY
RetString STRING(1000)
CODE
! Start of "NetTalk Method Executable Code Section"
! [Priority 2500]
case p_string
of 'Alert'
RetString = 'Poruka'
of 'First'
RetString = 'Prva'
of 'Previous'
RetString = 'Sledeća'
of 'Last'
RetString = 'Poslednja'
of 'Confirm'
RetString = 'Potvrdite'
of 'Are you sure you want to cancel the changes?'
RetString = 'Sigurno odustajete od izmena?'
of 'Cancel'
RetString = 'Prekid'
of 'No'
RetString = 'Ne'
ELSE
RetString = p_String
END
omit('dovde')
! Parent Call
ReturnValue = PARENT.Translate(p_String,p_AllowHtml)
!dovde
ReturnValue = PARENT.Translate(clip(RetString),p_AllowHtml)
and result is Ok.
Best regards,
Djole
-
Hi Djole,
that is indeed the correct approach. If you need to alter any passed string parameter it's a good idea to make a local string, assign the parameter into that, and work with that.
This is standard Clarion - not specifically related to the web server.
cheers
Bruce