Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Text translations are called before language is initialized #125

Open
DMT07 opened this issue Sep 12, 2021 · 1 comment
Open

Text translations are called before language is initialized #125

DMT07 opened this issue Sep 12, 2021 · 1 comment

Comments

@DMT07
Copy link
Contributor

DMT07 commented Sep 12, 2021

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.

@salbahra
Copy link
Member

Thank you for this report and apologizes for the delay!

I'll see if I can take a look at this issue soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants