convert error messages to use sprintf and gettext