Why do I get this message every time I open the terminal?
Your zsh environment isn't finding locale in its PATH.
Either call locale by its full path:
if [[ &quot;$(/usr/bin/locale LC_CTYPE)&quot; == &quot;UTF-8&quot; ]]; then

..or update your $PATH to make sure that /usr/bin is included.