Skip to content

Support no obsolete option#65

Merged
shimizukawa merged 5 commits into
sphinx-doc:masterfrom
jdknight:support-no-obsolete-option
Apr 19, 2024
Merged

Support no obsolete option#65
shimizukawa merged 5 commits into
sphinx-doc:masterfrom
jdknight:support-no-obsolete-option

Conversation

@jdknight

Copy link
Copy Markdown
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.

jdknight added 5 commits May 7, 2023 11:56
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>

@shimizukawa shimizukawa left a comment

Copy link
Copy Markdown
Member

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
@shimizukawa

Copy link
Copy Markdown
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.

2 participants