n1crack / vuefinder

Empower your Vue.js applications with this versatile and customizable file manager component, simplifying file organization and navigation.
https://vuefinder.ozdemir.be
MIT License
259 stars 75 forks source link

Showing api errors without translation #26

Closed andreas-lundgren-qlucore closed 9 months ago

andreas-lundgren-qlucore commented 1 year ago

If an error response is received from the API, it can either contain a translation key OR a message shown to the end user as-is.

Just one example could be during "rename" if there is a conflict, and the backend can enlighten the user about this even if no translation key is present. If new translation keys are added, they will have precedence over the API response message according to the implementation of this commit.

andreas-lundgren-qlucore commented 1 year ago

Thank you for this open source project. I work for a med-tech company and this is just what we needed for a small web application involving a file manager.

Feel free to edit, request change or ever reject any PR that I put up, no hard feelings. :-) In the end, we are running our own fork because we needed to manage uploads and downloads via pre signed URL:s (from S3 buckets) and using multipart upload. We also needed to customise the features, turning off archive and preview since we mainly work with very large files containing genetic data.

Let me know if you are interested in some feature-toggle where some features like these can be turned off, and other features (like working with signed URL:s) can be turned on.

Download via pre-signed URL was very easy, but for upload we needed to replace the plupload package.

n1crack commented 1 year ago

I'm really glad to hear that the project is coming in handy for you. As in the readme, I have a roadmap for the project, and thought about the feature-toggles before. Unfortunately, Im currently tied up with some other things. Its ok to customize the features as long as you maintain flexibility.

I want to make the library as modular, just like editor.js. But it is a long way.

Btw, If the translation key is not present, t() function must returns the keyword back. You might have missed it.

https://github.com/n1crack/vuefinder/blob/42998daf79cd7fbc780013526f55a47ef98a54c8/src/composables/useI18n.js#L39-L44

n1crack commented 1 year ago

npm and demo files updated. But Im not sure of this MR yet.

andreas-lundgren-qlucore commented 1 year ago

Btw, If the translation key is not present, t() function must returns the keyword back. You might have missed it.

Yes, I did. Thanks for a firm review! (It proved that the missing value was due to our backend returning the message in the wrong property, we mistook that for a missing translation key). If I may suggest, we can still keep the safeguard to check that the message is there all together, but of course the check from the translation function is not necessary.

n1crack commented 9 months ago

there are many things changed. Currently we don't get the error message from this.