-
Notifications
You must be signed in to change notification settings - Fork 58
Add --purge flag to control removal of obsolete translations and comments in update-po #460
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
base: main
Are you sure you want to change the base?
Add --purge flag to control removal of obsolete translations and comments in update-po #460
Conversation
Co-authored-by: swissspidy <841956+swissspidy@users.noreply.github.com>
Co-authored-by: swissspidy <841956+swissspidy@users.noreply.github.com>
…e operations Co-authored-by: swissspidy <841956+swissspidy@users.noreply.github.com>
update-po: Preserve unused translations/comments?
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
|
@copilot Invert & rename the flag to |
Co-authored-by: swissspidy <841956+swissspidy@users.noreply.github.com>
Done! Changed the flag from Changes in commit 86fabf4:
Tested all three scenarios:
Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
The
update-pocommand removes obsolete translations (#~entries) and file-level comments (copyright notices) by default. Users maintaining translation history in VCS need a way to preserve this content.Changes
--purgeflag: Conditionally excludesMerge::REMOVEandMerge::COMMENTS_THEIRSfrom merge operation. Defaults totrue(purging enabled)Usage
Input PO with obsolete content:
With
--no-purge, all content is preserved while new strings from the POT are added. By default (or with--purge), copyright comments and obsolete entries are removed. WP-CLI automatically translates--no-purgeto--purge=falsebehind the scenes.Original prompt
update-po: Preserve unused translations/comments?</issue_title><issue_description>## Feature Request
Describe your use case and the problem you are facing
update-podoesn't preserve unused translations/comments inside the PO files.As Gettext editors like POEdit use their own translation database and VCS are usually used, this isn't a big deal and may de-clutter the PO file. - But an option for keeping this extra stuff may still be helpful in some cases.
Describe the solution you'd like
An option that lets
update-pokeep the unused translations/comments inside the PO files.Example:
Input PO:
update-po: Preserve unused translations/comments? #334Original prompt
update-po: Preserve unused translations/comments? #334💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.