Roll20 uses cookies to improve your experience on our site. Cookies enable you to enjoy certain features, social sharing functionality, and tailor message and display ads to your interests on our site and others. They also help us understand how our site is being used. By continuing to use our site, you consent to our use of cookies. Update your cookie preferences .
×
Create a free account

Translation.json in the sheet sandbox is driving me mad with it's lack of validation errors

1651666322
Nick Turner
Plus
Marketplace Creator
I may be missing something obvious (I really hope so), but from what I can tell, there is precisely zero feedback on the acceptance of a new "Translation.json" file by the sheet sandbox code. As far as I can tell, my json is valid and correct, with no errors being picked up by any linter I've tried, but clearly something isn't being accepted by the Roll20 backend. The problem is that there is no indication WHY or even IF the upload failed, all that happens is that it continues to use the last-good version. Is there any way I'm missing to get better output from the system, or are there any specific gotcha's why otherwise valid JSON is being rejected?
1651667185

Edited 1651667231
Nick Turner
Plus
Marketplace Creator
I've just spotted that there is an HTML element just below the upload buttons, that can be turned on to say that there was an error... but it's not used even if I upload an obviously broken file, and only visible once manually un-hidden via the inspector.
1651668265
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
Where is it using the old translation values? Roll template messages already sent to chat will not be updated when you change the translation file. If you are using translations in your sheetworkers via getTranslationByKey(), there's a bug where they won't update until you refresh the sandbox page. If it's just in the generic translations on your sheet, can you share your translation file and a bit of the html that is t updating?
1651673191
Nick Turner
Plus
Marketplace Creator
Scott C. said: Roll template messages already sent to chat will not be updated when you change the translation file. That makes sense, I wouldn't have expected them to, but good to know for sure, thanks. Scott C.  said: If you are using translations in your sheetworkers via getTranslationByKey(), there's a bug where they won't update until you refresh the sandbox page. That's the one that was giving me trouble today, thank you! It's frustrating, but it's helpful to know that it's a known bug, and not too awful a work-round. But I still find it weird that there's no error reporting on other upload errors. If you upload something deliberately malformed (missing commas, lack of closing brace, etc), it doesn't complain, it just keeps on using the last-good version of the file as if you hadn't uploaded anything at all. It's particularly galling given that there is an error message sitting there in the HTML, it just doesn't ever seem to get shown, leaving you sitting there wondering what's going on. Also in the interest of helping others who see this post, one gotcha that I found last week, is that there definitely needs to be a newline after the closing brace at the end of the file, which doesn't get picked up by all linters.
1651682006
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
Nick Turner said: Also in the interest of helping others who see this post, one gotcha that I found last week, is that there definitely needs to be a newline after the closing brace at the end of the file, which doesn't get picked up by all linters. Huh, I did not know that! Thanks for finding that!