-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
danielrainer
wants to merge
5
commits into
fish-shell:master
Choose a base branch
from
danielrainer:xgettext_more_extraction
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Extract signal and debug option descriptions #11543
danielrainer
wants to merge
5
commits into
fish-shell:master
from
danielrainer:xgettext_more_extraction
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
09c1fe3
to
0889012
Compare
krobelus
reviewed
May 31, 2025
@@ -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" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(unrelated) "…aufforderung"?
krobelus
approved these changes
May 31, 2025
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. |
Done. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Document call sites of
wgettext_str
to indicate where xgettext extractionhappens.
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).