NetTalk Central

Author Topic: How to translate Alert Message  (Read 2720 times)

Alberto

  • Hero Member
  • *****
  • Posts: 1846
    • MSN Messenger - alberto-michelis@hotmail.com
    • View Profile
    • ARMi software solutions
    • Email
How to translate Alert Message
« on: May 29, 2017, 10:02:56 AM »
How to translate "Alert" and "Required" from the alert message?
See image
-----------
Regards
Alberto

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11183
    • View Profile
Re: How to translate Alert Message
« Reply #1 on: May 31, 2017, 04:43:21 AM »
All the validation text passes through the WebServer Translate method.
(WebServer, not WebHandler here).

  s_web._SitesQueue.defaults.InsertPromptText = s_web.Translate('Insert')
  s_web._SitesQueue.defaults.CopyPromptText = s_web.Translate('Copy')
  s_web._SitesQueue.defaults.ChangePromptText = s_web.Translate('Change')
  s_web._SitesQueue.defaults.ViewPromptText   = s_web.Translate('View')
  s_web._SitesQueue.defaults.DeletePromptText = s_web.Translate('Delete')
  s_web._SitesQueue.defaults.RequiredText = s_web.Translate('Required')
  s_web._SitesQueue.defaults.NumericText = s_web.Translate('A Number')
  s_web._SitesQueue.defaults.MoreThanText = s_web.Translate('More than or equal to')
  s_web._SitesQueue.defaults.LessThanText = s_web.Translate('Less than or equal to')
  s_web._SitesQueue.defaults.NotZeroText = s_web.Translate('Must not be Zero or Blank')
  s_web._SitesQueue.defaults.OneOfText = s_web.Translate('Must be one of')
  s_web._SitesQueue.defaults.InListText = s_web.Translate('Must be one of')
  s_web._SitesQueue.defaults.InFileText = s_web.Translate('Must be in table')
  s_web._SitesQueue.defaults.DuplicateText = s_web.Translate('Creates Duplicate Record on')
  s_web._SitesQueue.defaults.RestrictText = s_web.Translate('Unable to Delete, Child records exist in table')

'Alert' flows through the WebHandler, Translate method.

cheers
Bruce

Alberto

  • Hero Member
  • *****
  • Posts: 1846
    • MSN Messenger - alberto-michelis@hotmail.com
    • View Profile
    • ARMi software solutions
    • Email
Re: How to translate Alert Message
« Reply #2 on: May 31, 2017, 12:25:43 PM »
This is a big problem I think...

1)
From the s_web translate I have no access to the p_web.gsv(...)
I know the user language when the user logs in and I save it in p_web.SSV()
Then How can I Translate to the user language?

2)
I try to use a similar translate code then in WinHandler fixng the lenguage and then the links does not use spanish caracters, see attached image.

Thanks
« Last Edit: May 31, 2017, 12:44:04 PM by michelis »
-----------
Regards
Alberto

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11183
    • View Profile
Re: How to translate Alert Message
« Reply #3 on: June 08, 2017, 10:27:45 PM »
All the "eventual" text flows through the WebHandler Translate method. So simple text like the buttons etc can just be translated as normal.

Some of the text constructs "complex" messages. For example;

'More than or equal to'
'Less than or equal to'

These can be manually assigned in ProcessLink, and therefore will flow through the .Translate method as well.
For example;

In ProcessLink

self.site.MoreThanText = self.Translate(self.site.MoreThanText)

Cheers
Bruce