ZOS don't add functions except at API bump, so you'll need to do this or wait orsinium, and they'll MAYBE do it.
Lua Code:
local raceTable = {
["Breton"] = 1,
["Bretone"] = 1, --de, male
["Bretonin"] = 1, --de, female
["Bréton"] = 1, --fr, male
["Brétonne"] = 1, --fr, female
["Orc"] = 2,
["Ork"] = 2, --de, male/female
["Orque"] = 2, --fr, male/female
["Redguard"] = 3,
["Rothwardone"] = 3, --de, male
["Rothwardonin"] = 3, --de, female
["Rougegarde"] = 3, --fr, male/female
["High Elf"] = 4,
["Hochelf"] = 4, --de, male
["Hochelfin"] = 4, --de, female
["Haut-Elfe"] = 4, --fr, male
["Haute-Elfe"] = 4, --fr, female
["Wood Elf"] = 5,
["Waldelf"] = 5, --de, male
["Waldelfin"] = 5, --de, female
["Elfe des bois"] = 5, --fr, male/female
["Khajiit"] = 6,
["Argonian"] = 7,
["Argonier"] = 7, --de, male
["Argonierin"] = 7, --de, female
["Argonien"] = 7, --fr, male
["Argonienne"] = 7, --fr, female
["Dark Elf"] = 8,
["Dunkelelf"] = 8, --de, male
["Dunkelelfin"] = 8, --de, female
["Elfe Noir"] = 8, --fr, male
["Elfe Noire"] = 8, --fr, female
["Nord"] = 9,
["Nordique"] = 9, --fr, male/female
["Imperial"] = 10,
["Kaiserlicher"] = 10, --de, male
["Kaiserliche"] = 10, --de, female
["Impérial"] = 10, --fr, male
["Impériale"] = 10, --fr, female
}
function GetUnitRaceId(unitTag)
if unitTag then return raceTable[zo_strformat(SI_RACE_NAME, GetUnitName(unitTag))] end
return nil
end