hfiguiere / i18n-format

A simple Rust proc-macro to allow gettext! and xgettext to work together
2 stars 0 forks source link

gettext-rs has dropped macro support #1

Open bragefuglseth opened 2 months ago

bragefuglseth commented 2 months ago

As of today, when updating gettext-rs to 0.7.1 in my app, it won't build anymore.

error: cannot find macro `gettext` in this scope
   --> src/widgets/results_view.rs:129:37
    |
129 |                     let formatted = i18n_fmt! { i18n_fmt("{}%", display_accuracy) };
    |                                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
note: `gettext` is imported here, but it is a function, not a macro
   --> src/widgets/results_view.rs:129:37
    |
129 |                     let formatted = i18n_fmt! { i18n_fmt("{}%", display_accuracy) };
    |                                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    = note: this error originates in the macro `i18n_fmt` (in Nightly builds, run with -Z macro-backtrace for more info)

Seems like this commit in gettext-rs removed the macros from the library, and the commit was only shipped in the 0.7.1 release a couple of weeks ago.

Is it technically possible to change i18n_fmt to work without depending on the gettext-rs macros? I can look into it, but I have no idea if it would be worth it or not. For now I've downgraded to the 0.7.0 release.

hfiguiere commented 2 months ago

oh so they broke API in a bug fix release?

bragefuglseth commented 2 months ago

I'm confused by this as well. Given the age of the commit, it seems like this change was supposed to ship a while ago, and they've only "accidentally" kept it until now.

I can't find a proper announcement of this, though.