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

[Help] Translation Key Not Found

1621340063
Finderski
Pro
Sheet Author
Compendium Curator
I'm working the Sandbox, I've uploaded (multiple times) the translation.json file.  Yet, a sheet worker keeps returning this error message: Here's the sheet worker: const moneylist = ["money","gold","silver","electrum","copper"]; const moneylabels = ["money","moneyone","moneytwo","moneythree","moneyfour"]; moneylabels.forEach(moneyLabel => { on("sheet:opened", function() { log("Money","Setting up money","darkgreen"); getAttrs([`${moneyLabel}name`], function(v) { if (v[`${moneyLabel}name`] === "") { //label is empty, so fill it const labelIndex = moneylabels.lastIndexOf(moneyLabel); const moneyType = moneylist[labelIndex]; const typeOfMoney = getTranslationByKey(`${moneyType}`); log("Money Type",typeOfMoney,"darkgreen"); const setmoney = {}; setmoney[`${moneyLabel}name`] = typeOfMoney; setAttrs(setmoney); } else { log("Money","Already set","darkgreen"); } }); }); }); I know it works, because one of the labels is returned properly, but the ones for gold, silver, etc. it says it can't find. Is there a way for me to check the translation.json object in the developer tools in Chrome?
Hi Finderski, My experience is that the sandbox sometimes silently rejects a translation file if there are errors in the JSON. You might want to try running it through a linter and seeing if there are any issues with the file. Otherwise, feel free to reach out with the translation file and I will see if I can reproduce the results. Best, Nic
1621532623
Finderski
Pro
Sheet Author
Compendium Curator
It magically started working. I don't know if there was just a delay in the file actually uploading or something, but...I started working on something else and this started working with me making no changes to the sheet worker NOR the translation.json file.
That's mightily weird. Something else that I've found that can be helpful with the Sheet Sandbox, particularly when bad smells are hanging around, is to refresh my browser and clear the cache at the same time (you can do this with CTRL + F5 on Firefox or Chrome). This can sometimes resolve issues like this. Glad to hear its working, though!