8000 Extract signal and debug option descriptions by danielrainer · Pull Request #11543 · fish-shell/fish-shell · GitHub
[go: up one dir, main page]

Skip to content

Extract signal and debug option descriptions #11543

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

danielrainer
Copy link

Document call sites of wgettext_str to indicate where xgettext extraction
happens.

Update the po files. Signal descriptions already had translations in some
languages, which are restored.

This is on top of #11536, to address the issue described in #11536 (comment).

Daniel Rainer added 5 commits May 29, 2025 22:46
This is done in preparation for a proc macro which extracts strings which are
passed to `gettext`. Because the `concat!` macro would get expanded after the
proc macro, the proc macro would still see the `concat!`, which it cannot
handle.
This is a replacement for the `cargo-expand`-based extraction.

When building with the `GETTEXT_EXTRACTION_DIR` environment variable set, the
`gettext_extract` proc macro will write the messages passed to the `wgettext!`
macro to a file in the directory specified by the variable.

The macro can handle string literals, which are written to the `literals` file
enclosed in double quotes and with a trailing newline.
Passing the name of string constants is also supported, but the proc macro is
unable to obtain the corresponding literal, so instead it writes the name of the
constant into the `consts` file. Actually extracting the string is then done in
`build_tools/fish_xgettext.fish`, which uses the identifiers from `consts` to
search the source files for the corresponding definitions.
This is the result of running the `update_translations.fish` script using the
new proc_macro extraction. It finds 10 additional messages compared to the
cargo-expand based approach.

Messages IDs corresponding to paths are removed. The do not have translations in
any language and translating paths would not make sense. I have not investigated
how they made it into the po files in the first place.

The only msgid which is removed that had translations is "Could not show help
message". This literal corresponds to the `HELP_ERR` constant, which is only
used in `eprintf!` calls, so they are never translated.
This is no longer needed due to the switch to our extraction macro.
Document call sites of `wgettext_str` to indicate where xgettext extraction
happens.

Update the po files. Signal descriptions already had translations in some
languages, which are restored.
@danielrainer danielrainer force-pushed the xgettext_more_extraction branch from 09c1fe3 to 0889012 Compare May 30, 2025 17:26
@@ -1215,6 +1337,12 @@ msgstr "Bitte setzen sie $%ls auf ein Verzeichnis in das sie schreiben können."
msgid "Please set the %ls or HOME environment variable before starting fish."
msgstr "Bitte setzen sie %ls oder die HOME Umgebungsvariable bevor sie fish starten."

msgid "Polite quit request"
msgstr "Höfliche Beendigungsanforderung"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(unrelated) "…aufforderung"?

@danielrainer
Copy link
Author

Aside from added comments, this is obsoleted by #11547. The comments addition can be added on top of that later. Don't merge this for now.

@danielrainer danielrainer marked this pull request as draft June 2, 2025 01:26
@danielrainer
Copy link
Author

The comments addition can be added on top of that later.

Done.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0