A mobile interface for the OpenSprinkler irrigation device. Designed to allow manual control, program management (preview, add, edit, and delete), initiation of a run-once program, viewing graphical and tabulated representations of log data, viewing device status, adjusting rain delay, and changing of OpenSprinkler settings.
A number of text strings do not translate and I believe the problem may be the following:
A number of functions are instantiated as variables:
getPrograms()
getManual()
showAbout()
getRunonce()
getPreview()
getLogs()
showStart()
showSites()
showHome()
These functions are instantiated as variables/objects while the language variable is still undefined. updateLang() is only called in initApp() after all the above functions have been instantiated.
It seems that the text strings that are instantiated within the body of the functions only get called once when the function object is instantiated. Because the language variable is still undefined at that time, any translation call returns the default English version. When methods are called thereafter, those text strings are not updated again.
I have a very rudimentary understanding of javascript so I don't know if there is any easy or elegant way to fix this other than to deliberatly update those text string variables everytime the respective methods are called.
A number of text strings do not translate and I believe the problem may be the following:
A number of functions are instantiated as variables:
These functions are instantiated as variables/objects while the language variable is still undefined. updateLang() is only called in initApp() after all the above functions have been instantiated.
It seems that the text strings that are instantiated within the body of the functions only get called once when the function object is instantiated. Because the language variable is still undefined at that time, any translation call returns the default English version. When methods are called thereafter, those text strings are not updated again.
I have a very rudimentary understanding of javascript so I don't know if there is any easy or elegant way to fix this other than to deliberatly update those text string variables everytime the respective methods are called.