zsviczian / obsidian-excalidraw-plugin

A plugin to edit and view Excalidraw drawings in Obsidian
4.3k stars 233 forks source link

BUG: Opening Excalidraw ruins Obsidian layout #1364

Open beh82 opened 1 year ago

beh82 commented 1 year ago

In short, my Excalidraw language is set to Persian (which I don't want it to be) and it ruins my Obsidian layout. When I open a Excalidraw file, my Obsidian layout changes and elements get flipped horizontally (left to right) which not only changes my obsidian layout (even after closing the Excalidraw file) it ruins it because a lot of the UI elements are not compatible with right-alignment.

Before opening an Excalidraw file: image

After opening an Excalidraw file: image (Even the close-maximize-minimize buttons are flipped.)

Before: image

After: image

Before: image

After: image

The problem persists even after closing the Excalidraw file tab. I have to close Obsidian and open it again to revert it back to normal.

Some of the Excalidraw menus and explanations are also in Persian (A right-to-left language), which I think is the source of the problem. I never set the language to be Persian, my Windows and my Obsidian are both in English. I don't want the menus and stuff to be Persian, I looked through all the setting and I couldn't find any setting related to changing the Excalidraw language back to English (maybe I've missed it in which case, oops. but I did search a lot). The only things that I have set to Persian, are my windows calendar, my Obsidian calendar plugin (to match the days of the week in my country), and I have Persian as a keyboard input language. I don't even think I have ever used Persian in any of my notes.

I'm not sure how to reproduce this effect, but here's all the information I think might/should be relevant:

SYSTEM INFO: Obsidian version: v1.4.14 Installer version: v1.3.7 Operating system: Windows 10 Pro for Workstations 10.0.22000 Login status: not logged in Insider build toggle: off Live preview: on Legacy editor: off Base theme: dark Community theme: none Snippets enabled: 0 Restricted mode: off Plugins installed: 4 Plugins enabled: 4 1: Calendar v1.5.10 2: Hyphenation v0.0.3 3: Remotely Save v0.3.25 4: Excalidraw v1.9.23

Thank you for your time reading all of this.

zsviczian commented 1 year ago

I am assuming Calendar "override locale" is the root of the problem. Looking into the sourcecode for calendar I can see Liam is changing the locale settings: https://github.com/liamcain/obsidian-calendar-ui/blob/c275987d032377bb141747da0f9db2c5cde2df03/src/localization.ts#L85-L109

I made a small change to Excalidraw in 1.9.25 - let's see if it resolves your issue. Otherwise, I recommend trying https://github.com/TfTHacker/obsidian42-jump-to-date instead of Calendar.

JDuchniewicz commented 10 months ago

Same here, moreover I have some options being rendered in English and some in Polish, even though the only possible place the Polish locale is present is in the Calendar to set the timezone. Is there no alternative? I would rather refrain from changing the Calendar plugin.

zsviczian commented 10 months ago

To the best of my knowledge, this should be solved/fixed in the Calendar plugin. I've stopped using the calendar plugin 2 years ago. I prefer @TfTHacker's Jump to Date plugin.

Try raising the issue with Liam on OMG and by opening an issue for the calendar plugin on GitHub.