NetTalk Central

NetTalk Web Server => Web Server - Ask For Help => Topic started by: Alberto on April 07, 2014, 09:52:13 AM

Title: NT8 Runtime translation on footer error
Post by: Alberto on April 07, 2014, 09:52:13 AM
Hi,
I have a hand coded footer wich includes the Session EXpire div

I tried to translate the "Session Expires on" to "La Sesión Expira en"
but it change the ó to a group of chars
see image

In the same code I´m translating "Privacy Policy" to "Política de Privacidad"
and it is translated ok
see image

How can I solve it?

Thanks

[attachment deleted by admin]
Title: Re: NT8 Runtime translation on footer error
Post by: Bruce on April 08, 2014, 06:12:17 AM
what does your new code look like?
Title: Re: NT8 Runtime translation on footer error
Post by: Alberto on April 08, 2014, 06:25:03 AM
As you can see in the image in my last post...

if p_web.GetSessionLoggedIn()
    packet.append(p_web.AsciiToUTF(|
        '<div class="nt-left nt-countdown">'&p_web.Translate('Session Expires In')&'<div id="countdown"></div></div>'))
END

packet.append(p_web.AsciiToUTF('<div class="nt-footer nt-right>'))
if p_web.IsMobile()=0
    packet.append(p_web.AsciiToUTF(|
  '<span class=" nt-center"><13,10>'&|
      '<<a class="link_gris" href="UserAgreement">'&p_web.Translate('User Agreement')&'<</a>&nbsp;&nbsp;'&|
      '<<a class="link_gris" href="PrivacyPolicy">'&p_web.Translate('Privacy Policy')&'<</a>&nbsp;&nbsp;'&|
      '<<a class="link_gris" href="javascript:var win=open('''&'./help/html/Index_'&CHOOSE(P_WEB.GSV('LOGIN_LNGHLP')<>'',P_WEB.GSV('LOGIN_LNGHLP'),P_WEB.GSV('LOGIN_LNG'))&'.html'&''',''DwsHelpPage'',''width=900,height=500,directories=no,location=no,menubar=no,scrollbars=yes,status=no,toolbar=no,resizeable=yes'');" alt="'&p_web.Translate('Click here for help')&'" >'&p_web.Translate('Help')&'</a>'&|
  '</span><13,10>'&|
        '',net:OnlyIfUTF,net:StoreAsAscii))
END
packet.append(p_web.AsciiToUTF('</div>'))
Title: Re: NT8 Runtime translation on footer error
Post by: Bruce on April 08, 2014, 07:50:17 AM
sorry, I must be dense - in the image, and your code, it all looks like English to me - I'm not seeing the spanish translations...

cheers
Bruce
Title: Re: NT8 Runtime translation on footer error
Post by: Alberto on April 08, 2014, 07:57:58 AM
The translation is done from English to Spanish and you can see the error on the foot1.png of my first post.
I´ve attached it here again...


[attachment deleted by admin]
Title: Re: NT8 Runtime translation on footer error
Post by: Bruce on April 08, 2014, 09:11:22 PM
correct - that is the result of the translation.
What I am trying to see are the changes you made to the code. You said;

>> I tried to translate the "Session Expires on" to "La Sesión Expira en"

and I'm not seeing where / how you did that translation.

cheers
Bruce
Title: Re: NT8 Runtime translation on footer error
Post by: Alberto on April 09, 2014, 02:56:58 AM
I was wrong...It has nothing to do with the translation...

I´ve added the Spanish string without transtlate it and the same error
Please see image ...

In the countdown div the string is wrong, in the other the string is ok.

May be it has to do with the class used in the DIV?



[attachment deleted by admin]
Title: Re: NT8 Runtime translation on footer error
Post by: Bruce on April 09, 2014, 04:12:20 AM
I think it's best if you just post an example app. I'm obviously not explaining to you what I need to see, and pictures of the output are completely useless to me. If you post an example then I can see what you have done, and duplicate the effect here.

cheers
Bruce
Title: Re: NT8 Runtime translation on footer error
Post by: Alberto on April 10, 2014, 03:32:08 AM
I´m really concern.
I cant reproduce it, I copy the same code to the Web3 example and it work ok.
I dont know why in my app it does not work.
Title: Re: NT8 Runtime translation on footer error
Post by: Bruce on April 10, 2014, 05:03:52 AM
check that the settings on the "Advanced' tab in the webserver (Charset & StoreAs) are set the same as in your app. Also make sure you have the same code embedded in WebHandler, Translate method, if that is in your app.

Cheers
Bruce
Title: Re: NT8 Runtime translation on footer error
Post by: Alberto on April 12, 2014, 11:49:19 AM
May be it is because of the 2nd parmeter of the Translate proc?

ReturnValue = parent.Translate(ReturnValue,p_AllowHtml)

I never use it, I allways call it like

p_web.Translate('yadayada')


Title: Re: NT8 Runtime translation on footer error
Post by: Bruce on April 13, 2014, 10:54:55 PM
there are obviously many, many things it might be caused by. Unfortunately I can't predict which one of them might apply to your application. I would need an example app to duplicate the effect to make any useful comments.

cheers
Bruce