lint: Add rule for spacing inside Handlebars translation tags.

This commit also includes the fixes to make all Handlebars templates
compliant with the new rule.
This commit is contained in:
Yago González
2017-06-10 12:32:06 +02:00
committed by Tim Abbott
parent 3a4c6f83fc
commit 7d5d8ac61e
3 changed files with 4 additions and 2 deletions

View File

@@ -15,7 +15,7 @@
<div class="progressive-table-wrapper">
<table class="table table-condensed table-striped wrapped-table">
<tbody id="admin_bots_table" class="admin_bot_table required-text thick"
data-empty="{{ t 'No bots match your current filter.' }}"></tbody>
data-empty="{{t 'No bots match your current filter.' }}"></tbody>
</table>
</div>
<div id="admin_page_bots_loading_indicator"></div>

View File

@@ -5,7 +5,7 @@
</div>
<div>
<span>{{ t 'Download config of all active outgoing webhook bots in Zulip Botserver format.' }}</span>
<span>{{t 'Download config of all active outgoing webhook bots in Zulip Botserver format.' }}</span>
<a type="submit" download="{{flaskbotrc}}" id= "download_flaskbotrc" class="btn" title="{{t 'Download flaskbotrc' }}">
<i class="icon-vector-download-alt sea-green"></i>
</a>

View File

@@ -389,6 +389,8 @@ def build_custom_checkers(by_lang):
handlebars_rules = html_rules + [
{'pattern': "[<]script",
'description': "Do not use inline <script> tags here; put JavaScript in static/js instead."},
{'pattern': '{{ t ("|\')',
'description': 'There should be no spaces before the "t" in a translation tag.'},
{'pattern': "{{t '.*' }}[\.\?!]",
'description': "Period should be part of the translatable string."},
{'pattern': '{{t ".*" }}[\.\?!]',