[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[bug #56774] support Rust programming language
From: |
Kévin |
Subject: |
[bug #56774] support Rust programming language |
Date: |
Sat, 1 Jan 2022 06:51:53 -0500 (EST) |
User-agent: |
Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:95.0) Gecko/20100101 Firefox/95.0 |
Follow-up Comment #3, bug #56774 (project gettext):
I would like to work on that feature.
I looked around the code a bit and basically we need "format-rust.c" for
_msgfmt_ and "x-rust.c" for _xgettext_, right?
Here are Rust i18n libraries compatible with gettext:
* gettext <https://crates.io/crates/gettext>: emulates _gettext_. It provides
_gettext_, _ngettext_, _pgettext_ and _npgettext_ methods on a _Catalog_
object with the same API as the corresponding _gettext_ functions. It doesn't
support Rust string formatting.
* gettext-rs <https://crates.io/crates/gettext-rs>: uses _gettext_. It
provides _gettext_, _ngettext_, _pgettext_, _npgettext_, _dcgettext_,
_dcngettext_, _dgettext_, _dngettext_ methods with the same API as the
corresponding _gettext_ functions. It provides macros with the same names and
the macro invocation operator '!' that allow Rust string formatting while
keeping a regular function API. It doesn't support all of Rust string format
yet.
* tr <https://crates.io/crates/tr>: uses either of the two previous libraries.
It provides a single _tr!_ macro that allows Rust string formatting but has
its own API to support the same features as _gettext_, _ngettext_, _pgettext_,
_npgettext_. It doesn't support all of Rust string format yet. It provides its
own extractor called xtr <https://crates.io/crates/xtr>.
An extractor using keywords for _gettext_ functions names and macro names
should work with the two first libraries. A parser for Rust string format
should work with all three libraries.
GNOME Rust apps usually use the _gettext-rs_ library.
_______________________________________________________
Reply to this item at:
<https://savannah.gnu.org/bugs/?56774>
_______________________________________________
Message posté via Savannah
https://savannah.gnu.org/
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [bug #56774] support Rust programming language,
Kévin <=