use a jQuery function that checks the locale and update the attributes instead of duplicating the code twice