Enhance FileSizePipe to support localization#5055
Enhance FileSizePipe to support localization#5055saschaszott wants to merge 1 commit intoDSpace:mainfrom
Conversation
|
|
||
| transform(bytes: number = 0, precision: number = 2): string { | ||
| return filesize(bytes, { standard: 'jedec', round: precision }); | ||
| return fileSize(bytes, { |
There was a problem hiding this comment.
I'm wondering if we should stay with JEDEC (e.g., 1 MB = 1024 KB) or SI (e.g., 1 MB = 1000 KB). Even though I'm personally all for JEDEC, I believe most people in the world are familiar with the SI and expect SI units
Or maybe it should be moved to the configuration, so users could decide by themselves?
There was a problem hiding this comment.
@MMilosz , could you please create a new issue for this aspect.
|
@saschaszott : This PR looks to be invalid, as it contains a large number of unrelated commits. Did you maybe submit this to the wrong branch? (I see the branch you are submitting against is set to |
|
@tdonohue , I originally implemented the extension of the FileSizePipe for DSpace CRIS 2024.02.03, which is based on DSpace 8.2. It took a few iterations to make it work with DSpace 10 as well. It should be working now. If we want to backport this change to older DSpace versions, the code will need to be adapted. |
|
I unfortunately have to pause at this point, as I currently don’t have a DSpace 10 development instance available. There seems to be an issue with the dependency injection of |
|
I have now set up a local DSpace Angular 10 test instance and applied the change there. In Chrome, I don’t see any error messages, and the desired result (localized display of the file size) is also visible. Therefore, the build error must have other causes. |
|
I think I have found the cause: the |
|
@tdonohue , the PR is now finished; all spec tests are passing again. Should I create a new PR with one or two commits containing all changes, or will you squash all commits when merging? Also, there is currently a general issue with running the E2E tests on GitHub (see my question on Slack). |
|
@saschaszott : If you have a chance, I'd prefer you squash the commits yourself in this PR. This is possible to do by just doing a rebase on the branch this PR is based on (to squash the commits however you like) and do a "force push" to update the branch in this PR. That preferable just because I sometimes forget to squash PRs when merging them. |
528e6bf to
d6af4ad
Compare
|
@tdonohue , this PR is ready for review! |




This PR is related to / fixes issue #5054 .