Fix manipulate.translation ignore behaviour #6041
Merged
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.
Changes proposed in this pull request:
When using
cli/manipulate.translation.php
we would expect thatcli/manipulate.translation.php -a ignore -l en -k install.auth.form
would add an ignore note to the keyinstall.auth.form
and thatcli/manipulate.translation.php -a ignore -l en -k install.auth.form -r
would remove the ignore note frominstall.auth.form
. Instead, this behaviour is reversed. This same reversed behaviour is present when using-a ignore_unmodified
withcli/manipulate.translation
as well.This fix gives us the behaviour from
cli/manipulate.translation.php
that we would expect e.g. the reverse of current behaviour.I've also modified the tests for
ignore
andignore_unmodified
in I18nDataTest.php as they were checking for the incorrect output.How to test the feature manually:
Use
cli/manipulate.translation.php -a ignore -l en -k install.auth.form
to ignore a key.Check the translation file (in this case
![image](https://private-user-images.githubusercontent.com/59581846/296735057-569b5a07-4d64-46af-b0c0-7450d2a018a3.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjIyODYxNzMsIm5iZiI6MTcyMjI4NTg3MywicGF0aCI6Ii81OTU4MTg0Ni8yOTY3MzUwNTctNTY5YjVhMDctNGQ2NC00NmFmLWIwYzAtNzQ1MGQyYTAxOGEzLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA3MjklMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNzI5VDIwNDQzM1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWFiYTg3Yzc3MjE4NGQ5ZTk3OTNlZTk1NWRmYjhjY2FiOTNmY2ZkYjMxMTI0ODJlOTk0NDg2OGI0ZWRiMzY1OWYmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.EUDPyQN6pPGX784Jj-lvmLto5hjcTOtnIXhowLaM1i8)
FreshRSS/app/i18n/en/install.php
) to confirm the key is ignored.Use
cli/manipulate.translation.php -a ignore -l en -k install.auth.form -r
to remove the ignore note.Confirm the key has been unignored.
![image](https://private-user-images.githubusercontent.com/59581846/296735901-12b84841-b879-4182-b038-de01557502b5.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjIyODYxNzMsIm5iZiI6MTcyMjI4NTg3MywicGF0aCI6Ii81OTU4MTg0Ni8yOTY3MzU5MDEtMTJiODQ4NDEtYjg3OS00MTgyLWIwMzgtZGUwMTU1NzUwMmI1LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA3MjklMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNzI5VDIwNDQzM1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTliMDc0MmJkMTA2NjgwOTE5YzE0ZTIwOTY1YzNmZTNkZDI2YjBiMjJmNTYwNTU1ZDc2Y2ExOTE3NWYxYjg0Y2EmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.iPh6O5K6rKJ3wGq_nutd--Lb-FvZtFh5LmIpHorKHEI)
Pull request checklist: