-
-
Notifications
You must be signed in to change notification settings - Fork 81
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
Feat(ajax responses): Improved localization handling, error reporting and success messages #363
Conversation
…pdating libraries
… client language strings
… und update message
BREAKING CHANGE: ILibraryStorage.getFileStream is now async!
…elated issues where current implementation doesn't conform to the H5P standard
…ation errors when uploading packages
The changes turned out to be huge, but now error handling is much improved and the ajax endpoint is more stable and nearly fully tested. This means we now have integration tests of nearly all AJAX endpoints (I didn't test installing libraries from the H5P Hub as we still can't mock downloads from there). I had to change the interface of the library (breaking changes):
The example now also adds i18next to the request object. I think it's good to stay localization library agnostic and leave it to the implementation what library to use. Do you agree, @JPSchellenberg ? @JPSchellenberg you can review now. |
I've merged the master |
🎉 This PR is included in version 1.0.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
The PR closes #44, closes #80 and closes #83. To standardize localization it introduces a dev dependency on i18next (very common npm package) and converts the custom replacement variables (%xyz, @xyz) used so far into more widespread {{xyz}} notation.
Implementations can use any localization library, but must add the property t(...) to the Express req object of the if using the Express adapter. They must also follow the {{...}} notation.