Skip to content

Commit d647dab

Browse files
committed
Load multilang support globally
While loading the multilang support only on the respective pages sounds like a good idea, it complicates matters with the Turbo migration (since we would need to opt-out of some cases). Also, the exercise description is used in too many places, whereas the snippet is rather short and the performance impact to load it globally is rather minimal. Amends 7d4dd2c
1 parent c44332f commit d647dab

File tree

6 files changed

+1
-8
lines changed

6 files changed

+1
-8
lines changed

app/views/exercises/_form.html.slim

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
- content_for :head do
2-
- append_stylesheet_pack_tag("multilang_#{I18n.locale}")
32
- append_javascript_pack_tag('sortable')
43
- append_javascript_pack_tag('toast-ui')
54
- append_stylesheet_pack_tag('toast-ui')

app/views/exercises/_tips_content.html.slim

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
- content_for :head do
22
- append_javascript_pack_tag('highlight')
33
- append_stylesheet_pack_tag('highlight')
4-
- append_stylesheet_pack_tag("multilang_#{I18n.locale}")
54

65
#tips.card.d-block.overflow-scroll role='tab'
76
.card-header.py-2

app/views/exercises/implement.html.slim

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
- content_for :head do
2-
- append_stylesheet_pack_tag("multilang_#{I18n.locale}")
3-
41
#editor-column
52
- unless @embed_options[:hide_exercise_description]
63
.exercise.clearfix

app/views/layouts/application.html.slim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ html lang=I18n.locale data-default-locale=I18n.default_locale
1212
= favicon_link_tag('/icon.png', rel: 'apple-touch-icon', type: 'image/png')
1313
= tag.link rel: 'manifest', href: pwa_manifest_path
1414
= action_cable_meta_tag
15-
= stylesheet_pack_tag('application', 'stylesheets', media: 'all', 'data-turbo-track': 'reload', integrity: true, crossorigin: 'anonymous')
15+
= stylesheet_pack_tag('application', 'stylesheets', "multilang_#{I18n.locale}", media: 'all', 'data-turbo-track': 'reload', integrity: true, crossorigin: 'anonymous')
1616
= stylesheet_link_tag('application', media: 'all', 'data-turbo-track': 'reload', integrity: true, crossorigin: 'anonymous')
1717
// Since d3-tip is loaded via a separate pack and requires the application pack to be loaded first, we cannot use `defer` here.
1818
= javascript_pack_tag('application', 'data-turbo-track': 'reload', defer: false, integrity: true, crossorigin: 'anonymous')

app/views/tips/_form.html.slim

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
- content_for :head do
2-
- append_stylesheet_pack_tag("multilang_#{I18n.locale}")
32
- append_javascript_pack_tag('toast-ui')
43
- append_stylesheet_pack_tag('toast-ui')
54

app/views/tips/show.html.slim

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
- content_for :head do
22
- append_javascript_pack_tag('highlight')
33
- append_stylesheet_pack_tag('highlight')
4-
- append_stylesheet_pack_tag("multilang_#{I18n.locale}")
54

65
h1
76
= @tip.to_s

0 commit comments

Comments
 (0)