Thanks for all your suggestions.
Have you seen recent threads?
Yes, this was my fist step, as always :)
Give the reference to language did you add or remove a language? Perhaps do that again after the upgrade.
that does look like the language setting and you said you doubled checked it...
I've never touched language settings and it was only with this upgrade that problems were created.
that will rule out the startup tiddlers if you have any being the issue
Startup tiddlers were not the issue, but thanks to your hint I had a look at my startup actions, tagged $:/tags/StartupAction, one by one and have pinpointed the issue to the reveal widget(!)
So, basically the issue was that I had a few nested macros embedded in a reveal widget in a tiddler tagged $:/tags/StartupAction whose purpose was to evaluate whether today falls within a predefined time range.
In short, when the reveal widget evaluated to 'true' and the macro embedded therein could fire on startup (as it was a $:/tags/StartupAction tiddler) then no problems were created. However, when the reveal widget evaluated to 'false', TW returned the (seemingly random) $tw.language is undefined error on startup. I have no idea how and why this should be related.
I've seen that the reveal widget was updated in 5.1.20. Although I have no idea how the updated reveal widget evaluating to 'false' could be related to a 'language error' when triggered as a startup action, this is what I I've pinpointed as the problem here.
So, I'm not sure if this should be reported as a potential bug as it appears to be an edge case. I will do look for patterns in my reveal widgets and will report back in case of further issues.
Anyway, problem solved. Thanks again Tony & A Gloom for your suggestions!
Best regards,
Hubert