Commit c07d3f93 authored by Christian Schudt's avatar Christian Schudt

xml:lang in stream header should conform to a language tag.

toString() was called on the Locale here, resulting e.g. in "de_DE".
Instead it should be "de-DE".
parent 193091d7
......@@ -278,7 +278,7 @@ abstract class SocketReadingMode {
sb.append("\" id=\"");
sb.append(socketReader.session.getStreamID().toString());
sb.append("\" xml:lang=\"");
sb.append(socketReader.session.getLanguage());
sb.append(socketReader.session.getLanguage().toLanguageTag());
sb.append("\" version=\"");
sb.append(Session.MAJOR_VERSION).append('.').append(Session.MINOR_VERSION);
sb.append("\">");
......
......@@ -580,7 +580,7 @@ public abstract class StanzaHandler {
sb.append("\" id=\"");
sb.append(session.getStreamID());
sb.append("\" xml:lang=\"");
sb.append(session.getLanguage());
sb.append(session.getLanguage().toLanguageTag());
sb.append("\" version=\"");
sb.append(Session.MAJOR_VERSION).append('.').append(Session.MINOR_VERSION);
sb.append("\">");
......
......@@ -347,7 +347,7 @@ public class LocalClientSession extends LocalSession implements ClientSession {
sb.append("\" id=\"");
sb.append(session.getStreamID().toString());
sb.append("\" xml:lang=\"");
sb.append(language);
sb.append(language.toLanguageTag());
// Don't include version info if the version is 0.0.
if (majorVersion != 0) {
sb.append("\" version=\"");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment