So I just discovered you can retrieve the language as it’s set in obsidian with this:
const lang = window.localStorage.getItem('language');
This will return one of these language codes:
en: "English",
zh: "简体中文",
"zh-TW": "繁體中文",
ru: "Pусский",
ko: "한국어",
it: "Italiano",
id: "Bahasa Indonesia",
ro: "Română",
"pt-BR": "Portugues do Brasil",
cz: "čeština",
de: "Deutsch",
es: "Español",
fr: "Français",
no: "Norsk",
pl: "język polski",
pt: "Português",
ja: "日本語",
da: "Dansk",
uk: "Український",
sq: "Shqip",
tr: "Türkçe (kısmi)",
hi: "हिन्दी (आंशिक)",
nl: "Nederlands (gedeeltelijk)",
ar: "العربية (جزئي)"
if lang is null, then the language is English.