But that gets the the LCID. What I really need is the two-letter iso name (like 'en', 'fr', etc)
You can create a JS object and fetch the values using the LCID:
The mapping comes from this page: National Language Support (NLS) API Reference (Windows 7)
Practically inside the library there is JSON object with the values and two methods to get them.
The Culture name is the full one (for example en-US for 1033) you can slice the string if you need only the first two letters.
You can find more information on my blog:
In SharePoint 2013 JSOM API you could utilize SP.ServerSettings.getGlobalInstalledLanguages Method to retrieve all the installed languages, like this:
end then find the corresponding language by