Skip to content

Commit

Permalink
Mark more strings for translations (#581)
Browse files Browse the repository at this point in the history
* caravel: mark viz strings for translations

* caravel: mark templates string for translation

* caravel: make forms strings translatable

* Update translations
  • Loading branch information
xrmx authored and mistercrunch committed Jun 9, 2016
1 parent cdb573e commit 8a579e2
Show file tree
Hide file tree
Showing 12 changed files with 5,060 additions and 804 deletions.
1,077 changes: 967 additions & 110 deletions babel/messages.pot

Large diffs are not rendered by default.

327 changes: 164 additions & 163 deletions caravel/forms.py

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion caravel/templates/appbuilder/navbar.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
{% include 'appbuilder/navbar_menu.html' %}
</ul>
<ul class="nav navbar-nav navbar-right">
<li><a href="http://airbnb.io/caravel"><i class="fa fa-book"></i> Documentation</a></li>
<li><a href="http://airbnb.io/caravel"><i class="fa fa-book"></i> {{_("Documentation") }}</a></li>
{% include 'appbuilder/navbar_right.html' %}
</ul>
</div>
Expand Down
34 changes: 17 additions & 17 deletions caravel/templates/caravel/explore.html
Original file line number Diff line number Diff line change
Expand Up @@ -55,26 +55,26 @@
</span>
{% endif %}
<div class="pull-right">
<span id="is_cached" class="label label-default" title="Force refresh" data-toggle="tooltip">
<span id="is_cached" class="label label-default" title={{_("Force refresh")}} data-toggle="tooltip">
cached
</span>
<div class="btn-group results" role="group">
<a role="button" tabindex="0" class="btn btn-default" id="shortner" data-toggle="popover" data-trigger="focus">
<i class="fa fa-link" data-toggle="tooltip" title="Short URL"></i>&nbsp;
<i class="fa fa-link" data-toggle="tooltip" title={{_("Short URL")}}></i>&nbsp;
</a>
<span class="btn btn-default" id="standalone" title="Standalone version, use to embed anywhere" data-toggle="tooltip">
<span class="btn btn-default" id="standalone" title={{ _("Standalone version, use to embed anywhere") }} data-toggle="tooltip">
<i class="fa fa-code"></i>&nbsp;
</span>
<span class="btn btn-default " id="json" title="Export to .json" data-toggle="tooltip">
<span class="btn btn-default " id="json" title={{ _("Export to .json")}} data-toggle="tooltip">
<i class="fa fa-file-code-o"></i>
.json
</span>
<span class="btn btn-default {{ "disabled disabledButton" if not can_download }}" id="csv" title="Export to .csv format" data-toggle="tooltip">
<span class="btn btn-default {{ "disabled disabledButton" if not can_download }}" id="csv" title={{ _("Export to .csv format") }} data-toggle="tooltip">
<i class="fa fa-file-text-o"></i>.csv
</span>
<span class="btn btn-warning notbtn" id="timer">0 sec</span>
<span class="btn btn-warning notbtn" id="timer">{{ _("0 sec") }}</span>
<span class="btn btn-info disabled query"
data-toggle="modal" data-target="#query_modal">query</span>
data-toggle="modal" data-target="#query_modal">{{ _("query") }}</span>
</div>
</div>
<hr/>
Expand All @@ -83,15 +83,15 @@
<div class="row center-block">
<div class="btn-group query-and-save">
<button type="button" class="btn btn-primary query">
<i class="fa fa-bolt"></i>Query
<i class="fa fa-bolt"></i>{{ _("Query") }}
</button>
{% if viz.form_data.slice_id %}
<button type="button" class="btn btn-default {{ "disabled disabledButton" if not can_edit }}" id="btn_overwrite">
<i class="fa fa-save"></i>Overwrite
<i class="fa fa-save"></i>{{ _("Overwrite") }}
</button>
{% endif %}
<button type="button" class="btn btn-default {{ "disabled disabledButton" if not can_add }}" id="btn_save">
<i class="fa fa-plus-circle"></i>Save as
<i class="fa fa-plus-circle"></i>{{ _("Save as") }}
</button>
</div>
</div>
Expand Down Expand Up @@ -134,10 +134,10 @@
{% endfor %}
<div class="panel panel-default">
<div class="panel-heading">
<span class="legend_label">Filters</span>
<span class="legend_label">{{ _("Filters") }}</span>
<i class="fa fa-info-circle" data-toggle="tooltip"
data-placement="bottom"
title="Filters are defined using comma delimited strings as in 'US,FR,Other'"></i>
title={{_("Filters are defined using comma delimited strings as in 'US,FR,Other'")}}></i>
<span class="collapser"> [-]</span>
</div>
<div class="panel-body">
Expand All @@ -155,7 +155,7 @@
<div id="filters"></div>
<button type="button" id="plus" class="btn btn-default btn-sm" aria-label="Add a filter">
<span class="fa fa-plus" aria-hidden="true"></span>
<span>Add filter</span>
<span>{{ _("Add filter") }}</span>
</button>
</div>
</div>
Expand Down Expand Up @@ -189,13 +189,13 @@
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
<h4 class="modal-title">Query</h4>
<h4 class="modal-title">{{ _("Query") }}</h4>
</div>
<div class="modal-body">
<pre id="query_container"></pre>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
<button type="button" class="btn btn-default" data-dismiss="modal">{{ _("Close") }}</button>
</div>
</div>
</div>
Expand All @@ -207,13 +207,13 @@ <h4 class="modal-title">Query</h4>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
<h4 class="modal-title">Datasource Description</h4>
<h4 class="modal-title">{{ _("Datasource Description") }}</h4>
</div>
<div class="modal-body">
{{ datasource.description_markeddown | safe }}
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
<button type="button" class="btn btn-default" data-dismiss="modal">{{ _("Close") }}</button>
</div>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion caravel/templates/caravel/models/database/macros.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{% macro testconn() %}
<script>
$("#sqlalchemy_uri").parent()
.append('<button id="testconn" class="btn">Test Connection</button>');
.append('<button id="testconn" class="btn">{{ _("Test Connection") }}</button>');
$("#testconn").click(function(e) {
e.preventDefault();
var url = "/caravel/testconn";
Expand Down
4 changes: 2 additions & 2 deletions caravel/templates/caravel/sql.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ <h3>db: [{{ db }}]</h3>
<div class="row interactions">
<div class="col-xs-7">
<input type="hidden" id="database_id" value="{{ db.id }}">
<button class="btn btn-primary" id="run">Run!</button>
<button class="btn btn-default" id="create_view">Create View</button>
<button class="btn btn-primary" id="run">{{_("Run!")}}</button>
<button class="btn btn-default" id="create_view">{{_("Create View")}}</button>
</div>
<div class="col-xs-5">
<select id="dbtable">
Expand Down
4 changes: 2 additions & 2 deletions caravel/templates/caravel/welcome.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ <h3>{{ _("Welcome!") }}</h3>
<div class="row">
<div class="col-md-12">
<span class="pull-left">
<h5><i class="fa fa-dashboard"></i> Dashboards</h5>
<h5><i class="fa fa-dashboard"></i> {{ _("Dashboards") }}</h5>
</span>
<span class="search pull-right"></span>
<span class="pull-right">
Expand All @@ -43,7 +43,7 @@ <h5><i class="fa fa-search"></i></h5>
<div class="row">
<div class="col-md-12">
<span class="pull-left">
<h5><i class="fa fa-bar-chart"></i> Slices</h5>
<h5><i class="fa fa-bar-chart"></i> {{ _("Slices") }}</h5>
</span>
<span class="search pull-right"></span>
<span class="pull-right">
Expand Down
Loading

0 comments on commit 8a579e2

Please sign in to comment.