NetTalk Central
NetTalk Web Server => Web Server - Ask For Help => Topic started by: Alberto 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
-
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
-
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
-
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
-
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
-
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
-
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
-
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
-
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
-
Hi Bruce,
I´ve installed PR35 but do not find the Translate Method in the WebHandler proc.
Thanks
Alberto
-
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
-
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
-
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
-
Thanks Bruce, refresh the classes did the trick. I can see the Translate method now.
-
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
-
Bruce,
Main menu options are not been translated...
p_web._jsok('Config')
Alberto
-
Tranlate is working GREAT!
Please, it would be more consistent if you can add the following:
>>>The Buttons text (buttons tab of the netweb object)
The template are still translating with
s_web._SitesQueue.Defaults.UploadButton.TextValue = Translator.TranslateString('Upload')
s_web._SitesQueue.Defaults.UploadButton.ToolTip = 'Click here to Upload the file'
see that the Tooltip is not translated
I´ve tried typing p_web.Translate('Upload') but I get a Unknown function label
>>>The Locate text (Advance tab) ...
I tried typing p_web.Translate('Locate') but I get a Unknown function label
Why it is not in the Button tab?
Note: Nevertheless the button Tooltips are been translated, may be in the CreateButton proc. May be the button text could be translated in the same proc.
>>>The Text of a Display field in a form
>>>The options of a radio field in a form
>>>Main menu options are not been translated... (Ex p_web._jsok('Config'))
And ... Is there any chance for you to add a check to the Lookup Settings tab of a Drop field to translate the options loaded from a file?
I know I can omit your code and add mine but I think it would be helpfull for others.
Thanks
Alberto