GNU gettext - Bugs: bug #56774, support Rust programming language
You are not allowed to post comments on this tracker with your current authentication level.
bug #56774: support Rust programming language
Submitter: | Bruno Haible <haible> | ||
Submitted: | Sun 18 Aug 2019 07:38:25 PM UTC | ||
Votes: | 100 | ||
Category: | Other | Severity: | 4 - Important |
Item Group: | None | Status: | None |
Privacy: | Public | Assigned to: | None |
Open/Closed: | Open |
Thu 31 Mar 2022 07:27:52 PM UTC, comment #4: |
Kévin <zecakeh> |
Sat 01 Jan 2022 11:51:53 AM UTC, comment #3: 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:
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. |
Kévin <zecakeh> |
Wed 29 Dec 2021 10:45:20 AM UTC, comment #2: For reference, the gettext-rs crate allows us to use xgettext to translate strings.
If we only use functions, POT generation works well with Rust, detecting it like the C language. We can apply Rust string formatting at runtime by creating other functions around gettext-rs, and use the keyword option to make xgettext detect those new functions.
However we lose compile-time string formatting validation. To solve that, we need to use macros whose name always ends with a !, which makes them incompatible with the keyword option. |
Kévin <zecakeh> |
Wed 29 Dec 2021 10:26:31 AM UTC, comment #1: Also note this discussion about supporting Rust in GNOME i18n.
|
Claude Paroz <claudep> |
Sun 18 Aug 2019 07:38:25 PM UTC, original submission:
Many applications are being written in Rust, such as web browsers (Firefox) and terminal emulators (alacritty).
|
Bruno Haible <haible>![]() |
Depends on the following items: None found
Items that depend on this one: None found
There are 100 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.
Although I sent it a couple of months ago, to make sure that my work is not lost, I'm posting it in the bug tracker so it's attached to the proper bug.
These are patches that add Rust support to gettext. They were deemed too big to be posted in the mailing list so here's a link to them:
<https://gitlab.gnome.org/-/snippets/2934>
(file #53025, file #53026)