NetTalk Central

NetTalk Web Server => Web Server - Ask For Help => Topic started by: Niels Larsen on April 01, 2018, 04:31:38 AM

Title: Multi Language APP
Post by: Niels Larsen on April 01, 2018, 04:31:38 AM
Hi

I'm making a multi language APP. Therefore I need to translate buttons and prompts at runtime. No problem on Forms and menus, but I can't figure out where/how to do it in a Browse.
Any ideas?

Regards Niels
Title: Re: Multi Language APP
Post by: peterH on April 02, 2018, 01:39:12 AM
Hi Niels,

The Translate Method in the Web Handler is supposed to catch all strings. Is this where you try it? And what exactly is it you want to translate in a Browse Procedure?

Peter
Title: Re: Multi Language APP
Post by: Niels Larsen on April 08, 2018, 11:49:43 PM
Hi Peter

I already use the Translate Method in the webhandler. But my customer would like the buttons (First, Previous, Next, Last, Insert) to be translated individually by each browse.

Regards Niels
Title: Re: Multi Language APP
Post by: rainerwallenius on April 09, 2018, 01:20:46 AM
Hi Niels

I have added my own translation code in webhandler
Like
    if ReturnValue = 'Yes' then ReturnValue = 'Ja'.
    if ReturnValue = 'No' then ReturnValue = 'Nej'.

Default language is swedish

After that I run all strings through my own translate-function

ReturnValue = Mytranslate(ReturnValue,self.gsv('language'))

The function reads a translation-table keyed on the deafult language and returns the calue based on the sessionvalue on language

This takes care of all strings.

:: rainer
Title: Re: Multi Language APP
Post by: Bruce on April 09, 2018, 10:31:30 PM
Hi Niels,

can you expand on this a bit please;

>> I already use the Translate Method in the webhandler. But my customer would like the buttons (First, Previous, Next, Last, Insert) to be translated individually by each browse.

What do you mean by the word "individually" ?

Cheers
Bruce
Title: Re: Multi Language APP
Post by: Niels Larsen on April 12, 2018, 04:11:17 AM
Hi Bruce

My customer would like to have an insert button named "New Customer" on the customer Browse and "New Item" on the Item Browse.
Makes sense?

Ragards Niels
Title: Re: Multi Language APP
Post by: Bruce on April 12, 2018, 06:12:22 AM
sure you can do this.
you're gonna embed in the GenerateUpdateButtonsAbove and GenerateUpdateButtonsBelow routines.
You change the text the same way you change the SaveButtonText on a login screen.


 p_web.site.InsertButton.TextValue = 'New Customer'

Cheers
Bruce

Title: Re: Multi Language APP
Post by: Niels Larsen on April 13, 2018, 03:53:39 AM
Thanks.
I'll try.