Link Mauve“20:49:04 Zash> Actually, you can probably add tags in a custom namespace if you want”, clients will parse the namespaces into their internal structures, then serialise them back without including your extensions, sorry.
Link MauveIf you want do extend your bookmarks, you’ll have to use another private PEP node.
jonas’unless bookmarks 2 or something specifies that stuff needs to be kept :)
Link Mauvejonas’, as far as current implementations are concerned, Bookmarks 2 doesn’t exist.
Ge0rGjonas’: keeping unknown elements in a structure that you have to parse is a nasty cross layer challenge.
Douglas Terabytehas left
lovetoxyeah and i would rather not rely on other clients not overwritting my custom elements
lovetoxUsing a private pep node for that, you dont need to change a xep, you dont need to rely on other clients, you can implement it right now, and it will just work
Steve Killehas left
ZashWhere do I send patches for the website?
Zasheditor@xmpp.org or somesuch?
Link MauveZash, that should be fine, or you could use GitHub and send a pull request.
Link MauveEditor will be the one merging it in the end.
ZashI don't feel like interacting with github today, and I strongly believe that it should not be required.
Link MauveEspecially now that it’s impossible for people living in countries the USA considers as enemies.
ZashWell the XSF is incorporated in the US so that point might be moot :/
Link MauveThe XSF isn’t enforcing that ban on any of its infrastructures, AFAIK.
Link MauveGitHub is, since a few days ago.
ZashMaybe this merely reminded me to exercise the non-github patch submission path :)
Ge0rGZash: how do you obtain a copy of the repository without interacting with github?
ZashGe0rG: Magic already existing local clone.
Zashhttps://xmpp.org/about/technology-overview.html#pubsub has a broken link to what I assume was a local render of https://tools.ietf.org/html/draft-saintandre-atompub-notify-07
ZashWhat's the relation of that and XEP-0277 (or is it 227? I always mix those up)
eevvoorhope we can use salut a toi one day to send patches via xmpp :)
Ge0rGStore your code in PubSub, not in GitHub!
Link MauveI just got into an argument with someone arguing that XMPP shouldn’t be able to send/store files, even though that was just HTTP. :(
Ge0rGXMPP shouldn't be using HTTP for sending files.
lovetoxi should not have to add this to presences if i join a muc or?
lovetoxZash what does this mean if i set xml:lang=de, and prosody answers me with xml:lang=en
lovetoxis the lang set on each direction of the stream separate?
ZashI don't know. Prosody doesn't do anything with xml:lang
Link Mauvelovetox, yes, each direction is separate.
lovetoxit does, because it sets it to en :D
lovetoxZash i hope it adds whatever xml:lang i set to whatever stanza it routes to other servers
ZashIt does *nothing* with xml:lang
Link MauveBut yes, the server SHOULD (IIRC) add the stream’s @xml:lang on each outgoing stanza if you haven’t set one already.
ZashExcept if it's set on a presence stanza that creates a MUC it uses that as default language in the MUC config
lovetoxIs there a particular reason prosody ignores stream xml:lang attr?
Link MauveAh no, it’s not a SHOULD it’s a MAY.
Link Mauve“If the initiating entity included the 'xml:lang' attribute in its initial stream header, the receiving entity SHOULD remember that value as the default xml:lang for all stanzas sent by the initiating entity over the current stream. As described under Section 8.1.5, the initiating entity MAY include the 'xml:lang' attribute in any XML stanzas it sends over the stream.”
Link Mauvelovetox, it’s allowed in 6120.
Link MauveSection 4.7.4.
lovetoxno its a SHOULD for the server
Link MauveAh right, I misread.
ZashLink Mauve, Wait inheritance is not mandated by XML itself?
Link MauveZash, stanzas are sent to other entities than your server, so that wouldn’t be enough.
lovetoxZash, im aware that prosody does not provide translations
lovetoxbut other servers do, and it would be nice if prosody adds whatever stream xml:lang i set, to outgoing stanzs
ZashNobody has written code that does that
Ge0rGI'm surprised that this is not a MUST in the standard.
Ge0rGI've just added xml:lang to yaxim yesterday.
flowWhat would make a MUST better here?
Link Mauveflow, clients wouldn’t have to copy it manually on each stanza.
flowI assume we are talking about the first SHOULD in the quote link posted
Link MauveI wasn’t aware of this particular issue.
flowLink Mauve, well a SHOULD is already pretty strong. I usually read it as "you have to do it, unless all invovled parties aggreed on something else"
flowThat way, you could write a simpler service implementation, use it in a, more or less closed, envrionment, where that requirement is not needed by every involved party and still claim standard compliance
Ge0rG> If an outbound stanza generated by a client does not possess an 'xml:lang' attribute, the client's server SHOULD add an 'xml:lang' attribute whose value is that specified for the client's output stream as defined under Section 4.7.4.
Ge0rGThis is §8.1.5
Link Mauveflow, I actually read MUSTs that way, as long as both entities agree they can do otherwise.
Ge0rGInheritance of xml:lang is a huge can of worms.
flowI know that endless discussion have already take place about that topic at various venues :)
flowLink Mauve, so what makes a SHOULD different from a MAY and from a MUST in your book?
Ge0rGI'm sure there were.
Ge0rGflow: prosody developers will implement MUST on request.
Link MauveGe0rG, SHOULD too.
Ge0rGLink Mauve: not in my experience.
Link Mauveflow, hmm, SHOULD is more like, it’s possible to not implement it that way if you can’t, for a good enough reason.
Link MauveAnd MAY, do whatever you want.
flowack on MAY
flowbut I guess if we ask enough people we sure get two contradictory statements on that too ;)
Link MauveYeah. ^^'
flowIt feels like your SHOULD interpretation is not so far away from mine
flowso in my book, MUST is something that you can not just not follow, as otherwise some very important aspect will fall apart
flowlike "MUST be initialized with a CSPRNG"
lovetoxGe0rG, can you give an example why this is a can of worms?
flowof course you are free to ignore that in your implementation, but then you can't claim standard compliance and you have to live with the consequences
Link MauveEarlier today I was reading the XML specification, and found not respected MUSTs in minidom which are totally fine not to respect in our XMPP environment.
flowlovetox, some XML parsers, IIRC the one on Android, will not inhert xml:lang to deeper XML levels
Link MauveIncidentally, I just opened https://gitlab.com/xmpp-rs/minidom-rs/issues/17
Ge0rGlovetox: that, and your prosody issue.
flowthat means you may have to work around that if you want get the effective xml:lang
flownote that this is usually also true for namespace prefix bindings
Ge0rGAlso displaying of the right human readable text from a message with a set of different language texts
lovetoxi have the feeling you talk about some use cases that never happen
lovetoxalso i dont see why i would need my parser to do some inherit stuff with xml lang
Ge0rGThey never happen because nobody is making use of xml:lang because they never happen.
lovetoxthis is about telling my server my preferred lang, i dont parse it anywhere, i only send it
flowlovetox, well let's say there is a server which optimizes xml:lang by stripped redundant ones
flowI think there are some more cases, but yes it obviously hasn't hurt xmpp that much in the past 20 years
Ge0rGlovetox: the body inherits the lang from the message, which inherits it from the stream. If your xml library doesn't do that Inheritance, you need to manually traverse the hierarchy
flowon the other hand, smack just got support for an xml environment which keeps track of xml:lang
flowwhich is hopefully caused by xmpp becoming more and more used so that those rare cases where xml:lang inheritance becomes important also become important ;)
lovetoxno you really dont Ge0rG, at least not for the basic use case of getting translated messages from your server
lovetoxwhat you are talking about is user to user stuff
lovetoxyeah i wouldnt even start with xml lang there
Ge0rGlovetox: I'm talking about the code needed to display the correct string to the user
Ge0rGlovetox: let's say it's not message body but the text field from a message error
flowGe0rG, aren't you talking about the "here is the same error message in 20 different language strings, please select the best one" case?
lovetoxwhats the problem? you dont work with inheritence there
lovetoxyou just set the xml:lang on the <text>
lovetoxthe server sets it in this case
lovetoxif its not there, its the lang the server told you in stream init
Ge0rGflow: I'm talking about the smack report where no text at all is returned when the languages don't match
flowGe0rG, i guess that is very indirect yes to my question
Ge0rGlovetox: you just described Inheritance
Ge0rGflow: maybe not 20, but 2, or even just one, but in the wrong language
lovetoxwhy would a server return 2?
lovetoxthis is already some theoretical stuff
flowlovetox, because the stanza may not originated from the server
flowit maybe came from a remote entity which has no knowledge about your stream's xml:lang
Link Mauvelovetox, for instance, so you can have a nice localised message for user display, and the English version so they can report to the admin and easily look it up in the code.
lovetoxyeah still dont see the problem, one has xml:lang=en the other one "de"
Link MauveIf I were to implement localised error messages in a server, I’d do it that way.
flowLink Mauve, +1
lovetox<error> can have "fi"
lovetoxit does not matter
Link Mauvelovetox, the other one may not have it on the <text/> element, but on the stanza.
lovetoxbecause the directly set xml:lang on the text will always overrule parent or not?
Link MauveIt still MUST be understood as German.
Link Mauvelovetox, yes it will.
Link MauveBut the @xml:lang might be present on any parent of the <text/> element, and you must inherit it in any child which doesn’t have one defined.
flowso basically if you have: stream xml:lang=en, stanza xml:lang=de, error xml:lang not set, your parser should see the error's xml:lang as 'de' and not 'en'
flowor, even better, your parser sould provide you mechanism to determine the effective xml:lang of the element
Link MauveAnd not '' either (which means no language set, as per XML 1.0). ✏
flowLink Mauve, yep, today I sadly learned that the empty string is valid for xml:lang
Link MauveTIL too!
flowanother fun fact: xml 1.0 mentions BCP 47 for xml:lang, xml 1.1 mentions rfc 3066
flownow go out and find out the fun :)
lovetoxdoes the rfc not define one them self
lovetoxrfc says BCP 47
flowahh you spoiled the fun for the others, yes rfc 3066 is bcp 47
Ge0rGit's not as bad as stringprep vs precis, eh?
flowI just find it strange that this changed between xml 1.0 and 1.1, and i am curious to get the rationale behind that (if there is any)
Link Mauveflow, isn’t BCP47 a live standard, as in it will point to whichever RFC is currently considered the one?
lovetoxeither way, servers in general should get translation going, i see it working in ejabberd, its a nice thing
flowLink Mauve, are they? but yes, that could be a reason
Ge0rGlovetox: there should also be a translations project for the common error conditions.
flowtranslate your favorite error message!
Ge0rGThis is especially important for stream errors, where the text element is an extension for the technical details, not the actual explanation
wurstsalat> lovetox: there should also be a translations project for the common error conditions.
lovetoxyes also common forms
Link MauveYes please, Someone™ do that.
Ge0rGThe JSF should do it.
Ge0rGDo we have a complete list of all places where the same translations are needed for all implementations?
Ge0rGForms, error conditions,...?
Link MauveGe0rG, take a translated server’s .pot file?
lovetoxforms and error conditions, i didnt come across any other places where a server adds userfacing text
Link Mauvelovetox, user configuration maybe?
Ge0rGLink Mauve: there is no 1:1 mapping between conditions and server side error messages
lovetoxwhats user configuration?
Link Mauvelovetox, some servers may expose e.g. a web interface to their admins.
Link MauveGe0rG, I know.
ZashCreate a repo, stick some .po files or whatever in it, pre-seed it with text from the RFC?
Ge0rGZash: on github!
lovetoxi think one would need some translation website, like pootle or something
ZashNot strictly, but such a thing can be used
lovetoxtransifex is pretty expensive
ZashAre you supposed to do xml:lang inheritance yourself or can libexpat do it?
lovetoxWhy would you care as server?
lovetoxjust set the attr on the top element
lovetoxand be done
Zashlovetox: The question is "Can the XML parser library do the thing you just asked us to do?"
lovetoxsetting an attribute on a stanza?
ZashInheriting xml:lang from the stream to child elements
lovetoxim pretty sure it can do it
ZashI'm not sure you grasp just how deep this can of worms is
ZashIf something copies one of the child tags of the stanza, they should probably also carry the xml:lang
ZashIe it should work similar to xmlns, which the xml parser supposedly handles for us
lovetoxI think you overthink that
lovetoxall you have to do is, add the attr to the message, iq, presence, and leave the rest to client parsers who get the stanza
lovetoxof course only if its not already there
lovetoxand this can never be wrong, as we set it on the stream already, so it is inherited in message, iq, presence anyway
lovetoxyou just make it explicit
lovetoxyou dont change anything here
lovetoxand thats only because these stanzas will reach entitys which dont have the c2s stream context
lovetoxand nobody asks you should make it explicit all the way down to the last child
lovetoxonly the childs of stream
Link Mauvelovetox, think about some user sending the server an xml:lang="fr" message, the server then copies only the body into some other message, maybe to send it to the admin, or to archive, or anything.
Link MauveThe original body didn’t contain any @xml:lang, but the copy should contain it as xml:lang="fr".
lovetoxstoring and restoring messages and all of its content correctly is a general issue that does not stop at that attr
Link Mauvexmlns, xml:lang, something else?
lovetoxyes if the server does not preserve attr on the message
lovetoxthere needs to be changes to make this right
Link Mauvelovetox, it’s not only on the message, it should be “propagated” to all children of the stanza in that case.
lovetoxbut i would never go the way and add the attr on all childs only because i dont want to store it on the message
lovetoxNo Link Mauve server should replicate the message exactly
lovetoxif i send a message with lang=de, i expect it to be routed that way
lovetoxand not with lang=de on all childs set
lovetoxi mean yes it would be still correct
Zashlang=de is implied
lovetoxbut weird to rewrite a stanza that way
lovetoxand you do it with jabber:client already?
lovetoxwhy dont you copy it into every body?
Link Mauvelovetox, it’s not about rewriting, it’s about representing in memory or serialised.
Link MauveAnd having an easy way to access it.
lovetoxyeah Link Mauve but thats totally different problem, sorry i cant believe that xml:lang attr suddently is the big challenge of serializing
lovetoxi see that a server dev, maybe has to change or adapt his serialization process
Link Mauvelovetox, as for “replicating”, in my example the server would only want to copy the body, not the rest of the message. No matter the way it decides to represent it, it must introduce a xml:lang="fr" on the body once copied alone in another stanza.
lovetoxand in that way, my pervious statement "just add the attr" is wrong
lovetoxbut i dont think this is a problem hard to solve
ZashActually you have to change jabber:client to jabber:server when sending it over s2s, so that's already messy
lovetoxalso this is all beside the point, users can already add xml:lang to messages, and we expect it to be routed to the destination
lovetoxare you telling me this does not work currently?
Link Mauvelovetox, it does, but I’m talking about internal server processing (or any entity really).
lovetoxbut im not proposing to change anything here
Link MauveIf the entity wants to extract one element out of a stanza, the parent’s (parent’s (parent’s …)) @xml:lang should apply.
ZashMUC subjects maybe?
lovetoxwhat im asking is, that the server sets the attr, not the client, so this change can not lead to problems
Link MauveZash, yes, that’s a good example.
ZashTho Prosody only saves the text there
Link MauveIt should also support setting multiple subjects, each in a different language. :)
ZashMy head hurts
Steve Killehas joined
Link MauveIn xmpp-parsers I made each text element a hash map of language to value.
Ge0rGIs xml:lang preserved by MAM?
Link MauveShould be.
Ge0rGLink Mauve: and then you implemented a getOptimalLanguageValue() based on a doubly weighted list from the Accept-Language header?
Ge0rGwalks himself out
Link MauveGe0rG, only based on a single vector, from preferred to least preferred, defaulting to no lang, or if there is none to the first one.
Link MauveWithout any normalisation (so for instance it won’t pick fr-FR if the user prefers fr).