made the steam language challenge dynamic depending on the language

This commit is contained in:
Faraphel 2023-12-30 16:52:16 +01:00
parent 6b9d3c27e3
commit 6be02b29c8
2 changed files with 8 additions and 2 deletions

View file

@ -230,7 +230,13 @@ class WebMission(BaseSurvey):
self._success()
page = self.browser.web.page()
page.runJavaScript(self.check_condition, resultCallback=check_callback)
# preprocess the condition
condition = self.check_condition
condition = condition.replace("#LANGUAGE_CODE#", translate.get_language())
# run the condition
page.runJavaScript(condition, resultCallback=check_callback)
# data collection

View file

@ -167,7 +167,7 @@
"sp": "Cambiar el idioma a Español."
},
"url": "https://store.steampowered.com/",
"check": "document.getElementsByTagName('html')[0].lang == 'fr'",
"check": "document.getElementsByTagName('html')[0].lang == '#LANGUAGE_CODE#'",
"skip_time": 60
},