-
Notifications
You must be signed in to change notification settings - Fork 480
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
Pass studio strings into validation to allow for localization #35282
Conversation
@@ -6983,9 +6983,11 @@ var checkFinished = function() { | |||
var hasSuccessCondition = | |||
level.goal && level.goal.successCondition ? true : false; | |||
var achievedOptionalSuccessCondition = | |||
!hasSuccessCondition || utils.valueOr(level.goal.successCondition(), true); | |||
!hasSuccessCondition || | |||
utils.valueOr(level.goal.successCondition(studioMsg), true); |
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.
This seems like a simple solution to the problem you described, but I'm have trouble figuring out how all these pieces fit together. Could you help me understand?
studioMsg
is all the translated strings, right? If so, why do we need to pass all the translated strings into this function? Why can't the implementation of successCondition
currently access our translated strings?
I also don't understand where the successConfition
function is defined which will make use of the translated screens.
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.
successCondition
is an attribute of a level that contains a small javascript function that checks for "success".
For example, this level checks that a certain sprite says a certain phrase.
I couldn't get that function to access the translated strings on its own and I'm concerned about that being a sharp corner if we ever changed how files access the localized strings. We might forget to change these levels too.
Does that help?
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.
@daynew did I answer your question or do you have any other concerns? |
This allows Playlab levels to access the studio i18n strings in validation code.
There are only a handful of levels whose validation is locale-specific. As far as I could find, these levels use the "say" block. The strings for the say block are in
i18n/studio/en_us.json
already, so those can be reused. This isn't the cleanest solution, but is low-risk and will solve for the ~11 levels that need to be updated.I'll update the levels in Levelbuilder after this PR gets there.
Links
Testing story
Reviewer Checklist: