Skip to content
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

Support no obsolete option #65

Merged
merged 5 commits into from Apr 19, 2024

Conversation

jdknight
Copy link
Contributor

The following series of commits aims to bring support for a --no-obsolete option for a sphinx-intl update request. This option allows a caller to automatically drop/ignore obsolete messages processed from any updated documents (mimicking a --no-obsolete option found in msgattrib).

This commit stacks first adds a unit test to verify the existing line-width option. This is to not only help verify this option for long-term use, but ensure/present that the catalog changes presented in this pull request do not break its functionality. The "no obsolete" feature then follows the same style of configuring/utilizing the respective babel catalog option, as done with the line-width feature.

This pull request may make #61 obsolete with the introduction of e5e1870; however, it is unknown if the sort_by_message_location proxy argument for babel's sort_by_file is required for its use case.

Provide a unit test to validate the usage of the `--line-width` option.

Signed-off-by: James Knight <james.d.knight@live.com>
The following tweaks the catalog wrapper commands used to call babel's
`pofile`/`mofile` functions to support forwarding any keyword argument.
This can provide flexibility to callers which may wish to utilize
additional options provided by babel, without needing to add an explicit
option in the catalog wrapper calls.

A compatibility adjustment was added to `dump_po` to help map an
original argument `line_width` to babel's `width` argument. This is to
ensure callers which still use the `line_width` argument can
appropriately configure the babel call to impose the provided width.

Signed-off-by: James Knight <james.d.knight@live.com>
Signed-off-by: James Knight <james.d.knight@live.com>
Adds support for a `--no-obsolete` option to allow the automatic
exclusion of obsolete messages (`#~ `) from updated sources. This
utilizes babel's `ignore_obsolete` option to not produce obsolete in a
final pot file.

The `--no-obsolete` argument was chosen to mimic the same argument
naming as seen in `msgattrib` [1].

[1]: https://www.gnu.org/software/gettext/manual/html_node/msgattrib-Invocation.html

Signed-off-by: James Knight <james.d.knight@live.com>
Signed-off-by: James Knight <james.d.knight@live.com>
@jdknight jdknight force-pushed the support-no-obsolete-option branch from 86d2c47 to dee5115 Compare May 7, 2023 15:57
Copy link
Member

@shimizukawa shimizukawa left a comment

Choose a reason for hiding this comment

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

LGTM!

@shimizukawa shimizukawa merged commit ef259ff into sphinx-doc:master Apr 19, 2024
8 checks passed
@shimizukawa
Copy link
Member

@jdknight Thank you for your contribution. Sorry it took so long to merge.

@jdknight jdknight deleted the support-no-obsolete-option branch April 20, 2024 01:32
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.

None yet

2 participants