Skip to content

Commit

Permalink
make this translatable
Browse files Browse the repository at this point in the history
wow why does inserting liquid variables directly into inline js even
work, that is horrifying and highly convenient
  • Loading branch information
Plailect committed Apr 17, 2019
1 parent 1e18e45 commit 4d8ecee
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
3 changes: 3 additions & 0 deletions _data/navigation/en_US.yml
Expand Up @@ -33,6 +33,9 @@ main:
-
title: Uninstall CFW
url: uninstall-cfw
top:
-
title: This website uses cookies to display the current guide progress on the sidebar and otherwise enhance the site.
bottom:
-
title: For support in English, ask for help at <a href="https://discord.gg/MWxPgEp">Nintendo Homebrew on Discord</a>.
Expand Down
12 changes: 11 additions & 1 deletion _includes/head/custom.html
Expand Up @@ -17,6 +17,16 @@
<meta name="msapplication-config" content="{{ base_path }}/images/browserconfig.xml?v=PYEmwKvQAx">
<meta name="theme-color" content="#2E3440">


{% assign split_path = page.path | split: "/" %}
{% assign locale = split_path[1] %}
{% if locale == 'en_US' %}
{% assign locale_var = '/' %}
{% else %}
{% assign locale_var = locale | prepend:'/' | append:'/' %}
{% endif %}
{% assign top = site.data.navigation[locale].top %}

<link rel="stylesheet" type="text/css" href="//cdnjs.cloudflare.com/ajax/libs/cookieconsent2/3.1.0/cookieconsent.min.css" />
<script src="//cdnjs.cloudflare.com/ajax/libs/cookieconsent2/3.1.0/cookieconsent.min.js"></script>
<script>
Expand All @@ -34,7 +44,7 @@
"position": "top",
"static": true,
"content": {
"message": "This website uses cookies to display the current guide progress on the sidebar."
"message": "{{ top[0].title }}"
}
})});
</script>
Expand Down

0 comments on commit 4d8ecee

Please sign in to comment.