rustunit / bevy_device_lang

Cross-platform way to query device language setting
https://crates.io/crates/bevy_device_lang
Apache License 2.0
12 stars 1 forks source link

Mac crash #3

Open UkoeHB opened 1 month ago

UkoeHB commented 1 month ago

Crashes on Mac with

thread 'main' panicked at .../bevy_device_lang-0.4.0/src/apple.rs:10:35:
invalid message send to -[__NSArrayM objectAtIndex:]: expected argument at index 0 to have type code 'Q', but found 'q'

Great little crate btw, thanks for putting this together.

extrawurst commented 1 month ago

very interersting. what language settings do you use?

UkoeHB commented 1 month ago

I'm on a MacBook Pro M1 v12.5.1, with English (US) as my primary language.

extrawurst commented 1 month ago

Hm I am confused why this works on my MacBook m1 with primary English 😂

UkoeHB commented 1 month ago

Maybe can use https://developer.apple.com/documentation/foundation/nsarray/1412852-firstobject instead and then cast the Any to string.

It could also be a bug with icrate::Foundation::NSString;, some kind of versioning mismatch.

UkoeHB commented 1 month ago

I will fork this later today and troubleshoot.

UkoeHB commented 1 month ago

Hey I didn't end up figuring out the problem. While researching how other crates do it, I found sys-locale, which is a more mature version of this crate that works on my system, so I decided to use that one in my project.