implement locale function