NetTalk Central

Author Topic: Please Translate  (Read 10131 times)

Alberto

  • Hero Member
  • *****
  • Posts: 1873
    • MSN Messenger - alberto-michelis@hotmail.com
    • View Profile
    • ARMi software solutions
    • Email
Please Translate
« on: March 10, 2009, 07:44:33 AM »
Please Bruce,

Add translation to the :
menu items
browse header tooltips
browse 'No Records found'
browse delete conf q 'Are you sure you want to delete this record?'
browse 'Enter a search term in the locator'
form Tabs
form field drop extra posibilities
form field tooltips and comments

Thank you very much... to be continued
Alberto
-----------
Regards
Alberto

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Please Translate
« Reply #1 on: March 10, 2009, 10:51:16 PM »
Hi Alberto,

Note -
All of these places, (and many others) allow you to enter expressions.
In other words you can use the appropriate function call for the translation tool you prefer.

However I'll see if these can easily get support for the translator class.

Cheers
Bruce

Alberto

  • Hero Member
  • *****
  • Posts: 1873
    • MSN Messenger - alberto-michelis@hotmail.com
    • View Profile
    • ARMi software solutions
    • Email
Re: Please Translate
« Reply #2 on: March 11, 2009, 01:12:16 AM »
Yes, I know I can use expressions but if NTWS provide Translator class compatibility it must be for all controls, if not, we need to use two translation methods...
Besides, using expressions means typing a lot of code and even if you use a small function name it is very confuse to read the template screen (entry fields too small)

If you have a minute, may you please take a look at my "Translation problem" post?

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

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Please Translate
« Reply #3 on: March 11, 2009, 08:16:16 AM »
Hi Alberto,

I'll add the translator stuff to the list.
I'm not a big user of the translator class myself, so I'm not all that familiar with how it works, and what options you have and so on.

Incidentally, on Expression fields, where they are too small, you can press F10 to get an exploded view. I use this a lot myself.

Cheers
Bruce


Alberto

  • Hero Member
  • *****
  • Posts: 1873
    • MSN Messenger - alberto-michelis@hotmail.com
    • View Profile
    • ARMi software solutions
    • Email
Re: Please Translate
« Reply #4 on: March 11, 2009, 11:14:57 AM »
ok,
Having to reload the translation queue every time the server have to send him new page, where in the webhandler must I put the code?

ps: I use the F10 too but the problem is at first sight.

Alberto

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

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Please Translate
« Reply #5 on: March 11, 2009, 11:22:05 PM »
Hi Alberto,

Ok, I've made some changes to the Translation mechanism in NetTalk. (PR35) This should make it easier to integrate the translation
with different translation tools.

Before, I was making an explicit call to the built-in Translator class method. Now I am calling a method, called Translate, in the
WebHandler procedure. By default this just returns the text given to it, but you can embed code in here to call your favorite
translation mechanism.

What I would say is that you want to use a tool that supports multiple-languages-in-a-single-exe. I will liase with the translation
tool vendors so that they can add appropriate support if they wish to.

If you do need to do work on each thread, then I suggest adding a local variable to the web handler procedure. Then at the top of the
Translate method, if the variable is 0 you can do your priming work, and set the variable to 1. But if you can, you _really_ want to
avoid this. Remember that NetTalk starts a huge number of threads, so you'd be doing this work over, and over, again.

As you requested I have added translation calls to
menus
menu items
browse header tooltips (actually tips everywhere, browses, forms, buttons, Images, Hyperlinks and so on.)
browse 'No Records found'
browse delete conf q 'Are you sure you want to delete this record?'
browse 'Enter a search term in the locator'
form Tabs headings
form field drop extra possibilities
form field comments

If you need more let me know.

Cheers
Bruce

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Please Translate
« Reply #6 on: March 11, 2009, 11:49:12 PM »
FYI

If you use an alternate translation tool, then it is important to call the parent method. For example, to use the Clarion built-in runtime translator, the following code is generated.

    ReturnValue = Translator.TranslateString(p_String)
    ReturnValue = parent.Translate(ReturnValue,p_AllowHtml)
    Return ReturnValue

The bit in Blue is the bit you would change depending on the tool. However all 3 lines need to be embeded by you if you are using a tool other than the built in translator class. This is because the Parent call must be made, but with your "already translated" text. The parent method automatically makes sure the text is xHtml complaint (unless the p_allowHtml parameter is set to 1 in which case you need to make sure it is xHtml complaint.)

Cheers
Bruce

Alberto

  • Hero Member
  • *****
  • Posts: 1873
    • MSN Messenger - alberto-michelis@hotmail.com
    • View Profile
    • ARMi software solutions
    • Email
Re: Please Translate
« Reply #7 on: March 12, 2009, 01:50:49 AM »
GREAT, YOU ARE... GREATE!
THANKS

Regarding what to do in each thread...
Inicially I was thinking on read the appropiate language file each time NT starts a new thread to maintain the queue memory usage at minimum, but I think it wold take much time then...
How do you think if I load a queue like
  IdLanguage, TranslateFrom, translateToSPA, TransateToITA, TenslateToxxx, etc
  (IdLanguage may be a long and the strings of 256)
at program startup?, suppousing there could be 20 languages and 2000 texts to traslate...
-could it be very much memory consumer?
-could it be slow?

PS:Please release PR35 :-))

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

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Please Translate
« Reply #8 on: March 12, 2009, 06:28:42 AM »
Obviously storing it all in Ram will use up ram, but make things go quicker.
So it's up to you whether you read from the disk to save ram, or read from ram to gain speed.

It's gonna depend a lot on how much ram the server has available I suppose.

Personally I'd probably start by making it a file - then I can always change the file driver to be a memory file if
ram is available. Nothing in the app has to change - and you can easily flip between the two.

Cheers
Bruce

Alberto

  • Hero Member
  • *****
  • Posts: 1873
    • MSN Messenger - alberto-michelis@hotmail.com
    • View Profile
    • ARMi software solutions
    • Email
Re: Please Translate
« Reply #9 on: April 27, 2009, 04:21:49 AM »
Hi Bruce,
I´ve installed PR35 but do not find the Translate Method in the WebHandler proc.

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

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Please Translate
« Reply #10 on: April 27, 2009, 09:36:06 PM »
Hi Alberto,

um - well, it's there.
So make sure you did a case-insensitive search.
And check your \clarion6\libsrc\netweb.inc file (first line) to see if you've really got PR 35.

Cheers
Bruce



Alberto

  • Hero Member
  • *****
  • Posts: 1873
    • MSN Messenger - alberto-michelis@hotmail.com
    • View Profile
    • ARMi software solutions
    • Email
Re: Please Translate
« Reply #11 on: April 28, 2009, 02:08:31 AM »
Bruce,
I´m sure I have PR35.
Checked Netweb.inc and its there but it is not in the Webhandler embed button, so I cant add code.
Thanks
Alberto
-----------
Regards
Alberto

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Please Translate
« Reply #12 on: April 28, 2009, 02:28:50 AM »
Hi Alberto,

Close clarion - perhaps even reboot the machine.
It sounds like clarion was still open when you did the update so the classes have not refreshed. It should be closed during an install - if you have old processes left behind in task manager then rebooting will clear them out - or use Task Manager to clear them out.

Also make sure NetWeb.inc is in \clarion6\libsrc, not \clarion6\3rdparty\libsrc and not in your app folder (or anywhere else.)

Cheers
Bruce

Alberto

  • Hero Member
  • *****
  • Posts: 1873
    • MSN Messenger - alberto-michelis@hotmail.com
    • View Profile
    • ARMi software solutions
    • Email
Re: Please Translate
« Reply #13 on: April 28, 2009, 02:37:19 AM »
Thanks Bruce, refresh the classes did the trick. I can see the Translate method now.
-----------
Regards
Alberto

Alberto

  • Hero Member
  • *****
  • Posts: 1873
    • MSN Messenger - alberto-michelis@hotmail.com
    • View Profile
    • ARMi software solutions
    • Email
Re: Please Translate
« Reply #14 on: April 28, 2009, 04:19:35 AM »
Bruce,
Is there any chance for you to add a check to the Lookup Settings tab of a Drop field to translate the options loaded?
I know I can omit your code and add mine but I think it would be helpfull for others.
Thanks
Alberto
-----------
Regards
Alberto