added method to get the current locale
added formControlErrors function