Skip to content

Commit

Permalink
Enhance the correctness check
Browse files Browse the repository at this point in the history
  • Loading branch information
boryanagoncharenko committed Oct 15, 2024
1 parent bce3465 commit 623b8e8
Show file tree
Hide file tree
Showing 10 changed files with 93 additions and 1,316 deletions.
32 changes: 0 additions & 32 deletions app.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@
from hedy_error import get_error_text
from safe_format import safe_format
from config import config

from website.flask_helpers import render_template, proper_tojson, JinjaCompatibleJsonProvider
from hedy_content import (ADVENTURE_ORDER_PER_LEVEL, KEYWORDS_ADVENTURES, ALL_KEYWORD_LANGUAGES,
ALL_LANGUAGES, COUNTRIES, HOUR_OF_CODE_ADVENTURES)
Expand Down Expand Up @@ -448,34 +447,6 @@ def before_request_https():
# Explicitly substitute the flask gettext function with our custom definition which uses fallback languages
app.jinja_env.globals.update(_=gettext)

trans_cache = {}


# def our_gettext(id):
# locale = session['lang']
# res = gettext(id)
# if locale != 'en' and res == id:
# with force_locale('en'):
# res = gettext(id)
# return res
# global trans_cache
#
# locale = session['lang']
#
# if locale not in trans_cache.keys():
# lang_trans = get_translations()
# if locale != 'en':
# try:
# with force_locale('en'):
# fallback_translation = get_translations()
# lang_trans.add_fallback(fallback_translation)
# finally:
# force_locale(locale)
# trans_cache[locale] = lang_trans
#
# t = trans_cache[locale].gettext(x)
# print(t)


# We don't need to log in offline mode
if utils.is_offline_mode():
Expand Down Expand Up @@ -2344,9 +2315,6 @@ def favicon():
@app.route('/index.html')
def main_page():
sections = hedyweb.PageTranslations('start').get_page_translations(g.lang)['home-sections']

# my_test = gettext('no_programs')

sections = sections[:]

# Sections have 'title', 'text'
Expand Down
7 changes: 6 additions & 1 deletion content/cheatsheets/om.yaml
Original file line number Diff line number Diff line change
@@ -1 +1,6 @@
{}
1:
- {}
- name: 'OM {ask}'
- name: 'OM {print} emojis'
explanation: OM Print an emoji with `{print}`.
demo_code: '{print} 🙋 🌍 ❗'
9 changes: 8 additions & 1 deletion content/client-messages/om.yaml
Original file line number Diff line number Diff line change
@@ -1 +1,8 @@
{}
Transpile_error: OM we can't parse your program
#Extra_property: this property should make the check fail!
Transpile_success:
-
-
- OM Well done!
- OM Excellent!
- OM You did great!
Loading

0 comments on commit 623b8e8

Please sign in to comment.