-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Nextcloud Rich Object Strings #1706
Comments
@nickvergessen how does this one handle localization? I would either have to get a message ID and ship the translations or when requesting the the rich objects string request them for a certain language. |
Well the endpoints are already localized in the users language. This is taken from settings, accepted language header or default language config. So no localization needed on client sides |
how to make nextcloud chat. like whatsapp's zig zag. |
Nextcloud Rich Object Strings
The idea is to allow Nextcloud apps (e.g. activity and notification) to have a common syntax for their endpoints to provide markup, which is then also commonly understood by all the endpoint reading applications (desktop and mobile clients).
Motivation
The activity app has an action when someone shares a file to a group. The text of the activity is as follows:
So there are 3 "objects" in this message, which should be presented with HTML markup in the web UI:
The problem is, that when the endpoint already speaks HTML, that other clients (desktop and mobile) can not use this strings. But of course the clients should also allow clicking on the filename and open the local folder (when synced) or the web UI (not synced).
Example
In order to allow this, the message is split into the localized string and the parameters with their meta-data (json):
In this case there is no markup in the endpoint and all clients (including the web UI) could transform the message into the desired visual representation.
Object type management
The list of known object types is managed in a markdown file within the server repository. This allows app authors to send pull requests to register new object types. However once a stable release is out (Nextcloud X.0.0), the list is frozen, so the list has an API version bound to a server version.
In case a client decides to not implement an object type, it should fallback to using the name and when possible using the optional link.
Minimal object type
Example object types
user
group
file
cc @jancborchardt @LukasReschke @MorrisJobke @AndyScherzinger @tobiasKaminsky @rullzer
Ref nextcloud/notifications#27
The text was updated successfully, but these errors were encountered: