I’ll second the call for more code, as what you’ve provided isn’t enough to make a solid recommendation on. But I’d also check the value of ‘language’ that you’re supplying. For example, if the language is being returned by the call to system.getPreference(), then it could be returning “en-US”, which isn’t accounted for in your translations table, and therefore calling translations["StartButton"][language] would return nil.
I suspect that there’s either a typo at play, or that your language variable isn’t matching one of your pre-defined options. But again, without more code it’s impossible to say for sure.
You could also set up a default language (I’d assume English) by modifying your setting of the language variable thusly:
local language = userDefinedLanguage or system.getPreference("ui", "language") if not translations["Hello"][language] then language = "en" end
Or perhaps more appropriately, define your available languages within your translations module:
translations.languages = {"en", "fr", "de", "es", "it"}
And then poll against that master list to determine if a default should be applied:
local language = userDefinedLanguage or system.getPreference("ui", "language") if not translations.languages[language] then language = "en" end
Good luck - and share more code so we can help you truly get to the bottom of this! 