Skip to content
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

Duplicate of ml/lang-slug-metadata-formplayer-branch #1443

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ protected InstanceRoot setupSessionData(ExternalDataInstance instance) {
TreeElement root =
SessionInstanceBuilder.getSessionInstance(sessionWrapper.getFrame(), getDeviceId(),
getVersionString(), getCurrentDrift(), u.getUsername(), u.getUniqueId(),
u.getProperties(), getWindowWidth());
u.getProperties(), getWindowWidth(), getLocale());
root.setParent(instance.getBase());
return new ConcreteInstanceRoot(root);
}
Expand All @@ -253,6 +253,10 @@ protected String getWindowWidth() {
return sessionWrapper.getWindowWidth();
}

protected String getLocale() {
return Localization.getCurrentLocale();
}

protected long getCurrentDrift() {
return 0;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,12 @@ public class SessionInstanceBuilder {
public static TreeElement getSessionInstance(SessionFrame frame, String deviceId,
String appversion, long drift,
String username, String userId,
Hashtable<String, String> userFields, String windowWidth) {
Hashtable<String, String> userFields, String windowWidth,
String applanguage) {
TreeElement sessionRoot = new TreeElement("session", 0);

addSessionNavData(sessionRoot, frame);
addMetadata(sessionRoot, deviceId, appversion, username, userId, drift, windowWidth);
addMetadata(sessionRoot, deviceId, appversion, username, userId, drift, windowWidth, applanguage);
addUserProperties(sessionRoot, userFields);

return sessionRoot;
Expand Down Expand Up @@ -88,7 +89,8 @@ private static String getCalloutSearchResultCount(StackFrameStep step) {

private static void addMetadata(TreeElement sessionRoot, String deviceId,
String appversion, String username,
String userId, long drift, String windowWidth) {
String userId, long drift, String windowWidth,
String applanguage) {
TreeElement sessionMeta = new TreeElement("context", 0);

addData(sessionMeta, "deviceid", deviceId);
Expand All @@ -97,6 +99,7 @@ private static void addMetadata(TreeElement sessionRoot, String deviceId,
addData(sessionMeta, "userid", userId);
addData(sessionMeta, "drift", String.valueOf(drift));
addData(sessionMeta, "window_width", windowWidth);
addData(sessionMeta, "applanguage", applanguage);

sessionRoot.addChild(sessionMeta);
}
Expand Down
Loading