Workaround for js files generating warnings with generate_pot script
With xgettext set to python it will parse the comments in javascript files, so single apostrophes or quotes are flagged as 'warning: untermined string'. This change just rewrites js comments to not use apostrophes.
This commit is contained in:
parent
576df1f6e3
commit
a391bbd67b
|
@ -39,12 +39,12 @@
|
|||
*/
|
||||
Deluge.Formatters = {
|
||||
/**
|
||||
* Formats a date string in the locale's date representation based on the
|
||||
* systems timezone.
|
||||
* Formats a date string in the date representation of the current locale,
|
||||
* based on the systems timezone.
|
||||
*
|
||||
* @param {Number} timestamp time in seconds since the Epoch
|
||||
* @return {String} a string in the locale's date representation or ""
|
||||
* if seconds < 0
|
||||
* @param {Number} timestamp time in seconds since the Epoch.
|
||||
* @return {String} a string in the date representation of the current locale
|
||||
* or "" if seconds < 0.
|
||||
*/
|
||||
date: function(timestamp) {
|
||||
function zeroPad(num, count) {
|
||||
|
|
|
@ -267,9 +267,8 @@ Deluge.OptionsManager = Ext.extend(Ext.util.Observable, {
|
|||
},
|
||||
|
||||
/**
|
||||
* Lets the option manager know when a field is focused so if a value
|
||||
* changing operation is performed it won't change the value of the
|
||||
* field.
|
||||
* Lets the option manager know when a field is focused so if a value changing
|
||||
* operation is performed it will not change the value of the field.
|
||||
*/
|
||||
onFieldFocus: function(field, event) {
|
||||
this.focused = field;
|
||||
|
@ -279,8 +278,7 @@ Deluge.OptionsManager = Ext.extend(Ext.util.Observable, {
|
|||
// If we don't have a bind there's nothing to do.
|
||||
if (Ext.isEmpty(this.binds[option])) return;
|
||||
Ext.each(this.binds[option], function(bind) {
|
||||
// The field is currently focused so we don't want to
|
||||
// change it.
|
||||
// The field is currently focused so we do not want to change it.
|
||||
if (bind == this.focused) return;
|
||||
// Set the form field to the new value.
|
||||
bind.setValue(newValue);
|
||||
|
|
|
@ -149,7 +149,7 @@ Deluge.Sidebar = Ext.extend(Ext.Panel, {
|
|||
}
|
||||
}
|
||||
|
||||
// Perform a cleanup of fitlers that aren't enabled any more
|
||||
// Perform a cleanup of fitlers that are not enabled any more.
|
||||
Ext.each(Ext.keys(this.panels), function(filter) {
|
||||
if (Ext.keys(filters).indexOf(filter) == -1) {
|
||||
// We need to remove the panel
|
||||
|
|
|
@ -82,7 +82,7 @@ Deluge.StatusbarMenu = Ext.extend(Ext.menu.Menu, {
|
|||
},
|
||||
|
||||
onLimitChanged: function(item, checked) {
|
||||
if (!checked || item.value == 'other') return; // we don't care about unchecks or other
|
||||
if (!checked || item.value == 'other') return; // We do not care about unchecked or other.
|
||||
var config = {}
|
||||
config[item.group] = item.value
|
||||
deluge.client.core.set_config(config, {
|
||||
|
|
|
@ -75,8 +75,7 @@ Deluge.details.DetailsPanel = Ext.extend(Ext.TabPanel, {
|
|||
|
||||
/* Event Handlers */
|
||||
|
||||
// We need to add the events in onRender since Deluge.Torrents hasn't
|
||||
// been created yet.
|
||||
// We need to add the events in onRender since Deluge.Torrents has not been created yet.
|
||||
onRender: function(ct, position) {
|
||||
Deluge.details.DetailsPanel.superclass.onRender.call(this, ct, position);
|
||||
deluge.events.on('disconnect', this.clear, this);
|
||||
|
|
|
@ -106,7 +106,7 @@ Deluge.details.DetailsTab = Ext.extend(Ext.Panel, {
|
|||
};
|
||||
|
||||
for (var field in this.fields) {
|
||||
if (!Ext.isDefined(data[field])) continue; // this is a field we aren't responsible for.
|
||||
if (!Ext.isDefined(data[field])) continue; // This is a field we are not responsible for.
|
||||
if (data[field] == this.oldData[field]) continue;
|
||||
this.fields[field].dom.innerHTML = Ext.escapeHTML(data[field]);
|
||||
}
|
||||
|
|
|
@ -375,7 +375,7 @@ Deluge.details.OptionsTab = Ext.extend(Ext.form.FormPanel, {
|
|||
update: function(torrentId) {
|
||||
if (this.torrentId && !torrentId) this.clear(); // we want to clear the pane if we get a null torrent torrentIds
|
||||
|
||||
if (!torrentId) return; // we don't care about null torrentIds
|
||||
if (!torrentId) return; // We do not care about null torrentIds.
|
||||
|
||||
if (this.torrentId != torrentId) {
|
||||
this.torrentId = torrentId;
|
||||
|
|
|
@ -150,7 +150,7 @@
|
|||
}, this);
|
||||
store.add(newPeers);
|
||||
|
||||
// Remove any peers that shouldn't be left in the store
|
||||
// Remove any peers that should not be left in the store.
|
||||
store.each(function(record) {
|
||||
if (!addresses[record.id]) {
|
||||
store.remove(record);
|
||||
|
|
|
@ -75,8 +75,9 @@ with open(infiles_list, "wb") as f:
|
|||
f.write(line + "\n")
|
||||
|
||||
# Force xgettext language to parse javascript and update pot file
|
||||
# Note: For javascript files xgettext will parse comments, so single apostrophes or quotes are
|
||||
# flagged as a 'warning: untermined string'. Either ignore warning or edit javascript comment.
|
||||
output = call(xgettext_cmd + ["--language=Python", "-j"])
|
||||
print "====== Javascript 'unterminated string' warnings can be ignored ======"
|
||||
|
||||
# Replace YEAR and PACKAGE in the copyright message
|
||||
with open(pot_filepath, "r") as f:
|
||||
|
|
Loading…
Reference in New Issue