Browse Source

fixed i18n mistake

pull/2/head
gorhill 10 years ago
parent
commit
9a40eb17a0
  1. 8
      src/_locales/en/messages.json
  2. 13
      src/js/cookies.js

8
src/_locales/en/messages.json

@ -120,7 +120,7 @@
"description": "A menu entry in the matrix popup" "description": "A menu entry in the matrix popup"
}, },
"matrixLoggerMenuEntry" : { "matrixLoggerMenuEntry" : {
"message": "Go to request log",
"message": "Go to logger",
"description": "A menu entry in the matrix popup" "description": "A menu entry in the matrix popup"
}, },
"matrixDashboardMenuEntry" : { "matrixDashboardMenuEntry" : {
@ -229,7 +229,7 @@
"description": "" "description": ""
}, },
"statsPageDetailed" : { "statsPageDetailed" : {
"message": "Request log",
"message": "Logger",
"description": "" "description": ""
}, },
"statsPageLogSizePrompt1" : { "statsPageLogSizePrompt1" : {
@ -596,11 +596,11 @@
"description": "An entry for when a cookie is deleted" "description": "An entry for when a cookie is deleted"
}, },
"loggerEntryDeleteCookieError" : { "loggerEntryDeleteCookieError" : {
"message": "browser cache cleared",
"message": "failed to delete cookie: {{value}}",
"description": "An entry for when the browser cache is cleared" "description": "An entry for when the browser cache is cleared"
}, },
"loggerEntryBrowserCacheCleared" : { "loggerEntryBrowserCacheCleared" : {
"message": "failed to delete cookie: {{value}}",
"message": "browser cache cleared",
"description": "An entry for when a cookie can't be deleted" "description": "An entry for when a cookie can't be deleted"
}, },
"loggerEntryAssetUpdated" : { "loggerEntryAssetUpdated" : {

13
src/js/cookies.js

@ -287,8 +287,6 @@ var removeCookieAsync = function(cookieKey) {
/******************************************************************************/ /******************************************************************************/
// TODO: i18n
var chromeCookieRemove = function(url, name) { var chromeCookieRemove = function(url, name) {
var sessionCookieKey = cookieKeyFromCookieURL(url, 'session', name); var sessionCookieKey = cookieKeyFromCookieURL(url, 'session', name);
var persistCookieKey = cookieKeyFromCookieURL(url, 'persistent', name); var persistCookieKey = cookieKeyFromCookieURL(url, 'persistent', name);
@ -296,18 +294,18 @@ var chromeCookieRemove = function(url, name) {
var success = !!details; var success = !!details;
if ( removeCookieFromDict(sessionCookieKey) ) { if ( removeCookieFromDict(sessionCookieKey) ) {
if ( success ) { if ( success ) {
µm.logger.writeOne('', 'info', vAPI.i18n('loggerEntryCookieDeleted').replace('{{value}}', sessionCookieKey));
µm.logger.writeOne('', 'info', i18nCookieDeleteSuccess.replace('{{value}}', sessionCookieKey));
µm.cookieRemovedCounter += 1; µm.cookieRemovedCounter += 1;
} else { } else {
µm.logger.writeOne('', 'error', vAPI.i18n('loggerEntryDeleteCookieError').replace('{{value}}', sessionCookieKey));
µm.logger.writeOne('', 'error', i18nCookieDeleteFailure.replace('{{value}}', sessionCookieKey));
} }
} }
if ( removeCookieFromDict(persistCookieKey) ) { if ( removeCookieFromDict(persistCookieKey) ) {
if ( success ) { if ( success ) {
µm.logger.writeOne('', 'info', vAPI.i18n('loggerEntryCookieDeleted').replace('{{value}}', persistCookieKey));
µm.logger.writeOne('', 'info', i18nCookieDeleteSuccess.replace('{{value}}', persistCookieKey));
µm.cookieRemovedCounter += 1; µm.cookieRemovedCounter += 1;
} else { } else {
µm.logger.writeOne('', 'error', vAPI.i18n('loggerEntryDeleteCookieError').replace('{{value}}', persistCookieKey));
µm.logger.writeOne('', 'error', i18nCookieDeleteFailure.replace('{{value}}', persistCookieKey));
} }
} }
}; };
@ -315,6 +313,9 @@ var chromeCookieRemove = function(url, name) {
vAPI.cookies.remove({ url: url, name: name }, callback); vAPI.cookies.remove({ url: url, name: name }, callback);
}; };
var i18nCookieDeleteSuccess = vAPI.i18n('loggerEntryCookieDeleted');
var i18nCookieDeleteFailure = vAPI.i18n('loggerEntryDeleteCookieError');
/******************************************************************************/ /******************************************************************************/
var processPageRecordQueue = function() { var processPageRecordQueue = function() {

Loading…
Cancel
Save