Localize scripts only when needed Closes #4158
Fix state display Closes #5587