Skip to content

Commit

Permalink
[#1733] Option to hide <script> tag in #{i18n /}
Browse files Browse the repository at this point in the history
  • Loading branch information
mkurz authored and Notalifeform committed Oct 13, 2013
1 parent ac806cd commit e693fbf
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
8 changes: 8 additions & 0 deletions documentation/manual/tags.textile
Expand Up @@ -287,6 +287,14 @@ Optionally, you can restrict the tag to only some messages. The wildcard charact

bc. #{i18n keys:['title', 'menu.*'] /}

By default, the #{i18n /} tag renders a

bc. <script type="text/javascript">...</script>

tag around the generated JavaScript. You can hide this tag by setting @noScriptTag@ to @true@:

bc. #{i18n keys:['title', 'menu.*'], noScriptTag:true /}

h2. <a name="if">if</a>

Evaluates the given test, and if true, evaluates the tag body.
Expand Down
6 changes: 4 additions & 2 deletions framework/templates/tags/i18n.tag
Expand Up @@ -6,8 +6,9 @@ if (_keys) {
}
js_messages=new com.google.gson.Gson().toJson(ymessages);
}%
#{if !_noScriptTag}
<script type="text/javascript">

#{/if}
var i18nMessages = ${js_messages};

/**
Expand Down Expand Up @@ -40,5 +41,6 @@ var i18n = function(code) {
}
return message;
};

#{if !_noScriptTag}
</script>
#{/if}

0 comments on commit e693fbf

Please sign in to comment.