- updated size checking function to do a json_encode before trying to count the characters in a localized alert