NetTalk Central

Author Topic: PR37 Translation in a NetWebPage  (Read 3846 times)

Alberto

  • Hero Member
  • *****
  • Posts: 1873
    • MSN Messenger - alberto-michelis@hotmail.com
    • View Profile
    • ARMi software solutions
    • Email
PR37 Translation in a NetWebPage
« on: May 05, 2009, 04:18:02 AM »
Hi,

I have a translation routine in the p_web.Translate method that works ok in almost all the site, but when I try to use the Translate method in a NetWebPage it hangs.

If I make the packet like

    packet = clip(packet) & |
    '<<br/><13,10>'&|
    '<<!-- Net:MenuWin --><13,10>'&|
    '<<br/><13,10>'&|
    '<<b>Email send failed.<</b><13,10>'&|
    '<<br/><13,10>'&|
    '<<!-- Net:PageFooter --><13,10>'&|
    ''

works ok, but if I add a translate like:
    packet = clip(packet) & |
    '<<br/><13,10>'&|
    '<<!-- Net:MenuWin --><13,10>'&|
    '<<br/><13,10>'&|
    '<<b>'&p_web.Translate('Email send failed.')&'<</b><13,10>'&|
    '<<br/><13,10>'&|
    '<<!-- Net:PageFooter --><13,10>'&|
    ''

it hangs
even if I add a message(p_web.Translate('Email sent OK.')), it hangs too
Any Idea please!?!?!

Thanks
Alberto

-----------
Regards
Alberto

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: PR37 Translation in a NetWebPage
« Reply #1 on: May 05, 2009, 06:34:47 AM »
make sure the string you are returnig from your Translate method is CLIPped.

If that's not it then normal debugging applies - ie determine the line of code that it is hanging on - is it before the translate, during, or after?

Cheers
Bruce

Alberto

  • Hero Member
  • *****
  • Posts: 1873
    • MSN Messenger - alberto-michelis@hotmail.com
    • View Profile
    • ARMi software solutions
    • Email
Re: PR37 Translation in a NetWebPage
« Reply #2 on: May 05, 2009, 09:02:02 AM »
Debuged,
Its during the ADD() command, here is my routine (without traces lines), it runs ok from every procedure except from a NetWebPage 'ResultOfSendEmail' called from the URL on save of a from procedure.

       Access:Translate.open()
       Access:Translate.UseFile()
       TRA:TranslateFrom = p_string
       get(Translate,TRA:XFROM)
       if error()
          clear(tra:record)
          TRA:TranslateFrom = p_string
          TRA:ProcedureName = GlobalErrors.GetProcedureName()
          add(Translate)                <<<<<<here it hangs>>>>>>>
          ReturnValue = p_string
       else
          ReturnValue = choose(getini('languages',p_web.GetSessionValue('LOGIN_lng'),0,'.\TRANSLAT.INI')+1, TRA:TranslateTo_00, TRA:TranslateTo_01, TRA:TranslateTo_02, TRA:TranslateTo_03, TRA:TranslateTo_04, TRA:TranslateTo_05, TRA:TranslateTo_06, TRA:TranslateTo_07, TRA:TranslateTo_08, TRA:TranslateTo_09, TRA:TranslateTo_10, TRA:TranslateTo_11, TRA:TranslateTo_12, TRA:TranslateTo_13, TRA:TranslateTo_14, TRA:TranslateTo_15, TRA:TranslateTo_16, TRA:TranslateTo_17, TRA:TranslateTo_18, TRA:TranslateTo_19, TRA:TranslateTo_20)
       end
       Access:Translate.Close()

Any Idea?
Thanks
Alberto
-----------
Regards
Alberto

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: PR37 Translation in a NetWebPage
« Reply #3 on: May 05, 2009, 08:37:52 PM »
Hi Alberto,

No explicit reason for it to hang on that line. Are you sure your translation file is not corrupt?

This is all normal Clarion code so you should approach it like that, and debug in the normal way.

Make sure Translate file is set to threaded, filename (if you use one) is set to threaded and so on.

Cheers
Bruce

Alberto

  • Hero Member
  • *****
  • Posts: 1873
    • MSN Messenger - alberto-michelis@hotmail.com
    • View Profile
    • ARMi software solutions
    • Email
Re: PR37 Translation in a NetWebPage
« Reply #4 on: May 06, 2009, 03:12:17 AM »
Can't find the problem... I have some Qs...

-In the Translate routine, I need to know the user language, then I use a SessionVariable.
In the Loginpage the user can swich from languages (to undestand the page) without been loggedIn. I´m setting a Session Variable without being loggedin. It is wonking but... can I do it?

-Which is the _life_ of a Value? I mean, when to use SetValue instead of SSV?

-If I need to check for a global parameter for all the site in the WebHandler, how can I do it? I´m reading an INI file, but is there a way to use a memory variable?

-Could you look at the General Buttons text translate problem?

Thanks
Alberto
-----------
Regards
Alberto