Skip to content

Commit

Permalink
Merge pull request #1735 from Geode/translation-tags
Browse files Browse the repository at this point in the history
Translation tags
  • Loading branch information
ingenieroariel committed Oct 23, 2014
2 parents 7de1b9c + 8e5c042 commit ced17fc
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 25 deletions.
2 changes: 1 addition & 1 deletion geonode/static/geonode/js/upload/FileType.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ define(function (require, exports) {
$.each(this.requires, function (idx, req) {
idx = $.inArray(req, extensions);
if (idx === -1) {
errors.push('Missing a ' + req + ' file, which is required');
errors.push(interpolate(gettext('Missing a %s file, which is required'),[req]));
}
});
return errors;
Expand Down
12 changes: 6 additions & 6 deletions geonode/static/geonode/js/upload/FileTypes.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,38 +4,38 @@ define(['./FileType'], function (FileType) {
'use strict';
return {
SHP: new FileType({
name: 'ESRI Shapefile',
name: gettext('ESRI Shapefile'),
format: 'vector',
main: 'shp',
requires: ['shp', 'prj', 'dbf', 'shx']
}),
TIF: new FileType({
name: 'GeoTiff File',
name: gettext('GeoTiff File'),
format: 'raster',
main: 'tif',
requires: ['tif']
}),
TIFF: new FileType({
name: 'GeoTiff File',
name: gettext('GeoTiff File'),
format: 'raster',
main: 'tiff',
requires: ['tiff']
}),
// These types only supported by importer based Uplaod
CSV: new FileType({
name: 'Comma Separated File',
name: gettext('Comma Separated File'),
format: 'vector',
main: 'csv',
requires: ['csv']
}),
KML: new FileType({
name: 'Google Earth KML',
name: gettext('Google Earth KML'),
format: 'vector',
main: 'kml',
requires: ['kml']
}),
ZIP: new FileType({
name: 'Zip Archives',
name: gettext('Zip Archives'),
format: 'archive',
main: 'zip',
requires: ['zip']
Expand Down
30 changes: 15 additions & 15 deletions geonode/static/geonode/js/upload/LayerInfo.js
Original file line number Diff line number Diff line change
Expand Up @@ -246,11 +246,11 @@ define(function (require, exports) {

LayerInfo.prototype.displayUploadedLayerLinks = function(resp) {
var self = this;
var a = '<a href="' + resp.url + '" class="btn">Layer Info</a>';
var b = '<a href="' + resp.url + '/metadata" class="btn">Edit Metadata</a>';
var c = '<a href="' + resp.url + '/style/manage" class="btn">Manage Styles</a>';
var a = '<a href="' + resp.url + '" class="btn">' + gettext('Layer Info') + '</a>';
var b = '<a href="' + resp.url + '/metadata" class="btn">' + gettext('Edit Metadata') + '</a>';
var c = '<a href="' + resp.url + '/style/manage" class="btn">' + gettext('Manage Styles') + '</a>';
self.logStatus({
msg: '<p> Your layer was successfully uploaded<br/><br/>' + a + '&nbsp;&nbsp;&nbsp;' + b + '&nbsp;&nbsp;&nbsp;' + c + '</p>',
msg: '<p>' + gettext('Your layer was successfully uploaded') + '<br/><br/>' + a + '&nbsp;&nbsp;&nbsp;' + b + '&nbsp;&nbsp;&nbsp;' + c + '</p>',
level: 'alert-success',
empty: 'true'
});
Expand Down Expand Up @@ -279,7 +279,7 @@ define(function (require, exports) {
async: true,
beforeSend: function() {
self.logStatus({
msg: '<p>Performing Final GeoServer Config Step <img class="pull-right" src="/static/geonode/img/loading.gif"></p>',
msg: '<p>' + gettext('Performing Final GeoServer Config Step') + '<img class="pull-right" src="/static/geonode/img/loading.gif"></p>',
level: 'alert-success',
empty: 'true'
});
Expand All @@ -294,7 +294,7 @@ define(function (require, exports) {
self.polling = false;
if (resp.status === "other") {
self.logStatus({
msg:'<p>You need to specify more information in order to complete your upload</p>',
msg:'<p>' + gettext('You need to specify more information in order to complete your upload') + '</p>',
level: 'alert-success',
empty: 'true'
});
Expand All @@ -308,15 +308,15 @@ define(function (require, exports) {
var element = 'next_step_' + id
var a = '<a id="' + element + '" class="btn">Continue</a>';
self.logStatus({
msg:'<p>You need to specify more information in order to complete your upload.</p><p>You can continue configuring your layer.</p><p>' + a + '</p>',
msg:'<p>' + gettext('You need to specify more information in order to complete your upload.') + '</p><p>' + gettext('You can continue configuring your layer.') + '</p><p>' + a + '</p>',
level: 'alert-success',
empty: 'true'
});
$("#" + element).on('click', resp, self.doResume);
return;
} else if (resp.status === "other") {
self.logStatus({
msg:'<p>You need to specify more information in order to complete your upload</p>',
msg:'<p>' + gettext('You need to specify more information in order to complete your upload') + '</p>',
level: 'alert-success',
empty: 'true'
});
Expand All @@ -326,7 +326,7 @@ define(function (require, exports) {
} else {
self.polling = false;
self.logStatus({
msg:'<p>Unexpected Error</p>',
msg:'<p>' + gettext('Unexpected Error') + '</p>',
level: 'alert-error',
empty: 'true'
});
Expand All @@ -342,7 +342,7 @@ define(function (require, exports) {
LayerInfo.prototype.doStep = function (resp) {
var self = this;
self.logStatus({
msg: '<p>Performing GeoServer Config Step</p>',
msg: '<p>' + gettext('Performing GeoServer Config Step') + '</p>',
level: 'alert-success',
empty: 'true'
});
Expand Down Expand Up @@ -411,10 +411,10 @@ define(function (require, exports) {
error: function (jqXHR) {
self.polling = false;
if (jqXHR === null) {
self.markError("Unexpected Error");
self.markError(gettext('Unexpected Error'));
} else {
var parsed_errors = $.parseJSON(jqXHR.responseText)
var error_message = 'No error message supplied';
var error_message = gettext('No error message supplied');

// Support the two different syntax used in GeoNode.
// TODO(Ariel): Agree on one of those server side and
Expand All @@ -429,7 +429,7 @@ define(function (require, exports) {
},
success: function (resp, status) {
self.logStatus({
msg: '<p> Layer files uploaded, configuring in GeoServer</p>',
msg: '<p>' + gettext('Layer files uploaded, configuring in GeoServer') + '</p>',
level: 'alert-success',
empty: 'true',
});
Expand All @@ -444,7 +444,7 @@ define(function (require, exports) {
data: {results:geogit_stores, text:'name'},
formatSelection: format,
formatResult: format,
placeholder: 'Select or create a Geogit repository.',
placeholder: gettext('Select or create a Geogit repository.'),

id: function(object) {
return object.name;
Expand Down Expand Up @@ -539,7 +539,7 @@ define(function (require, exports) {
$.each(this.files, function (idx, file) {
var li = $('<li/>').appendTo(ul),
p = $('<p/>', {text: file.name}).appendTo(li),
a = $('<a/>', {text: ' Remove'});
a = $('<a/>', {text: ' ' + gettext('Remove')});

a.data('layer', self.name);
a.data('file', file.name);
Expand Down
4 changes: 2 additions & 2 deletions geonode/static/geonode/js/upload/upload.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ define(['underscore',
if (!info.type) {
log_error({
title: 'Unsupported type',
message: 'File ' + info.files[0].name + ' is an unsupported file type, please select another file.'
message: interpolate(gettext('The file %s is an unsupported file type, please select another file.',[info.files[0].name]))
});
delete layers[name];
} else {
Expand Down Expand Up @@ -283,7 +283,7 @@ define(['underscore',
doUploads = function () {
var checked = checkFiles();
if ($.isEmptyObject(layers) || !checked) {
alert('You are uploading an incomplete set of files.');
alert(gettext('You are uploading an incomplete set of files.'));
} else {
$.each(layers, function (name, layerinfo) {
layerinfo.uploadFiles();
Expand Down
2 changes: 1 addition & 1 deletion geonode/templates/search/_sort_filters.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
{% block bulk_perms_button %}
{% if request.user.is_authenticated %}
<div class="col-md-2 pull-right">
<button data-toggle="modal" class="btn btn-default btn-block" data-target="#_bulk_permissions">Set permissions</button>
<button data-toggle="modal" class="btn btn-default btn-block" data-target="#_bulk_permissions">{% trans "Set permissions" %}</button>
</div>
{% endif %}
{% endblock %}

0 comments on commit ced17fc

Please sign in to comment.