Koka / gettext-rs

GNU Gettext FFI binding for Rust
51 stars 25 forks source link

Add `getters::getlocale` #104

Open timotheos-firestone opened 1 year ago

timotheos-firestone commented 1 year ago

Add a way to get the current active locale by passing in a null pointer to the C setlocale function, which is documented to be the way to query the locale; without this, there is no way for users of this library to query the current locale.

timotheos-firestone commented 1 year ago

I added this functionality because it is useful, at least, for debugging; for example, an issue I am having with setlocale() :)

Minoru commented 1 year ago

BTW you can ignore the CI failure for musl. I am meaning to fix it, but haven't yet figured out how (#99).

Minoru commented 1 year ago

Hey @timotheos-firestone, gentle ping ;) I haven't done anything about the musl CI yet, but this PR doesn't depend on musl, so it can be merged regardless. Would you like to finish this?

piegamesde commented 1 year ago

I might be in the mood of taking this over. Would you mind if I change the return type of setlocale to Result<(), ()>?

I can add tests, just need some guidance as to what needs to be done