Canvas UI stays in English for Obsidian pt-BR users — LOCALE is lowercased, but obsidianToExcalidrawMap key is "pt-BR"
Current behavior
With Obsidian set to Brazilian Portuguese (pt-BR), the embedded Excalidraw canvas UI (style panel, main menu, tooltips, Library dialog) renders entirely in English, even though the bundled Excalidraw fork ships a complete pt-BR dictionary (96% per the bundled coverage stats).
Steps to reproduce
- Set Obsidian language to "Português (Brasil)"
- Open any Excalidraw drawing
- Canvas UI (main menu, style panel, tooltips) is in English
Environment: Windows 11, Obsidian 1.13.7, Excalidraw plugin 2.27.3
Responsible code
src/constants/constants.ts:
export const LOCALE = getLanguage().toLowerCase(); // "pt-BR" -> "pt-br"
export const obsidianToExcalidrawMap = {
...
pt: "pt-PT",
"pt-BR": "pt-BR", // key keeps original casing
...
};The langCode prop is then resolved with:
langCode: obsidianToExcalidrawMap[e.plugin.locale] ?? "en-EN"Lookup result
obsidianToExcalidrawMap["pt-br"] // -> undefined (only "pt-BR" exists)
// falls back to "en-EN" // -> English UI"pt-BR" is the only mixed-case key in the map, so pt-BR is the only Obsidian locale affected (the lowercase "fi-fi" and "zh-tw" entries appear to have been added earlier to fix this same class of mismatch).
Proposed minimal fix
Add one entry (consistent with the existing lowercase fi-fi/zh-tw precedent):
"pt-br": "pt-BR",Alternatively, normalize the lookup itself if you prefer a general solution.
Minor aside: the fallback literal "en-EN" is not a valid Excalidraw locale (en-US is); worth aligning while touching this line.
Expected impact
The bundled Excalidraw fork already contains the full upstream pt-BR translation. With the mapping fixed, the entire canvas UI renders in pt-BR for all pt-BR users with no translation work required. Plugin-owned strings (commands, settings) are unaffected — that is a separate topic (empty pt-br.ts stub).
Source: zsviczian/obsidian-excalidraw-plugin