2
0
mirror of https://github.com/moebooru/moebooru synced 2025-08-31 05:55:11 +00:00

Move i18n js side setters

Seems better done in application instead of inlined and potentially done in wrong timing.
Still wrong timing though.
This commit is contained in:
nanaya
2020-04-04 02:40:57 +09:00
parent 55011ceb9a
commit 12c81d7395
3 changed files with 12 additions and 5 deletions

View File

@@ -27,6 +27,9 @@
#= require_tree ./_classes
I18n.defaultLocale = locale.default
I18n.locale = locale.current
Moe.checkAll = new Moe.CheckAll
Moe.timeago = new Moe.Timeago

View File

@@ -1,4 +0,0 @@
<script type="text/javascript">
I18n.defaultLocale = "<%= I18n.default_locale %>";
I18n.locale = "<%= I18n.locale %>";
</script>

View File

@@ -32,9 +32,17 @@
<script id="user-blacklisted-tags" type="application/json">
<%= json_escape @current_user.blacklisted_tags_array.to_json.html_safe %>
</script>
<script type="text/javascript">
window.locale = {
current: "<%= I18n.locale %>",
default: "<%= I18n.default_locale %>",
}
</script>
<%= javascript_include_tag :application %>
<%= javascript_include_tag 'application-legacy' %>
<%= render 'layouts/locale' %>
<!--[if lt IE 8]>
<script src="/IE8.js" type="text/javascript"></script>
<![endif]-->