Fix locale guessing from grammar