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

Ability to delete a translation key #3128

Closed
abbyad opened this issue Feb 16, 2017 · 14 comments
Closed

Ability to delete a translation key #3128

abbyad opened this issue Feb 16, 2017 · 14 comments
Assignees
Labels
Priority: 3 - Low Can be bumped from the release Type: Improvement Make something better
Projects

Comments

@abbyad
Copy link
Contributor

abbyad commented Feb 16, 2017

As a configurer I want to be able to delete unused translation keys so that they don't bloat the instance.

Once a translation key has been added it is not possible to remove it. This makes it not only difficult to correct mistakes, but also difficult to remove labels that may have been included with the default configuration that are not being used.

We could have an UI for removing individual keys, but there are occasions that we'd want to delete multiple keys at once, which could perhaps be done by re-importing the translations with the unused keys removed.

@abbyad abbyad added the Type: Feature Add something new label Feb 16, 2017
@nice-snek nice-snek added the Status: Blocked waiting for triage Blocked waiting for prioritisation label May 31, 2017
@mandric
Copy link
Contributor

mandric commented Jun 19, 2017

Wonder if you can set it to null or something that will evaluate to false as a temporary workaround? @abbyad can you give an update here?

@mandric mandric assigned abbyad and unassigned mandric Jun 19, 2017
@mandric mandric added 0 - Backlog and removed Status: Blocked waiting for triage Blocked waiting for prioritisation labels Jun 19, 2017
@abbyad
Copy link
Contributor Author

abbyad commented Jun 23, 2017

Setting them to null would help reduce bloat, but we should still support removing keys.

@abbyad abbyad assigned mandric and unassigned abbyad Jun 23, 2017
@garethbowen garethbowen added Priority: 3 - Low Can be bumped from the release and removed 0 - Backlog labels Aug 30, 2017
@abbyad
Copy link
Contributor Author

abbyad commented Feb 26, 2018

Removed the Triaged label since this issue is not in a Project.

@garethbowen
Copy link
Member

@abbyad All issues need some Status label or they will come up for triage again. IMO it doesn't need to be in a project to be triaged.

@sglangevin sglangevin added this to Feature Requests in 3.1.0 Jun 27, 2018
@sglangevin sglangevin moved this from Feature Requests to Small UI Improvements in 3.1.0 Jun 27, 2018
@sglangevin sglangevin moved this from Small UI Improvements to Re-review Later in 3.1.0 Jul 5, 2018
@sglangevin sglangevin removed this from Re-review Later in 3.1.0 Jul 6, 2018
@garethbowen garethbowen added the Help wanted Good for first time contributions label Aug 13, 2018
@tookam tookam self-assigned this Nov 5, 2018
@medic medic deleted a comment from nice-snek Nov 8, 2018
@garethbowen
Copy link
Member

Yeah unfortunately this is an issue with all our settings, hopefully it'll be fixed by medic/cht-conf#113

For now I think just add the button and we'll sort out the rest later.

alxndrsn pushed a commit to medic/cht-conf that referenced this issue Nov 22, 2018
alxndrsn pushed a commit to medic/cht-conf that referenced this issue Nov 22, 2018
garethbowen pushed a commit that referenced this issue Nov 27, 2018
Also, refactor translation related code to take into account new structure.

#3128
@garethbowen garethbowen moved this from In progress to In AT in 3.4.0 Nov 27, 2018
@garethbowen
Copy link
Member

For AT:

  • add a translation key, click on edit the translation, click the delete button, make sure it's gone.
  • make sure the translation keys we ship cannot be deleted.

@ngaruko
Copy link
Contributor

ngaruko commented Dec 13, 2018

Would you like to have a second look at this on your local @wtekeu . This is what happened when I tested this. I added a new translation and when I deleted it, there were errors both in the UI and in the console. I clicked delete again and translations were deleted but the key stayed. Then I tried to edit that translation and lo and behold the app crashes - and it is down as I type this. Whether it is related or a rather unfortunate coincidence, I cannot tell! Might be also related to #5062 ... Didn't take any screenshots or error logs as I was expecting to repeat this a couple of times to confirm.
Some errors in logs:

TypeError: Cannot read property 'replace' of null
Dec 13 13:59:39 gamma-dev gamma-dev-medic-api-logs:  (gamma-xxxxxx) | [2018-12-13 06:59:38] 2018-12-13 06:59:38 INFO: Merging translations… 
Dec 13 13:59:39 gamma-dev gamma-dev-medic-api-logs:  (gamma-dev-xxxxx) |     at result.rows.forEach.row (/srv/software/medic-api/md5-G0JZAWK5AjbNNcsCThkzQ==/src/config.js:86:57)

@tookam
Copy link
Contributor

tookam commented Dec 13, 2018

@ngaruko #5062 has been fixed and is ready for AT.

@ngaruko
Copy link
Contributor

ngaruko commented Dec 14, 2018

LGTM.
Added key can be deleted.
Translation keys we ship cannot be deleted. Just a nitpick, maybe we should grey out or hide the delete button on these un-deletable keys, but let us close that and suggest the idea in a different issue if needed, unless you think it is that important or an easy-win @abbyad?
image

@garethbowen
Copy link
Member

@ngaruko Yes we should definitely disable the delete button if you can't delete it. What happens currently? Just nothing?

@wtekeu Can you have a look at this improvement at some point?

@ngaruko
Copy link
Contributor

ngaruko commented Dec 17, 2018

Thanks @garethbowen . At the moment, for shipped translations, the edit translation modal disappear onDelete, sort of same behaviour as the Cancel button.
Pushing it back to you @wtekeu ...

@ngaruko ngaruko moved this from In AT to In progress in 3.4.0 Dec 17, 2018
garethbowen pushed a commit that referenced this issue Dec 20, 2018
Hide the translation delete button when the user edits a generic translation. Only custom translations can be deleted.

#3128
@garethbowen garethbowen moved this from In progress to In AT in 3.4.0 Dec 20, 2018
@ngaruko ngaruko assigned ngaruko and unassigned tookam Dec 20, 2018
@ngaruko
Copy link
Contributor

ngaruko commented Dec 20, 2018

LGTM...
Closing...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Priority: 3 - Low Can be bumped from the release Type: Improvement Make something better
Projects
No open projects
3.4.0
  
Done
Development

No branches or pull requests

6 participants