-
Notifications
You must be signed in to change notification settings - Fork 14
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
Make language slug available via session metadata (formplayer branch) #1441
Changes from all commits
464b36e
77a9925
2751af1
f336ec3
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -74,7 +74,7 @@ public ExternalDataInstance getSpecializedExternalDataInstance(ExternalDataInsta | |
|
||
@Override | ||
@Nonnull | ||
public InstanceRoot generateRoot(ExternalDataInstance instance) { | ||
public InstanceRoot generateRoot(ExternalDataInstance instance, String locale) { | ||
String ref = instance.getReference(); | ||
if (ref.contains(LedgerInstanceTreeElement.MODEL_NAME)) { | ||
return setupLedgerData(instance); | ||
|
@@ -83,7 +83,7 @@ public InstanceRoot generateRoot(ExternalDataInstance instance) { | |
} else if (ref.contains("fixture")) { | ||
return setupFixtureData(instance); | ||
} else if (instance.getReference().contains("session")) { | ||
return setupSessionData(instance); | ||
return setupSessionData(instance, locale); | ||
} else if (ref.startsWith(ExternalDataInstance.JR_REMOTE_REFERENCE)) { | ||
return setupExternalDataInstance(instance, ref, SessionFrame.STATE_QUERY_REQUEST); | ||
} else if (ref.startsWith(JR_SELECTED_ENTITIES_REFERENCE)) { | ||
|
@@ -236,15 +236,15 @@ protected TreeElement loadFixtureRoot(ExternalDataInstance instance, | |
} | ||
} | ||
|
||
protected InstanceRoot setupSessionData(ExternalDataInstance instance) { | ||
protected InstanceRoot setupSessionData(ExternalDataInstance instance, String locale) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. can we follow the same pattern as There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hi Shubham thanks for getting on this so quick after coming back online! I can make these changes but what would the process of PR-ing them be? I guess I need to make a new branch to merge into the formplayer branch but can I just push the extra commit to the auto-opened/still-open PR for merging into the master branch? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Yeah that sounds fine to me. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. addressed this and the above comment here. I'll make the doc changes once everything is deployed! |
||
if (this.mPlatform == null) { | ||
throw new RuntimeException("Cannot generate session instance with undeclared platform!"); | ||
} | ||
User u = mSandbox.getLoggedInUserUnsafe(); | ||
TreeElement root = | ||
SessionInstanceBuilder.getSessionInstance(sessionWrapper.getFrame(), getDeviceId(), | ||
getVersionString(), getCurrentDrift(), u.getUsername(), u.getUniqueId(), | ||
u.getProperties(), getWindowWidth()); | ||
u.getProperties(), getWindowWidth(), locale); | ||
root.setParent(instance.getBase()); | ||
return new ConcreteInstanceRoot(root); | ||
} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -279,7 +279,7 @@ public void setID(int recordid) { | |
this.recordid = recordid; | ||
} | ||
|
||
public abstract DataInstance initialize(InstanceInitializationFactory initializer, String instanceId); | ||
public abstract DataInstance initialize(InstanceInitializationFactory initializer, String instanceId, String locale); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could you not create a concrete method with the original signature which calls the abstract one with the locale being null? Then you would not have to pass the null everywhere. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Very true! This did indeed get rid of some unnecessary null usage 🎉 |
||
|
||
public CacheHost getCacheHost() { | ||
return mCacheHost; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
think this should be part of the super class
ScreenContext
as it is not something specific to entity screens.